Exemple #1
0
    void OnTriggerStay2D(Collider2D other)
    {
        // 状態チェック
        if (enemyCtrl.grounded && CheckAction())
        {
            if (other.name == "EnemyJumpTrigger_L")
            {
                if (enemyCtrl.ActionJump())
                {
                    enemyCtrl.ActionMove(-1.0f);
                }
            }
            else
            if (other.name == "EnemyJumpTrigger_R")
            {
                if (enemyCtrl.ActionJump())
                {
                    enemyCtrl.ActionMove(+1.0f);
                }
            }
            else
            if (other.name == "EnemyJumpTrigger")
            {
                enemyCtrl.ActionJump();
            }

            //Debug.Log ("Enemy OnTriggerEnter2D : " + other.name);
        }
    }
 void OnTriggerStay2D(Collider2D other)
 {
     // เช็คสถานะต่างๆ แล้วเคลื่อนไหวตามเงื่อนไขนั้นๆ
     if (enemyCtrl.grounded && CheckAction())
     {
         if (other.name == "EnemyJumpTrigger_L")
         {
             if (enemyCtrl.ActionJump())
             {
                 enemyCtrl.ActionMove(-1.0f);
             }
         }
         else
         if (other.name == "EnemyJumpTrigger_R")
         {
             if (enemyCtrl.ActionJump())
             {
                 enemyCtrl.ActionMove(+1.0f);
             }
         }
         else
         if (other.name == "EnemyJumpTrigger")
         {
             enemyCtrl.ActionJump();
         }
     }
 }
Exemple #3
0
 void OnTriggerStay2D(Collider2D other)
 {
     if (enemyCtrl.name == "EnemyJumpTrigger_L")
     {
         if (enemyCtrl.ActionJump())
         {
             enemyCtrl.ActionMove(1.0f);
         }
     }
     else if (other.name == "EnemyJumpTrigger_R")
     {
         if (enemyCtrl.ActionJump())
         {
             enemyCtrl.ActionMove(-1.0f);
         }
     }
     else if (other.name == "EnemyJumpTrigger")
     {
         enemyCtrl.ActionJump();
     }
 }
Exemple #4
0
 public virtual void SetCombatAIState(ENEMYAISTS sts)
 {
     aiState           = sts;
     aiActionTImeStart = Time.fixedTime;
     enemyCtrl.ActionMove(0.0f);
 }