コード例 #1
0
 void OnFlowerRewardClick()
 {
     if (MainUILogic.Instance() != null)
     {
         IsOpenAward = true;
         UIManager.ShowUI(UIInfo.AwardRoot);
     }
 }
コード例 #2
0
    public void ConnectLost()
    {
        if (!GameManager.gameManager.OnLineState)
        {
            return;
        }
        if (LoginUILogic.Instance() != null)
        {
            LoginUILogic.Instance().EnterServerChoose();
            // 连接丢失,请重新登录
#if !UNITY_WP8
            MessageBoxLogic.OpenOKBox(1292, 1000);
#else
            if (!m_DeviceLost)
            {
                MessageBoxLogic.OpenOKBox(1292, 1000);
            }
#endif

            return;
        }
        else if (MainUILogic.Instance() != null)
        {
            if (!m_bAskConnecting || null != MessageBoxLogic.Instance())
            {
                LogModule.DebugLog("reconnecting....");
                // 连接丢失,正在重新连接。。。
#if UNITY_WP8
                if (!m_DeviceLost)
                {
                    MessageBoxLogic.OpenOKBox(1293, 1000, OnReconnect);
                }
                else
                {
                    WP8ConnectingLostLogic();
                }
#else
                MessageBoxLogic.OpenOKBox(1293, 1000, OnReconnect);
#endif

                m_bAskConnecting  = true;
                m_IsAskConnecting = true;
                if (BackCamerControll.Instance() != null && BackCamerControll.Instance().gameObject.activeInHierarchy)
                {
                    BackCamerControll.Instance().gameObject.SetActive(false);
                }
                WorldMapWindow.OnDisConnect();
                HuaShanPVPData.OnDisconnect();
            }
        }
        else
        {
            // 有可能在loading不处理,等UI起来后检测
        }
    }
コード例 #3
0
 public static void ActiveShowChallengeUI()
 {
     if (MainUILogic.Instance() != null)
     {
         //活动界面已经被点开了。什么都不做
         if (null != ActivityController.Instance())
         {
             return;
         }
         else
         {
             ActivityController.RequireOpenPVPTab();
             UIManager.ShowUI(UIInfo.Activity, OnActiveShowActiviController);
         }
     }
 }
コード例 #4
0
    /// <summary>
    /// 加载UI
    /// </summary>
    /// <param name="strUIName">UI名字</param>
    /// <param name="nLevel">UI级别</param>
    /// <returns></returns>
    public static GameObject LoadUIPrefab(string strUIName, int nUILevel)
    {
        if (null == GameManager.gameManager)
        {
            LogModule.ErrorLog("can not find gamemanager");
            return(null);
        }

        if (null == GameManager.gameManager.ActiveScene)
        {
            LogModule.ErrorLog("can not find ActiveScene");
            return(null);
        }

        GameObject uiRoot = GameManager.gameManager.ActiveScene.UIRoot;

        if (null == uiRoot)
        {
            LogModule.ErrorLog("can not find uiroot");
            return(null);
        }
        string     strPath = "Prefab/UI/" + strUIName;
        GameObject newObj  = InstantiateResource(strPath, strUIName) as GameObject;

        if (newObj)
        {
            newObj.transform.parent        = uiRoot.transform;
            newObj.transform.localPosition = Vector3.zero;
            newObj.transform.localScale    = Vector3.one;
            if (MainUILogic.Instance() != null)
            {
                MainUILogic.Instance().DicUI.Add(strUIName, newObj);
                MainUILogic.Instance().DicUILevel.Add(strUIName, nUILevel);
            }
        }

        return(newObj);
    }