Exemplo n.º 1
0
        void UpdateSerchingDieActor()
        {
            if (m_TargetActor.ISDie)
            {
                int        layermaskval  = CalcManager.GetActorCampTypeTOLayerMask(m_TargetActor);
                Collider[] colliderarray = Physics.OverlapSphere(this.transform.position
                                                                 , AttackRange.SphereRadius + 10f
                                                                 , layermaskval);


                m_TargetActor = null;
                float minlength = float.MaxValue;
                foreach (var item in colliderarray)
                {
                    BaseActor tempactor = item.GetComponent <BaseActor>();

                    if (tempactor != null)
                    {
                        float val = (tempactor.transform.position - this.transform.position).magnitude;
                        if (minlength > val)
                        {
                            m_TargetActor = tempactor;
                        }
                    }
                }
            }
        }
Exemplo n.º 2
0
        public void Attack1(E_AniCallType p_calltype)
        {
            AttackData attackdata = AttackDataArray[0];

            if (attackdata.AttackRangeType == E_AttackRangeType.Meel)
            {
                if (attackdata.AttackMutiType == E_AttackMultiType.Single)
                {
                    float attackval = m_ActorData.Attack + attackdata.AddAttackVal;
                    m_TargetActor.SetDamage(this, attackval);
                }
                else if (attackdata.AttackMutiType == E_AttackMultiType.Multi)
                {
                    float attackval = m_ActorData.Attack + attackdata.AddAttackVal;
                    m_TargetActor.SetDamage(this, attackval);


                    int        layermaskval  = CalcManager.GetActorCampTypeTOLayerMask(m_TargetActor);
                    Collider[] colliderarray = Physics.OverlapSphere(m_TargetActor.transform.position
                                                                     , attackdata.MultiAttackRangeVal
                                                                     , layermaskval);

                    attackval = attackval * attackdata.MultiAttackRangeDiv;
                    foreach (var item in colliderarray)
                    {
                        BaseActor tempactor = item.GetComponent <BaseActor>();
                        if (tempactor)
                        {
                            tempactor.SetDamage(this, attackval);
                        }
                    }
                }
            }
            else if (attackdata.AttackRangeType == E_AttackRangeType.Range)
            {
                // 피사체 던지기
                InGameBattleManager.GetI.AddRangeAttackObject(m_TargetActor, this, attackdata);
            }


            UpdateSerchingDieActor();
        }
Exemplo n.º 3
0
        public void InitSettingData(int p_id, E_Camp p_camp)
        {
            ActorTableID = p_id;
            MyCamp       = p_camp;


            m_ActorData           = ActorTableData.GetI.GetActorTableData(ActorTableID);
            this.gameObject.layer = CalcManager.GetCampTypeTOLayerIndex(this);

            //m_AnimationCallFN.Clear();
            //m_AnimationCallFN.Add(E_AniCallType.Attack01, Attack1);
            //m_AnimationCallFN.Add(E_AniCallType.Attack01, Attack1);
            m_AnimationCallFNArray = new Action <E_AniCallType> [(int)E_AniCallType.Max];
            m_AnimationCallFNArray[(int)E_AniCallType.Attack01] = Attack1;
            m_AnimationCallFNArray[(int)E_AniCallType.Attack02] = Attack1;


            m_LinkAnimator = GetComponentInChildren <Animator>();

            AttackRange.InitCollisionDetating(this, AttackCollistionEnter);
            SerchingRange.InitCollisionDetating(this, SerchingCollsionEnter);

            ActorAniEventCom.SetAnimationCallBackFN(ActorAttackEventCallFN, ActorAttackAniEventCallFN);


            // 공격 정보 얻기
            AttackDataArray.Clear();
            AttackData tempattackdata = AttackTableData.GetI.GetAttackDataID(1000);

            AttackDataArray.Add(tempattackdata);


            SetDataSetting();

            m_ISInit = true;
        }