Пример #1
0
        /// <summary>
        /// 攻击判定
        /// </summary>
        public void AttackDecision(int _hitId)
        {
            HitData hitData = BattleManager.Instance.QueryHitData(_hitId);
            //带上施法者的信息

            Vector3 center;
            float   radius = 0f;

            hitedColliderList.Clear();

            for (int i = 0; i < hitData.decisionSpheres.Length; i++)
            {
                center          = hitData.decisionSpheres[i].Center;
                radius          = hitData.decisionSpheres[i].Radius;
                tempColliderSet = Physics.OverlapSphere(center, radius, LayerMask.NameToLayer("Actor"));

                for (int j = 0; j < tempColliderSet.Length; j++)
                {
                    if (!hitedColliderList.Contains(tempColliderSet[i]))
                    {
                        hitedColliderList.Add(tempColliderSet[i]);
                    }
                }
            }

            Actor a = null;

            hitedActorList.Clear();
            for (int i = 0; i < hitedColliderList.Count; i++)
            {
                a = hitedColliderList[i].GetComponent <Actor>();
                hitedActorList.Add(a);
            }

            BattleManager.Instance.ProcessHitedActor(hitedActorList);
        }
 public void Begin(HitData _data)
 {
 }