Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using UnityEngine.UI;
- using System.Collections;
- public class PonyRGB : MonoBehaviour {
- public Slider[] ponyRGB;
- public Image[] ponyImage;
- int[] sliderInt = new int[3];
- // Use this for initialization
- void Start () {
- }
- // Update is called once per frame
- void Update () {
- sliderInt[0] = (int) ponyRGB[0].value; // Red Value
- sliderInt[1] = (int) ponyRGB[1].value; // Green Value
- sliderInt[2] = (int) ponyRGB[2].value; // Blue Value
- if (ponyRGB[0])
- {
- // The following produces "ponyImage is a field, but a type was expected" error
- ponyImage[].Color = new Color(sliderInt[0], sliderInt[1], sliderInt[2],255);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement