Example #1
0
    public void StopGrind(float exitForce)
    {
        this.grindLoopSource.Stop();
        float single = 1f;

        if (single > this.grindVolMax)
        {
            single = this.grindVolMax;
        }
        switch (this.grindState)
        {
        case DeckSounds.GrindState.wood:
        {
            this.PlayRandomOneShotFromArray(this.woodGrindGeneralEnd, this.grindHitSource, single * 0.6f);
            break;
        }

        case DeckSounds.GrindState.metal:
        {
            this.PlayRandomOneShotFromArray(this.metalGrindGeneralEnd, this.grindHitSource, single * 0.6f);
            break;
        }

        case DeckSounds.GrindState.concrete:
        {
            this.PlayRandomOneShotFromArray(this.concreteGrindGeneralEnd, this.grindHitSource, single * 0.6f);
            break;
        }
        }
        this.grindState = DeckSounds.GrindState.none;
    }
Example #2
0
 public void OnWoodGrind(float impactForce)
 {
     if (this.grindState == DeckSounds.GrindState.none)
     {
         Vector3 vector3 = Vector3.ProjectOnPlane(PlayerController.Instance.boardController.boardRigidbody.velocity, Vector3.up);
         this.SetGrindingVolFromBoardSpeed(vector3.magnitude);
         this.PlayRandomOneShotFromArray(this.woodGrindGeneralStart, this.grindHitSource, impactForce / 10f);
         this.PlayRandomFromArray(this.woodGrindGeneralLoop, this.grindLoopSource);
         this.grindState = DeckSounds.GrindState.wood;
     }
 }