示例#1
0
文件: Thinker.cs 项目: gewl/fortda
 public void OnHearImpactSound(Transform noisyObject)
 {
     objectsInvestigating.Push(noisyObject);
     if (stateMachine.IsInState(typeof(SpottedObjectState)))
     {
         return;
     }
     Alert();
     if (stateMachine.IsInState(typeof(InvestigatingSoundState)))
     {
         stateMachine.Hesitate();
         CompareDistancesToInvestigate(noisyObject);
     }
     else
     {
         stateMachine.SwitchState(new InvestigatingSoundState(stateMachine));
     }
 }