示例#1
0
 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);
 }
示例#2
0
 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);
     }
 }