Professional Documents
Culture Documents
Collections;
using System.Collections.Generic;
using UnityEngine;
void Awake () {
playerMovement = GetComponent<PlayerMovement>();
look_Root = transform.GetChild(0);
player_Footsteps = GetComponentInChildren<PlayerFootsteps>();
player_Stats = GetComponent<PlayerStats>();
}
void Start() {
player_Footsteps.volume_Min = walk_Volume_Min;
player_Footsteps.volume_Max = walk_Volume_Max;
player_Footsteps.step_Distance = walk_Step_Distance;
}
void Sprint() {
playerMovement.speed = sprint_Speed;
player_Footsteps.step_Distance = sprint_Step_Distance;
player_Footsteps.volume_Min = sprint_Volume;
player_Footsteps.volume_Max = sprint_Volume;
playerMovement.speed = move_Speed;
player_Footsteps.step_Distance = walk_Step_Distance;
player_Footsteps.volume_Min = walk_Volume_Min;
player_Footsteps.volume_Max = walk_Volume_Max;
sprint_Value = 0f;
player_Stats.Display_StaminaStats(sprint_Value);
} else {
if(sprint_Value != 100f) {
player_Stats.Display_StaminaStats(sprint_Value);
}
} // sprint
void Crouch() {
if(Input.GetKeyDown(KeyCode.C)) {
player_Footsteps.step_Distance = walk_Step_Distance;
player_Footsteps.volume_Min = walk_Volume_Min;
player_Footsteps.volume_Max = walk_Volume_Max;
is_Crouching = false;
} else {
// if we are not crouching - crouch
player_Footsteps.step_Distance = crouch_Step_Distance;
player_Footsteps.volume_Min = crouch_Volume;
player_Footsteps.volume_Max = crouch_Volume;
is_Crouching = true;
} // if we press c
} // crouch
} // class