Пример #1
0
    public override void GetReferences()
    {
        base.GetReferences();

        canvasScaler = GetComponentInParent <CanvasScaler> ();
        canvasRect   = canvasScaler.GetComponentInParent <RectTransform> ();
    }
Пример #2
0
 private void Awake()
 {
     Instance = this;
     rect     = GetComponent <RectTransform>();
     canvas   = transform.GetComponentInParent <CanvasScaler>();
     if (canvas == null)
     {
         while (true)
         {
             canvas = canvas.GetComponentInParent <CanvasScaler>();
             if (canvas != null)
             {
                 break;
             }
         }
     }
     Painter.ColorEvent += SetColor;
 }
Пример #3
0
 void Start()
 {
     canvasScaler = GetComponentInParent <CanvasScaler> ();
     canvasRect   = canvasScaler.GetComponentInParent <RectTransform> ();
 }