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