Exemplo n.º 1
0
 protected override void OnEnable()
 {
     if (UseCurvedUI)
     {
         foreach (UnityEngine.UI.Graphic graph in (this).GetComponentsInChildren <UnityEngine.UI.Graphic>())
         {
             if (graph.GetComponent <MicroLightUIEffect>() == null)
             {
                 graph.gameObject.AddComponent <MicroLightUIEffect>();
             }
             graph.SetAllDirty();
         }
     }
     else
     {
         foreach (UnityEngine.UI.Graphic graph in (this).GetComponentsInChildren <UnityEngine.UI.Graphic>())
         {
             MicroLightUIEffect effect = graph.GetComponent <MicroLightUIEffect>();
             if (effect != null)
             {
                 if (Application.isEditor)
                 {
                     DestroyImmediate(effect);
                 }
                 else
                 {
                     Destroy(effect);
                 }
             }
             graph.SetAllDirty();
         }
     }
     base.OnEnable();
     CanvasRaycastMethod.AddTarget(this);
 }
Exemplo n.º 2
0
        public void DropDownClick()
        {
            CanvasRaycastMethod.ClearTarget();
            CanvasRaycastMethod.AddTarget(this);

            m_canvasbuf = transform.GetComponentsInChildren <Canvas>();
            for (int i = 0; i < m_canvasbuf.Length; i++)
            {
                MicroLightCanvas microLightCanvas = m_canvasbuf[i].GetComponent <MicroLightCanvas>();
                if (microLightCanvas == null)
                {
                    microLightCanvas             = m_canvasbuf[i].gameObject.AddComponent <MicroLightCanvas>();
                    microLightCanvas.UseCurvedUI = false;
                    CanvasRaycastMethod.AddTarget(microLightCanvas);
                    microLightCanvasBuf.Add(microLightCanvas);
                }
            }
        }