private void MoveScript_OnMoving(object sender, OnMovingArgs e)
 {
     e.Cancel = OnIce;
     if (!OnIce && e.Velocity != Physics.gravity)
     {
         if (stepTimer >= stepCooldown)
         {
             audioSources[UnityEngine.Random.Range(3, 17)].Play();
             stepTimer = 0;
         }
     }
 }
Exemple #2
0
    private void FixedUpdate()
    {
        OnMovingArgs args = new OnMovingArgs(movement + (AddGravity ? Physics.gravity : Vector3.zero));

        if (OnMoving != null)
        {
            OnMoving.Invoke(this, args);
        }

        if (!args.Cancel)
        {
            physics.velocity = (args.Velocity * MovementMultiplicator);
            movement         = Vector3.zero;
        }
    }