public bool PushUserInterface(GameObject obj) { if (!isClient) { return(true); } if (!userInterfaceList.Contains(obj)) { puppet ui = obj.GetComponent <puppet>(); if (ui) { if (userInterfaceList.Count != 0) { GameObject obj_last = userInterfaceList[userInterfaceList.Count - 1]; if (obj_last) { puppet ui_last = obj_last.GetComponent <puppet>(); if (ui_last) { ui_last.SetActiv(false); } } } ui.SetActiv(true); userInterfaceList.Add(obj); return(true); } } return(false); }
public void PopUserInterface() { if (!isClient) { return; } if (userInterfaceList.Count > 0) { GameObject obj_last = userInterfaceList[userInterfaceList.Count - 1]; if (obj_last) { puppet ui_last = obj_last.GetComponent <puppet>(); if (ui_last) { ui_last.SetActiv(false); userInterfaceList.Remove(obj_last); } GameObject obj = userInterfaceList[userInterfaceList.Count - 1]; if (obj) { puppet ui = obj.GetComponent <puppet>(); if (ui) { ui.SetActiv(true); } } } } }