Example #1
0
 /// <summary>
 /// Controlls the time interval and % chance for the game object to activate the ScareCow event.
 /// </summary>
 public override void Update()
 {
     OwnerPhysics.SetVelocity(AIagent.velocity);
     ShoutTimer += Time.deltaTime;
     if (ShoutTimer >= ShoutCooldown && Random.Range(1, 10) > 5)
     {
         ScareCowEventInfo scei = new ScareCowEventInfo
         {
             scarySoundLocation = Position.position
         };
         EventHandeler.Current.FireEvent(EventHandeler.EVENT_TYPE.ScareCow, scei);
         ShoutTimer = 0;
     }
 }
Example #2
0
 protected void setVelocity()
 {
     OwnerPhysics.SetVelocity(AIagent.velocity);
 }