Exemplo n.º 1
0
        /// <summary>
        ///     On wake up, find various UI components and reset the HSB shader to match the initially selected color
        /// </summary>
        public void Start()
        {
            // Find UI components
            currentColorImage  = gameObject.transform.Find("currentColor").GetComponent <Image>();
            previousColorImage = gameObject.transform.Find("previousColor").GetComponent <Image>();
            redInputField      = gameObject.transform.Find("redControls/redInputField").GetComponent <InputField>();
            greenInputField    = gameObject.transform.Find("greenControls/greenInputField").GetComponent <InputField>();
            blueInputField     = gameObject.transform.Find("blueControls/blueInputField").GetComponent <InputField>();
            hexInputField      = gameObject.transform.Find("hexInputField").GetComponent <InputField>();

            // Find script instances
            hueSlider = gameObject.transform.Find("huePanel/slider").GetComponent <HueSlider>();
            hsbSwatch = gameObject.transform.Find("hsbSwatch/crosshair").GetComponent <HSBSwatch>();

            // Fire an initial event to update the HSB shader
            RGBChanged();

            recentColorImages[0].GetComponent <Image>().color = previousColor.ToColor();
        }
Exemplo n.º 2
0
 /// <summary>
 ///     On wake up
 /// </summary>
 public void Start()
 {
     // Find script instances
     hueSlider = gameObject.transform.parent.parent.Find("huePanel/slider").GetComponent <HueSlider>();
     hsbSwatch = gameObject.transform.parent.GetComponent <Image>();
 }