void Update() { manager = GameObject.Find("Dial").GetComponent <DialogueManager>(); visible = manager.IsVisible(); if (visible) { timer += Time.deltaTime; } else { timer -= Time.deltaTime; } timer = win.cut(timer, 1, 0); height = timer * 100; if (type == 1) { height = 720 - height; } else { height = height; } this.GetComponent <RectTransform>().sizeDelta = win.Locate(new Vector2(1280, 100)); this.GetComponent <RectTransform>().position = win.LocateVector3(new Vector2(0, height)); }