Exemple #1
0
    public void doAnimEvent(string strParam)
    {
        float fDistance = m_pSkill.GetProto().fOPDist;
        float fRadious  = m_pSkill.GetProto().fOPRadius;

        if (m_pOwner != null)
        {
            GameObject[] EnemyList = GetFronEnemy(fDistance, fRadious);
            foreach (var Enemy in EnemyList)
            {
                if (Enemy.transform.tag == "Player")
                {
                    CPlayerCompent pAI = Enemy.GetComponent <CPlayerCompent>();
                    if (pAI != null)
                    {
                        m_pOwner.m_combat.CalculateDmg(pAI.m_pOwner, m_pSkill, strParam);
                    }
                }

                if (Enemy.transform.tag == "Monster")
                {
                    CtrolEnenyAI pAI = Enemy.GetComponent <CtrolEnenyAI>();
                    if (pAI != null)
                    {
                        m_pOwner.m_combat.CalculateDmg(pAI.m_pOwner, m_pSkill, strParam);
                    }
                }
            }
        }
    }
Exemple #2
0
 //---------------------------------------------------------------------------------
 // 当退出碰撞器
 //---------------------------------------------------------------------------------
 void OnCollisionExit(Collision collisionInfo)
 {
     if (collisionInfo.gameObject != null)
     {
         CtrolEnenyAI health = collisionInfo.gameObject.GetComponent <CtrolEnenyAI>();
         if (health != null && m_Launcher != null)
         {
             m_Launcher.m_combat.CalculateDmg(health.m_pOwner, m_pSkill, "");
         }
     }
 }
Exemple #3
0
    public void doAnimEvent(string strParam)
    {
        if (m_pSkill == null)
        {
            return;
        }


        float fDistance = m_pSkill.GetProto().fOPDist;
        float fRadious  = m_pSkill.GetProto().fOPRadius;

        if (m_pOwner != null)
        {
            GameObject[] EnemyList = GetFronEnemy(fDistance, fRadious);
            foreach (var Enemy in EnemyList)
            {
                CtrolEnenyAI pAI = Enemy.GetComponent <CtrolEnenyAI>();
                m_pOwner.m_combat.CalculateDmg(pAI.m_pOwner, m_pSkill, strParam);
            }
        }
    }
Exemple #4
0
 //--------------------------------------------------------------------------------
 // 初始化
 //--------------------------------------------------------------------------------
 void Start()
 {
     m_CtrlSkelton = GetComponent <CtrolAnimation>();
     m_AI          = GetComponent <CtrolEnenyAI>();
 }