123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- 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);
- // }
-
- public async void OnApplicationPause(bool pauseStatus)
- {
- if (pauseStatus)
- {
- // 退出时记录时间
- AccountFileInfo.Instance.playerData.ExitTime = TimeHelper.ClientNow();
- AccountFileInfo.Instance.SavePlayerData();
- }
- else
- {
- PlayerManager.Instance.CalculateOfflineRewards();
- }
- }
- public void LateUpdate()
- {
- EventSystem.Instance.LateUpdate();
- }
- }
- }
|