コード例 #1
0
 // This function return false if the enemy is for any reason not targetable
 bool IsTargetable(PawnAI enemy)
 {
     if (enemy.GetHealth().IsDead() || enemy.GetHealth().IsKnockedDown() || enemy == currentTarget)
     {
         return(false);
     }
     return(true);
 }
コード例 #2
0
 // The update will launch a run of the behaviourtree root, which in turn trigger the run for its children, and so on...
 void Update()
 {
     if (Time.time - lastDecisionTick > decisionTick)
     {
         if (!pawn.GetHealth().IsDead() && !pawn.GetHealth().IsKnockedDown())
         {
             behaviourTreeRoot.Run();
         }
         lastDecisionTick = Time.time;
     }
 }
コード例 #3
0
ファイル: Debug.cs プロジェクト: navezof/Disarmed
 void Update()
 {
     if (Input.GetKeyDown("a"))
     {
         player.GetHealth().TakeDamage(1);
     }
     if (Input.GetKeyDown("q"))
     {
         enemy.GetHealth().KnockedDown();
     }
 }