public BattleCore() { m_BattleUI = GameObject.Find("BattleLogic").GetComponent <BattleUI>(); m_BattlePlayer = new BattlePlayer(this); m_BattleCardManager = BattleCardManager.Instance; m_SkillManager = SkillManager.Instance; m_BuffManager = BuffManager.Instance; m_EffectManager = EffectManager.Instance; if (!m_BattlePlayer.Init()) { Debug.LogError("战斗播放器初始化失败!"); } if (!m_BattleCardManager.Init(this)) { Debug.LogError("m_BattleCardManager初始化错误!"); } if (!m_SkillManager.Init(this)) { Debug.LogError("m_SkillManager初始化错误!"); } if (!m_EffectManager.Init(this)) { Debug.LogError("m_EffectManager初始化错误!"); } }
//public IDictionary<BattleProcedureType, BattleProcedureBase> ProcedureList { get { return m_ProcedureList; } } public BattleProcedureManager(BattlePlayer player) { m_BattlePlayer = player; m_ProcedureList[BattleProcedureType.E_BATTLE_PROCEDURE_RESOURCE_LOAD] = new BattleProcedureResourceLoad();//加载图片资源// m_ProcedureList[BattleProcedureType.E_BATTLE_PROCEDURE_BATTLE_START] = new BattleProcedureBattleStart(); m_ProcedureList[BattleProcedureType.E_BATTLE_PROCEDURE_CARD_PREPARE] = new BattleProcedureCardPrepare(); m_ProcedureList[BattleProcedureType.E_BATTLE_PROCEDURE_CARD_FORWARD] = new BattleProcedureCardForward(); m_ProcedureList[BattleProcedureType.E_BATTLE_PROCEDURE_CARD_MEET] = new BattleProcedureCardMeet(); m_ProcedureList[BattleProcedureType.E_BATTLE_PROCEDURE_SHOW_TIP] = new BattleProcedureShowTip(); m_ProcedureList[BattleProcedureType.E_BATTLE_PROCEDURE_BATTLING] = new BattleProcedureBattling(); m_ProcedureList[BattleProcedureType.E_BATTLE_PROCEDURE_SHOW_TROPHY] = new BattleProcedureShowTrophy(); m_ProcedureList[BattleProcedureType.E_BATTLE_PROCEDURE_WAITING] = new BattleProcedureWaiting(); m_ProcedureList[BattleProcedureType.E_BATTLE_PROCEDURE_SHOW_RESULT] = new BattleProcedureShowResult(); m_ProcedureList[BattleProcedureType.E_BATTLE_PROCEDURE_REVIVE_FREE] = new BattleProcedureReviveFree(); m_ProcedureList[BattleProcedureType.E_BATTLE_PROCEDURE_BATTLE_END] = new BattleProcedureBattleEnd(); }
public void OnDestroy() { BattleCardManager.Instance.OnDestroy(); BattleCardManager.Destroy(); SkillManager.Instance.OnDestroy(); SkillManager.Destroy(); BuffManager.Instance.OnDestroy(); BuffManager.Destroy(); EffectManager.Instance.OnDestroy(); EffectManager.Destroy(); m_BattlePlayer.OnDestroy(); m_BattlePlayer = null; Debug.Log("BattleCore.OnDestroy()!"); }