Пример #1
0
 private void Close()
 {
     if (GUICountdownDeath.mInstance != null)
     {
         UnityEngine.Object.Destroy(GUICountdownDeath.mInstance.gameObject);
         GUICountdownDeath.mInstance = null;
     }
 }
Пример #2
0
 private static void CreateInstance()
 {
     if (GUICountdownDeath.mInstance != null)
     {
         return;
     }
     GameObject gameObject = Res.LoadGUI("GUI/GUICountdownDeath");
     if (gameObject == null)
     {
         global::Debug.LogError(new object[]
         {
             "Res.Load GUI/GUICountdownDeath error"
         });
         return;
     }
     GUICombatMain session = GameUIManager.mInstance.GetSession<GUICombatMain>();
     GameObject gameObject2;
     if (session != null)
     {
         gameObject2 = NGUITools.AddChild(session.gameObject, gameObject);
     }
     else
     {
         gameObject2 = NGUITools.AddChild(GameUIManager.mInstance.uiCamera.gameObject, gameObject);
     }
     if (gameObject2 == null)
     {
         global::Debug.LogError(new object[]
         {
             "AddChild GUICountdownDeath error"
         });
         return;
     }
     if (session != null)
     {
         gameObject2.transform.localPosition = Vector3.zero;
     }
     else
     {
         gameObject2.transform.localPosition = new Vector3(0f, 0f, 5000f);
     }
     GUICountdownDeath.mInstance = gameObject2.AddComponent<GUICountdownDeath>();
 }