private void Awake()
 {
     if (IsServer)
     {
         OnTabOpened.AddListener(newPeeper => { });
     }
 }
Example #2
0
        private IEnumerator WaitForProvider()
        {
            while (Provider == null)
            {
                yield return(WaitFor.EndOfFrame);
            }

            Acu = Provider.GetComponent <AirController>();

            var acuName = Acu.name.StartsWith("ACU - ") ? Acu.name.Substring("ACU - ".Length) : Acu.name;

            // "ACU - " as per NameValidator tool.
            acuLabel.SetValueServer(acuName);

            foreach (var netPage in pageSwitcher.Pages)
            {
                var page = netPage as GUI_AcuPage;
                page.Acu   = Acu;
                page.AcuUi = this;
            }

            editValueModal.Acu   = Acu;
            editValueModal.AcuUi = this;

            OnTabOpened.AddListener(TabOpened);
            OnTabClosed.AddListener(TabClosed);
            if (IsUnobserved == false)
            {
                // Call manually; OnTabOpened is invoked before the Provider is set,
                // so the initial invoke was missed.
                TabOpened();
            }
        }
Example #3
0
    private void Awake()
    {
        if (IsServer)
        {
            OnTabOpened.AddListener(newPeeper =>
            {
                if (renameable == null)
                {
                    return;
                }

                if (renameable.CustomName.Length > 0)
                {
                    networkedInputField.SetValue = renameable.CustomName;
                }
            });
        }
    }
Example #4
0
    public virtual void OpenTab(int index)
    {
        var tab = GetTab(index);

        if (tab != null)
        {
            for (int i = 0; i < tabs.Count; i++)
            {
                if (index != i)
                {
                    CloseTab(i);
                }
            }
            tab.OpenTab();
            tab.IsOpened = true;
            OnTabOpened?.Invoke(tab);
        }
    }
Example #5
0
    public virtual void OpenTab(string id)
    {
        var tab = GetTab(id);

        if (tab != null)
        {
            for (int i = 0; i < tabs.Count; i++)
            {
                var iTab = tabs[i];
                if (iTab.Id != id)
                {
                    CloseTab(i);
                }
            }
            tab.OpenTab();
            tab.IsOpened = true;
            OnTabOpened?.Invoke(tab);
        }
    }