コード例 #1
0
ファイル: EndGameUI.cs プロジェクト: Tavrox/Lavapools
    // Use this for initialization
    public void Setup()
    {
        GameEventManager.GameStart += GameStart;
        GameEventManager.EndGame += EndGame;
        subMenuList = submenus.EndGame;

        _LeaderboardUI = transform.parent.GetComponentInChildren<LeaderboardUI>();
        _lb = transform.parent.GetComponentInChildren<PhpLeaderboards>();
        _RespawnUI = transform.parent.GetComponentInChildren<RespawnUI>();

        lbInitpos = _LeaderboardUI.transform.localPosition;
        lbOutPos = new Vector3 (lbInitpos.x, lbInitpos.y-5f, lbInitpos.z);

        respInitpos = _RespawnUI.transform.localPosition;
        respOutPos = new Vector3 (respInitpos.x-20f, respInitpos.y, respInitpos.z);

        BackOne = FETool.findWithinChildren(gameObject, "Background/p1");
        BackTwo = FETool.findWithinChildren(gameObject, "Background/p2");
        BackOneIn = FETool.findWithinChildren(gameObject, "Background/newPosP1");
        BackTwoIn = FETool.findWithinChildren(gameObject, "Background/newPosP2");
        Succeed = FETool.findWithinChildren(gameObject, "SUCCEED").GetComponent<TextUI>();
        CurrLvl = FETool.findWithinChildren(gameObject, "CURRLVL").GetComponent<TextUI>();
        CurrLvl.text = LevelManager.CurrentLevelInfo.LvlName.ToString();

        CrabbySpr = FETool.findWithinChildren(gameObject, "Crab").GetComponentInChildren<OTSprite>();
        StrokeSpr = FETool.findWithinChildren(gameObject, "Door/Stroke").GetComponentInChildren<OTSprite>();
        VortexSpr = FETool.findWithinChildren(gameObject, "Door/Vortex").GetComponentInChildren<OTSprite>();
    }
コード例 #2
0
    static IEnumerator LeaderboardTimeOutHandle(float _firstWaitTime, float _perWaitTime, byte _checkTimes)
    {
        yield return(new WaitForSeconds(_firstWaitTime));

        byte checkTimes = _checkTimes;

        //經過_fristWaitTime時間後,每_perWaitTime檢查一次資料是否回傳了,若檢查checkTimes次數後還是沒回傳就重送資料
        while (WaitCB_Leaderboard && checkTimes > 0)
        {
            checkTimes--;
            yield return(new WaitForSeconds(_perWaitTime));
        }
        if (WaitCB_Leaderboard)//如果還沒接收到CB就重送需求
        {
            //若重送要求的次數達到上限次數則代表連線有嚴重問題,直接報錯
            if (ReSendQuestTimes_Leaderboard > 0)
            {
                ReSendQuestTimes_Leaderboard--;
                CaseLogManager.ShowCaseLog(30001);//連線逾時,嘗試重複連線請玩家稍待
                //向Server重送要求
                SendLeaderboardQuest();
            }
            else
            {
                WaitCB_Leaderboard = false;//設定為false代表不接受回傳了
                Debug.LogWarning("取得排行榜資料失敗");
                LeaderboardUI.GetChampionData(Player.LeaderboardData);
                //CaseLogManager.ShowCaseLog(40001); ;//請玩家檢查網路狀況或一段時間再嘗試連線
                //CaseLogManager.ShowCaseLog(11);//請玩家檢查網路狀況或一段時間再嘗試連線
                PopupUI.HideLoading();//隱藏Loading
            }
        }
    }
コード例 #3
0
    private void Start()
    {
        LeaderboardUI _lbUI = GameObject.FindObjectOfType <LeaderboardUI>();

        myRect = GetComponent <RectTransform>();
        if (_lbUI != null)
        {
            zoom      = _lbUI.zoom;
            exhausted = _lbUI.exhausted;
        }
    }
コード例 #4
0
ファイル: GameOverUI.cs プロジェクト: Tavrox/Lavapools
    // Use this for initialization
    public void Setup()
    {
        GameEventManager.GameStart += GameStart;
        GameEventManager.GameOver += GameOver;
        GameEventManager.Respawn += Respawn;

        _LeaderboardUI = transform.parent.GetComponentInChildren<LeaderboardUI>();
        _lb = transform.parent.GetComponentInChildren<PhpLeaderboards>();
        _lb.Setup();

        _RespawnUI = transform.parent.GetComponentInChildren<RespawnUI>();
        _RespawnUI.Setup(this);

        lbInitpos = _LeaderboardUI.transform.position;
        lbOutPos = _menuMan.BottomPos.position;

        respInitpos = _RespawnUI.transform.position;
        respOutPos = _menuMan.BottomPos.position;

        new OTTween(_RespawnUI.gameObject.transform, 0.3f, OTEasing.QuadIn ).Tween("position", respInitpos);
        new OTTween(_LeaderboardUI.gameObject.transform, 0.3f).Tween("position", lbInitpos);
    }
コード例 #5
0
 private void OnEnable()
 {
     scr = (LeaderboardUI)target;
 }
コード例 #6
0
ファイル: LeaderboardUI.cs プロジェクト: scozirge/NeonShooter
 void OnEnable()
 {
     Myself = this;
     ServerRequest.GetLeaderboard();
     Leaderboard_Text.text = GameDictionary.String_UIDic["Leaderboard"].GetString(Player.UseLanguage);
 }
コード例 #7
0
    /// <summary>
    /// 註冊回傳
    /// </summary>
    static IEnumerator Coroutine_LeaderboardCB(WWW w)
    {
        if (ReSendQuestTimes_Leaderboard == MaxReSendQuestTimes_Leaderboard)
        {
            CaseLogManager.ShowCaseLog(30003);//登入中
        }
        yield return(w);

        Debug.LogWarning(w.text);
        if (WaitCB_Leaderboard)
        {
            WaitCB_Leaderboard = false;
            if (w.error == null)
            {
                try
                {
                    string[] result = w.text.Split(':');
                    //////////////////成功////////////////
                    if (result[0] == ServerCBCode.Success.ToString())
                    {
                        string rankStr = result[1];
                        LeaderboardUI.GetChampionData(rankStr);
                        PopupUI.HideLoading();//隱藏Loading
                    }
                    //////////////////失敗///////////////
                    else if (result[0] == ServerCBCode.Fail.ToString())
                    {
                        //int caseID = int.Parse(result[1]);
                        //CaseLogManager.ShowCaseLog(caseID);
                        Debug.LogWarning("取得排行榜資料失敗");
                        LeaderboardUI.GetChampionData(Player.LeaderboardData);
                        PopupUI.HideLoading();//隱藏Loading
                    }
                    else
                    {
                        //CaseLogManager.ShowCaseLog(2004);
                        Debug.LogWarning("取得排行榜資料失敗");
                        LeaderboardUI.GetChampionData(Player.LeaderboardData);
                        PopupUI.HideLoading();//隱藏Loading
                    }
                }
                //////////////////例外//////////////////
                catch (Exception ex)
                {
                    Debug.LogException(ex);
                    Debug.LogWarning("取得排行榜資料失敗");
                    LeaderboardUI.GetChampionData(Player.LeaderboardData);
                    //CaseLogManager.ShowCaseLog(2003);//註冊例外
                    PopupUI.HideLoading();//隱藏Loading
                }
            }
            //////////////////回傳null////////////////
            else
            {
                Debug.LogWarning(w.error);
                Debug.LogWarning("取得排行榜資料失敗");
                LeaderboardUI.GetChampionData(Player.LeaderboardData);
                //CaseLogManager.ShowCaseLog(2); ;//連線不到server
                PopupUI.HideLoading();//隱藏Loading
            }
        }
    }