예제 #1
0
        void TimerMgrGui()
        {
            PETimer timer = PeTimerMgr.Instance.Get("1");

            if (null != timer)
            {
                GUI.Label(new Rect(500, 50, 100, 20), timer.FormatString("hh:mm:ss"));
            }
        }
예제 #2
0
    // Update is called once per frame
    void Update()
    {
        if (Timer != null)
        {
            if (_passingTime)
            {
                if (Timer.Tick >= _targetTick)
                {
                    Timer.Tick        = _targetTick;
                    _passingTime      = false;
                    _targetTick       = 0;
                    Timer.ElapseSpeed = NormalTimeSpeed;
                }
            }

            Timer.Update(Time.deltaTime);
            PlayTime.Update(Time.deltaTime);

            if (Application.isEditor)
            {
                if (Input.GetKeyDown(KeyCode.Keypad1))
                {
                    Timer.ElapseSpeed = 10000;
                }
                if (Input.GetKeyUp(KeyCode.Keypad1))
                {
                    Timer.ElapseSpeed = NormalTimeSpeed;
                }
                if (Input.GetKey(KeyCode.Keypad1))
                {
                    Timer.ElapseSpeed *= 1.01f;
                    if (Timer.ElapseSpeed > 1000000)
                    {
                        Timer.ElapseSpeed = 1000000;
                    }
                }
            }

#if DEBUG_TIMER
            if (Application.isEditor)
            {
                m_ElapseSpeed = Timer.ElapseSpeed;
                m_Tick        = Timer.Tick.ToString("#,##0");
                m_Day         = Timer.Day;
                m_Hour        = Timer.Hour;
                m_Minute      = Timer.Minute;
                m_Second      = Timer.Second;
                m_TimeInDay   = Timer.TimeInDay;
                m_HourInDay   = Timer.HourInDay;
                m_MinuteInDay = Timer.MinuteInDay;
                m_SecondInDay = Timer.SecondInDay;
                m_CycleInDay  = Timer.CycleInDay;
                m_TimeString  = Timer.FormatString("D hh:mm:ss AP");
            }
#endif
        }
    }
예제 #3
0
    void ChangeArvhive(Pathea.PeGameSummary summary)
    {
        if (summary != null)
        {
            switch (summary.sceneMode)
            {
            case Pathea.PeGameMgr.ESceneMode.Story:
                mGametypeText.text = PELocalization.GetString(10007);
                //mSeedIDText.text = "Unknown";
                //mSeedTitleText.text = "Area:";
                mSeedRoot.SetActive(false);
                break;

            case Pathea.PeGameMgr.ESceneMode.Adventure:
                mGametypeText.text  = PELocalization.GetString(10008);
                mSeedIDText.text    = summary.seed;
                mSeedTitleText.text = PELocalization.GetString(8000361) + ":";
                mSeedRoot.SetActive(true);
                break;

            case Pathea.PeGameMgr.ESceneMode.Build:
                mGametypeText.text  = PELocalization.GetString(10009);
                mSeedIDText.text    = summary.seed;
                mSeedTitleText.text = PELocalization.GetString(8000361) + ":";
                mSeedRoot.SetActive(true);
                break;

            case Pathea.PeGameMgr.ESceneMode.Custom:
                mGametypeText.text  = PELocalization.GetString(10222);
                mSeedIDText.text    = PELocalization.GetString(8000558);
                mSeedTitleText.text = PELocalization.GetString(8000557);
                mSeedRoot.SetActive(false);
                break;

            default:
                break;
            }
            mInfoGrid.repositionNow = true;

            UTimer tmp_playtimer = new UTimer();
            tmp_playtimer.Second = summary.playTime;
            if (tmp_playtimer.Day < 1)
            {
                mPlayTimeText.text = tmp_playtimer.FormatString("hh:mm:ss");
            }
            else
            {
                mPlayTimeText.text = tmp_playtimer.FormatString("D days hh:mm:ss");
            }

            PETimer tmp_gametimer = PETimerUtil.GetTmpTimer();
            tmp_gametimer.Second = summary.gameTime;
            mGameTimeText.text   = tmp_gametimer.FormatString("hh:mm:ss AP");
            mSaveTex.enabled     = true;
            mSaveTex.mainTexture = (summary.screenshot != null) ?  summary.screenshot : mAutoTex;
        }
        else
        {
            mGametypeText.text = "";
            mSeedIDText.text   = "";
//			mBorimText.text = "";
            mPlayTimeText.text   = "";
            mGameTimeText.text   = "";
            mSaveTex.enabled     = false;
            mSaveTex.mainTexture = null;
        }
    }