Пример #1
0
        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初始化错误!");
            }
        }
Пример #2
0
        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()!");
        }