Пример #1
0
    void Start()
    {
        base.Start();
        m_enemyFlip   = GetComponent <Enemy_FlipByPlayer>();
        m_bDashToggle = true;
        player        = GameObject.FindGameObjectWithTag("player").GetComponent <Transform>();
        playerControl = player.GetComponent <PlayerControl1>();

        body = GetComponent <Rigidbody2D>();

        playerBox = player.GetComponent <BoxCollider2D>();

        m_shootSkill = GetComponent <EnemySkillShoot>();

        m_throwBomb = GetComponent <EnemySkillThrowBomb>();

        m_animator = GetComponentInChildren <Animator>();
        m_nAnimatorChargingPara   = Animator.StringToHash(AnimatorChargingPara);
        m_nAnimatorAttackPara     = Animator.StringToHash(AnimatorAttackPara);
        m_nAnimatorThrowBombPara  = Animator.StringToHash(AnimatorThrowBombPara);
        m_nAnimatorShootingPara   = Animator.StringToHash(AnimatorShootingPara);
        m_nAnimatorThrowReadyPara = Animator.StringToHash(AnimatorThrowReadyPara);

        m_nAnimationThrowReady = Animator.StringToHash(AnimationNameThrowReady);
        m_nAnimationThrow      = Animator.StringToHash(AnimationNameThrow);
    }
Пример #2
0
 public void Registe(EnemySkillBase _childSkill)
 {
     m_skillMgr = GetComponent <EnemySkillManager>();
     if (m_skillMgr != null)
     {
         m_skillMgr.RegisteSkill(NameOfSkill, this);
     }
 }
Пример #3
0
    void Start()
    {
        base.Start();
        player        = GameObject.FindGameObjectWithTag("player").GetComponent <Transform>();
        playerControl = player.GetComponent <PlayerControl1>();

        body = GetComponent <Rigidbody2D>();

        playerBox = player.GetComponent <BoxCollider2D>();

        m_shootSkill = GetComponent <EnemySkillShoot>();

        m_throwBomb = GetComponent <EnemySkillThrowBomb>();
    }
Пример #4
0
 public void RegisteSkill(string strNameOfSkill, EnemySkillBase _skillBase)
 {
     if (m_dic == null)
     {
         m_dic = new Dictionary <string, EnemySkillBase>();
     }
     if (m_dic.ContainsKey(strNameOfSkill) == false)
     {
         m_dic.Add(strNameOfSkill, _skillBase);
     }
     else
     {
         Debug.Assert(false, string.Format("技能已经被注册过了"));
     }
 }