private void Start() { rectTransform = base.transform as RectTransform; root = GetComponentInParent <Canvas>().transform; chatBarController = root.GetComponentInChildren <ChatBarController>(); if (chatBarController != null) { updateState(chatBarController.CurrentState); } Service.Get <EventDispatcher>().AddListener <ChatBarEvents.ChatBarStateChanged>(onChatBarStateChanged, EventDispatcher.Priority.HIGH); }
private void updateState(ChatBarState chatBarState) { if (chatBarController == null) { chatBarController = root.GetComponentInChildren <ChatBarController>(); } if (chatBarState == ChatBarState.EmoteInput) { rectTransform.anchoredPosition = new Vector2(rectTransform.anchoredPosition.x, InputPosition); } else { rectTransform.anchoredPosition = new Vector2(rectTransform.anchoredPosition.x, InstantPosition); } }