Exemple #1
0
    public void Event(CharacterPhysics otherObj = null, List <CharacterPhysics> physicsObjectList = null)
    {
        foreach (var skill in skillList)
        {
            if (skill.cType != type)
            {
                continue;
            }

            var occurStandardObject = characterSkill.GetOccurStandardObject(skill, otherObj);

            var applyObjList = characterSkill.GetApplyObject(skill, occurStandardObject, otherObj, physicsObjectList);
            if (applyObjList == null)
            {
                Debug.Log("적용될 오브젝트가 없다.");
                continue;
            }

            //충돌된 오브젝트 체크 후 발동 되는지 판단
            if (characterSkill.CheckSkill(skill, otherObj))
            {
                //적용될 오브젝트들 모두 체크
                var checkObjList = characterSkill.CheckSkill(skill, applyObjList);
                foreach (var obj in checkObjList)
                {
                    //선발된 오브젝트들만 스킬 적용
                    characterSkill.ApplySkill(skill, occurStandardObject, obj);
                }
            }
        }
    }