Advertisement
sbloom85

PonyRGB

Jun 10th, 2015
348
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.68 KB | None | 0 0
  1. using UnityEngine;
  2. using UnityEngine.UI;
  3. using System.Collections;
  4.  
  5. public class PonyRGB : MonoBehaviour {
  6.  
  7.     public Slider[] ponyRGB;
  8.     public Image[] ponyImage;
  9.     int[] sliderInt = new int[3];
  10.  
  11.     // Use this for initialization
  12.     void Start () {
  13.        
  14.     }
  15.    
  16.     // Update is called once per frame
  17.     void Update () {
  18.         sliderInt[0] = (int) ponyRGB[0].value; // Red Value
  19.         sliderInt[1] = (int) ponyRGB[1].value; // Green Value
  20.         sliderInt[2] = (int) ponyRGB[2].value; // Blue Value
  21.        
  22.         if (ponyRGB[0])
  23.         {
  24.             // The following produces "ponyImage is a field, but a type was expected" error
  25.             ponyImage[].Color = new Color(sliderInt[0], sliderInt[1], sliderInt[2],255);
  26.         }
  27.     }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement