| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107 | using System;using Excel2Json;using Fort23.Core;using Fort23.UTool;using UnityEditor;using UnityEngine;namespace GameUI{    public class GameApplctionMono : MonoBehaviour    {        public GameApplction GameApplction;        public void Update()        {#if UNITY_EDITOR            // if (EditorApplication.isPaused)            // {            //     return;            // }#endif            EventSystem.Instance.Update();            AssetBundleLoadManager.Instance.UpdateBundle();            TimeHelper.clientFrame = TimeHelper.ClientFrame() + (long)(Time.deltaTime * 1000);        }        private class TestHERO        {            public int level;            public int exp;            public void AddExp(int e)            {                this.exp += e;                HeroPowerUpConfig allPowerUp = ConfigComponent.Instance.Get<HeroPowerUpConfig>(level);                while (exp > allPowerUp.levelUpExp && allPowerUp.levelUpExp > 0)                {                    exp = exp - allPowerUp.levelUpExp;                    level++;                    allPowerUp = ConfigComponent.Instance.Get<HeroPowerUpConfig>(level);                }            }        }        // [ContextMenu("monster")]        // public void Test()        // {        //     LevelBattleConfig[] levelBattleConfigs = ConfigComponent.Instance.GetAll<LevelBattleConfig>();        //     TestHERO testHero = new TestHERO();        //     testHero.level = 1;        //     string m = "";        //     for (int i = 0; i < levelBattleConfigs.Length; i++)        //     {        //         LevelBattleConfig levelBattleConfig = levelBattleConfigs[i];        //         int jy = levelBattleConfig.exp * levelBattleConfig.miniExpAndGold[0] / 4;        //         testHero.AddExp(jy);        //         m += testHero.level + "\n";        //     }        //     Debug.Log(m);        // }        private void OnApplicationFocus(bool hasFocus)        {            if (hasFocus && PlayerManager.Instance.isLogin)            {                // 退出时记录时间                AccountFileInfo.Instance.playerData.ExitTime = TimeHelper.ClientNow();                AccountFileInfo.Instance.SavePlayerData();            }            else if(PlayerManager.Instance.isLogin)            {                PlayerManager.Instance.CalculateOfflineRewards();            }        }        private void OnApplicationQuit()        {            // 退出时记录时间            AccountFileInfo.Instance.playerData.ExitTime = TimeHelper.ClientNow();            AccountFileInfo.Instance.SavePlayerData();            // if (hasFocus)            // {            //            // }            // else            // {            //     PlayerManager.Instance.CalculateOfflineRewards();            // }        }        // private void OnApplicationPause(bool pauseStatus)        // {        //     throw new NotImplementedException();        // }        // public async void OnApplicationPause(bool pauseStatus)        // {        // }        public void LateUpdate()        {            EventSystem.Instance.LateUpdate();        }    }}
 |