示例#1
0
    /// <summary>
    /// 与ResetSelf的区别:Reset在Skill层对技能进行出列入列,而ResetSelf仅用于类似替身术时候的自身重置。
    /// </summary>
    public override void Reset()
    {
        //按照顺序,逆序消除影响。因为每次会Init(),所以不必都Reset。

        if (range != null)
        {
            range.Reset();
        }

        foreach (var f in BattleFieldManager.GetInstance().floors)
        {
            f.Value.GetComponent <Floor>().FloorClicked -= Confirm;
            f.Value.GetComponent <Floor>().FloorExited  -= DeleteHoverRange;
            f.Value.GetComponent <Floor>().FloorHovered -= Focus;
        }

        //角色取出忽略层
        UnitManager.GetInstance().units.ForEach(u => u.gameObject.layer = 0);
        if (comboJudgeUI)
        {
            GameObject.Destroy(comboJudgeUI);
        }
        if (comboSelectUI)
        {
            GameObject.Destroy(comboSelectUI);
        }
        if (confirmUI)
        {
            UnityEngine.Object.Destroy(confirmUI);
        }
        if (originSkill != null)
        {
            originSkill.ResetSelf();
            character.GetComponent <Unit>().action.Pop();
        }

        base.Reset();
    }