Beispiel #1
0
        public void Bind(SocialMenu mainMenu)
        {
            // If we're bound, we're the local version
            // This means we're the authority on position/rotation
            this.mainMenu = mainMenu;
            mainMenu.OnStateChange.AddListener(MainMenu_OnStateChange);
            HandleState(mainMenu.state);

            // Local user sees the full ui instead
            SetVisibility(visible: false);
        }
Beispiel #2
0
        private void Start()
        {
            avatar = GetComponentInParent <Avatars.Avatar>();

            if (!avatar || avatar.IsLocal)
            {
                text.enabled = false;
                return;
            }

            socialMenu = GetComponentInParent <NetworkScene>()?.
                         GetComponentInChildren <SocialMenu>();

            if (socialMenu == null || !socialMenu)
            {
                text.enabled = false;
                return;
            }

            avatar.OnPeerUpdated.AddListener(Avatar_OnPeerUpdated);
            socialMenu.OnStateChange.AddListener(SocialMenu_OnStateChange);
        }
Beispiel #3
0
 private void SocialMenu_OnStateChange(SocialMenu menu, SocialMenu.State state)
 {
     text.enabled = state == SocialMenu.State.Open;
 }
Beispiel #4
0
 private void MainMenu_OnStateChange(SocialMenu mainMenu, SocialMenu.State state)
 {
     HandleState(state);
 }
Beispiel #5
0
 private void Awake()
 {
     mainMenu = GetComponentInParent <SocialMenu>();
 }