public override void GetReferences() { base.GetReferences(); canvasScaler = GetComponentInParent <CanvasScaler> (); canvasRect = canvasScaler.GetComponentInParent <RectTransform> (); }
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; }
void Start() { canvasScaler = GetComponentInParent <CanvasScaler> (); canvasRect = canvasScaler.GetComponentInParent <RectTransform> (); }