Exemplo n.º 1
0
    // Send a value 0-1 to this function to set the friction value
    // (0 = lowest, 1 = highest)
    public void SetFriction(float frictionPercent, Brusher.eScrubPlace scrubPlace)
    {
        curlingPercent = 1f - frictionPercent;                              // friction and curling are inverse
        frictionValue  = frictionPercent * (FRICTION_MAX - FRICTION_MIN);

        if (frictionValue < FRICTION_MIN)
        {
            frictionValue = FRICTION_MIN;
        }
        else if (frictionValue > FRICTION_MAX)
        {
            frictionValue = FRICTION_MAX;
        }

        switch (scrubPlace)
        {
        case Brusher.eScrubPlace.eFarLeft: {
            curlingDirection = new Vector3(-0.35f * rigidbody.velocity.magnitude, 0f, 0f);
            break;
        }

        case Brusher.eScrubPlace.eLeft: {
            curlingDirection = new Vector3(-0.25f * rigidbody.velocity.magnitude, 0f, 0f);
            break;
        }

        case Brusher.eScrubPlace.eMiddle: {
            curlingDirection = Vector3.zero;
            break;
        }

        case Brusher.eScrubPlace.eRight: {
            curlingDirection = new Vector3(0.25f * rigidbody.velocity.magnitude, 0f, 0f);
            break;
        }

        case Brusher.eScrubPlace.eFarRight: {
            curlingDirection = new Vector3(0.35f * rigidbody.velocity.magnitude, 0f, 0f);
            break;
        }
        }

        curlingDirection *= curlingPercent;
    }
Exemplo n.º 2
0
 public void SetFriction(float friction, Brusher.eScrubPlace scrubPlace)
 {
     stoneClone.SetFriction(friction, scrubPlace);
 }
Exemplo n.º 3
0
 public void SetFriction(float friction, Brusher.eScrubPlace scrubPlace)
 {
     player.SetFriction(friction, scrubPlace);
 }