private void Awake() { if (IsServer) { OnTabOpened.AddListener(newPeeper => { }); } }
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(); } }
private void Awake() { if (IsServer) { OnTabOpened.AddListener(newPeeper => { if (renameable == null) { return; } if (renameable.CustomName.Length > 0) { networkedInputField.SetValue = renameable.CustomName; } }); } }
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); } }
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); } }