| | |
| | | {typeof(GameObject), "prefab"}, |
| | | {typeof(Sprite), "png"}, |
| | | {typeof(Texture2D), "jpg"}, |
| | | {typeof(Shader), "shader"}, |
| | | {typeof(Texture), "jpg"}, |
| | | { typeof(Shader), "shader"}, |
| | | {typeof(TextAsset), "txt"}, |
| | | {typeof(AudioClip), "wav"}, |
| | | {typeof(Font), "ttf"}, |
| | |
| | | { |
| | | battleObjMgr.Init(this, redTeamList[redTeamIndex], blueTeamList[blueTeamIndex]); |
| | | } |
| | | |
| | | battleRootNode.SetBackground(ResManager.Instance.LoadAsset<Texture>("Texture/FullScreenBg", "battlebg1")); |
| | | } |
| | | |
| | | // 在Run之前要设置完毕 要创建Agent |
| | |
| | | operationAgent = new HandModeOperationAgent(this); |
| | | break; |
| | | } |
| | | |
| | | Debug.LogError("battleMode is " + battleMode.ToString()); |
| | | } |
| | | |
| | | public virtual void PlayRecord(RecordAction recordAction) |
| | |
| | | if (imgBackground != null) |
| | | { |
| | | imgBackground.texture = texture; |
| | | imgBackground.SetNativeSize(); |
| | | // imgBackground.SetNativeSize(); |
| | | } |
| | | } |
| | | } |
| | |
| | | // 本意是要在这里做池的内容的 但是想了一下 利用效率有点差 最多做一下红色方的缓存 蓝色方的即时用 即时删除 或者缓存上一次战斗的就行 |
| | | // private static int AutoIncrementID = 100000; |
| | | |
| | | private static float modelScaleRate => float.Parse(FuncConfigConfig.Get("BattleModelScale").Numerical1); |
| | | |
| | | public static BattleObject CreateBattleObject(BattleField _battleField, List<GameObject> posNodeList, TeamHero teamHero, BattleCamp _Camp) |
| | | { |
| | | HeroSkinConfig skinCfg = teamHero.skinConfig; |
| | | GameObject battleGO = ResManager.Instance.LoadAsset<GameObject>("Hero/SpineRes", "Hero_001"/*skinCfg.SpineRes*/); |
| | | SkeletonGraphic skeletonGraphic = battleGO.GetComponentInChildren<SkeletonGraphic>(); |
| | | skeletonGraphic.skeletonDataAsset = ResManager.Instance.LoadAsset<SkeletonDataAsset>("Hero/SpineRes/", skinCfg.SpineRes); |
| | | skeletonGraphic.Initialize(true); |
| | | |
| | | GameObject goParent = posNodeList[teamHero.positionNum]; |
| | | BattleObject battleObject = new BattleObject(_battleField); |
| | | battleObject.ObjID = teamHero.ObjID; |
| | | battleGO.name = battleObject.ObjID.ToString(); |
| | | battleObject.Init(GameObject.Instantiate(battleGO, goParent.transform), teamHero, _Camp); |
| | | |
| | | GameObject realGO = GameObject.Instantiate(battleGO, goParent.transform); |
| | | SkeletonGraphic skeletonGraphic = realGO.GetComponentInChildren<SkeletonGraphic>(); |
| | | skeletonGraphic.skeletonDataAsset = ResManager.Instance.LoadAsset<SkeletonDataAsset>("Hero/SpineRes/", skinCfg.SpineRes); |
| | | skeletonGraphic.Initialize(true); |
| | | realGO.name = battleObject.ObjID.ToString(); |
| | | realGO.transform.localScale = new Vector3((_Camp == BattleCamp.Red ? 1 : -1f) * modelScaleRate, modelScaleRate, modelScaleRate); |
| | | battleObject.Init(realGO, teamHero, _Camp); |
| | | return battleObject; |
| | | } |
| | | |
| | |
| | | /// <param name="needCount 需要数量"></param>
|
| | | /// <param name="needTips 是否需要提示"></param>
|
| | | /// <returns></returns>
|
| | | public static bool CheckItemCount(PackType packType, int itemId, int needCount, bool needTips)
|
| | | public static bool CheckItemCount(PackType packType, int itemId, int needCount, bool needTips = false)
|
| | | {
|
| | | if (needCount <= 0)
|
| | | {
|
| | |
| | | // 是 弹出获取途径
|
| | | // 否 显示物品数量不足
|
| | | // SysNotifyMgr.Instance.ShowTip();
|
| | | // YYL TODO
|
| | | }
|
| | | }
|
| | |
|
| | | return isEnough;
|
| | | }
|
| | |
|
| | | public static bool CheckCurrencyCount(int moneyType, ulong needCount, bool needTips)
|
| | | public static bool CheckCurrencyCount(int moneyType, ulong needCount, bool needTips = false)
|
| | | {
|
| | | if (needCount <= 0)
|
| | | {
|
| | |
| | | // 是 弹出获取途径
|
| | | // 否 显示物品数量不足
|
| | | // SysNotifyMgr.Instance.ShowTip();
|
| | | // YYL TODO
|
| | | Debug.LogError("货币不足 " + moneyType);
|
| | | }
|
| | |
|
| | | return isEnough;
|
| | |
| | | PlayerDatas.Instance.playerDataRefreshEvent += PlayerDataRefresh; |
| | | TaskManager.Instance.OnTaskUpdate += UpdateTask; |
| | | Refresh(); |
| | | var battleWin = UIManager.Instance.OpenWindow<BattleWin>(); |
| | | battleWin.SetBattleField(BattleManager.Instance.storyBattleField); |
| | | // var battleWin = UIManager.Instance.OpenWindow<BattleWin>(); |
| | | // battleWin.SetBattleField(BattleManager.Instance.storyBattleField); |
| | | } |
| | | protected override void OnOpen() |
| | | { |
| | |
| | | { |
| | | PlayerDatas.Instance.playerDataRefreshEvent -= PlayerDataRefresh; |
| | | TaskManager.Instance.OnTaskUpdate -= UpdateTask; |
| | | |
| | | // 关闭的时候把战斗界面也给关了 虽然是在外面开的 |
| | | UIManager.Instance.CloseWindow<BattleWin>(); |
| | | } |
| | | |
| | |
| | | protected override void OnTabButtonClicked(int index) |
| | | { |
| | | if (index == 0) |
| | | { |
| | | { |
| | | if (currentSubUI != null && currentSubUI.name == "HomeWin") |
| | | { |
| | | //打开主界面的情况下再点击按钮,执行攻击逻辑 |
| | | StoryBattleField storyBattleField = BattleManager.Instance.storyBattleField; |
| | | if (storyBattleField != null) |
| | | { |
| | | storyBattleField.operationAgent.DoNext(); |
| | | } |
| | | } |
| | | } |
| | | SelectBottomTab(index); |
| | |
| | | Debug.Log("打开子界面 : " + functionOrder); |
| | | // 主城 内政 武将 挑战 公会 |
| | | //根据索引打开不同的界面 |
| | | switch (functionOrder) |
| | | switch (functionOrder) |
| | | { |
| | | case 0: |
| | | // 打开主页界面 |
| | | if (!UIManager.Instance.IsOpened<BattleWin>()) |
| | | { |
| | | BattleWin battleWin = UIManager.Instance.OpenWindow<BattleWin>(); |
| | | battleWin.SetBattleField(BattleManager.Instance.storyBattleField); |
| | | } |
| | | else |
| | | { |
| | | BattleWin battleWin = UIManager.Instance.GetUI<BattleWin>(); |
| | | battleWin.SetBattleField(BattleManager.Instance.storyBattleField); |
| | | } |
| | | currentSubUI = UIManager.Instance.OpenWindow<HomeWin>(); |
| | | Debug.Log("打开主城界面"); |
| | | break; |