Beispiel #1
0
 public void Update()
 {
     if (walkingMode)
     {
         physic.MoveForward(1.3f);
     }
 }
Beispiel #2
0
    private IEnumerator WalkToTargetTask(float stopDistance)
    {
        // INIT
        TaskRunning = true;
        UnityEngine.Random.InitState((int)(transform.position.x * Mathf.Pow(10, 6)));
        float randomStopDistance = stopDistance * UnityEngine.Random.Range(0.7f, 1.3f);

        EnemyMovement.FaceTarget(transform, Target);
        // TASK
        while (targetDistance.MoreThan(randomStopDistance))
        {
            physic.MoveForward(SpeedFactor);
            yield return(new WaitForEndOfFrame());
        }
        // #dodgy - gives time to end the stop walking anim
        yield return(new WaitForSeconds(1));

        // DESINIT
        TaskRunning = false;
    }
Beispiel #3
0
 private void HippieWalkAround()
 {
     physic.MoveForward(hippieSpeedWalkingFactor);
 }