GameApplctionMono.cs 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. using Excel2Json;
  2. using Fort23.Core;
  3. using Fort23.UTool;
  4. using UnityEditor;
  5. using UnityEngine;
  6. namespace GameUI
  7. {
  8. public class GameApplctionMono : MonoBehaviour
  9. {
  10. public GameApplction GameApplction;
  11. public void Update()
  12. {
  13. #if UNITY_EDITOR
  14. // if (EditorApplication.isPaused)
  15. // {
  16. // return;
  17. // }
  18. #endif
  19. EventSystem.Instance.Update();
  20. AssetBundleLoadManager.Instance.UpdateBundle();
  21. TimeHelper.clientFrame = TimeHelper.ClientFrame() + (long)(Time.deltaTime * 1000);
  22. }
  23. private class TestHERO
  24. {
  25. public int level;
  26. public int exp;
  27. public void AddExp(int e)
  28. {
  29. this.exp += e;
  30. HeroPowerUpConfig allPowerUp = ConfigComponent.Instance.Get<HeroPowerUpConfig>(level);
  31. while (exp>allPowerUp.levelUpExp&&allPowerUp.levelUpExp>0)
  32. {
  33. exp=exp-allPowerUp.levelUpExp;
  34. level++;
  35. allPowerUp = ConfigComponent.Instance.Get<HeroPowerUpConfig>(level);
  36. }
  37. }
  38. }
  39. [ContextMenu("monster")]
  40. public void Test()
  41. {
  42. LevelBattleConfig[] levelBattleConfigs = ConfigComponent.Instance.GetAll<LevelBattleConfig>();
  43. TestHERO testHero = new TestHERO();
  44. testHero.level = 1;
  45. string m = "";
  46. for (int i = 0; i < levelBattleConfigs.Length; i++)
  47. {
  48. LevelBattleConfig levelBattleConfig = levelBattleConfigs[i];
  49. int jy = levelBattleConfig.exp * levelBattleConfig.miniExpAndGold[0] / 4;
  50. testHero.AddExp(jy);
  51. m += testHero.level + "\n";
  52. }
  53. Debug.Log(m);
  54. }
  55. public void LateUpdate()
  56. {
  57. EventSystem.Instance.LateUpdate();
  58. }
  59. }
  60. }