Beispiel #1
0
    public void OnConfirmClick()
    {
        try
        {
            switch (m_ConnectShowType)
            {
            case UIConnectEnumType.ChangeScene:
                UIManager.Instance.HideWindowByName("Connect");
                break;

            case UIConnectEnumType.Reconnect:
                DFMUtils.Instance.RestartGame();
                UIManager.Instance.HideWindowByName("Connect");
                break;

            case UIConnectEnumType.RoleEnter:
                DFMUtils.Instance.RestartGame();
                UIManager.Instance.HideWindowByName("Connect");
                break;
            }
            m_ConnectShowType = UIConnectEnumType.None;
        }
        catch (System.Exception ex)
        {
            ArkCrossEngine.LogicSystem.LogErrorFromGfx("Exception {0}\n{1}", ex.Message, ex.StackTrace);
        }
    }
Beispiel #2
0
 public void OnShowConnectHint(bool isConnect, bool active)
 {
     try
     {
         if (active)
         {
             // hide all widget first
             ShowHintWidget(false);
             // only accept none type
             if (m_ConnectShowType != UIConnectEnumType.None)
             {
                 return;
             }
             // is connect
             if (isConnect)
             {
                 m_ConnectShowType = UIConnectEnumType.ChangeScene;
                 m_ConnectCD       = ConnectDelta;
             }
             else
             {
                 m_ConnectShowType = UIConnectEnumType.Reconnect;
                 m_ReconnectCD     = ReconnectCountDown;
                 if (null != LobbyClient.Instance.CurrentRole &&
                     null != LobbyClient.Instance.CurrentRole.Group)
                 {
                     LobbyClient.Instance.CurrentRole.Group.Reset();
                 }
             }
             // set and show hint
             string CHN_Connect = StrDictionaryProvider.Instance.GetDictString(15);
             if (lblHintMsg != null)
             {
                 lblHintMsg.text = CHN_Connect;
             }
             UIManager.Instance.ShowWindowByName("Connect");
             // disable input
             JoyStickInputProvider.SetActive(false);
         }
         else
         {
             // enable input
             JoyStickInputProvider.SetActive(true);
             m_ConnectShowType = UIConnectEnumType.None;
             UIManager.Instance.HideWindowByName("Connect");
             if (UILoginConnectResultDelegate != null)
             {
                 UILoginConnectResultDelegate();
             }
         }
     }
     catch (Exception ex)
     {
         ArkCrossEngine.LogicSystem.LogFromGfx("[Error]:Exception:{0}\n{1}", ex.Message, ex.StackTrace);
     }
 }
Beispiel #3
0
 void OnDestroy()
 {
     try
     {
         ClearDelegate();
         JoyStickInputProvider.SetActive(true);
         m_ConnectShowType = UIConnectEnumType.None;
     }
     catch (System.Exception ex)
     {
         ArkCrossEngine.LogicSystem.LogErrorFromGfx("Exception {0}\n{1}", ex.Message, ex.StackTrace);
     }
 }
Beispiel #4
0
 public void OnShowConnectHint(UIConnectEnumType connectType, bool active, float duration)
 {
     try
     {
         if (active)
         {
             ShowHintWidget(false);
             if (m_ConnectShowType != UIConnectEnumType.None)
             {
                 return;
             }
             c_EndTime         = duration + UnityEngine.Time.time;
             m_ConnectShowType = connectType;
             string CHN_Connect = StrDictionaryProvider.Instance.GetDictString(15);
             if (lblHintMsg != null)
             {
                 lblHintMsg.text = CHN_Connect;
             }
             UIManager.Instance.ShowWindowByName("Connect");
             JoyStickInputProvider.SetActive(false);
         }
         else
         {
             ResetEndTime();
             JoyStickInputProvider.SetActive(true);
             m_ConnectShowType = UIConnectEnumType.None;
             UIManager.Instance.HideWindowByName("Connect");
             if (UILoginConnectResultDelegate != null)
             {
                 UILoginConnectResultDelegate();
             }
         }
     }
     catch (Exception ex)
     {
         ArkCrossEngine.LogicSystem.LogFromGfx("[Error]:Exception:{0}\n{1}", ex.Message, ex.StackTrace);
     }
 }