init
This commit is contained in:
commit
001bb14f16
951 changed files with 270074 additions and 0 deletions
32
Assets/Scripts/Player/FootSteps.cs
Normal file
32
Assets/Scripts/Player/FootSteps.cs
Normal file
|
@ -0,0 +1,32 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class FootSteps : MonoBehaviour{
|
||||
|
||||
public float spawnRate;
|
||||
float nextSpawn;
|
||||
|
||||
bool step;
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start(){
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update(){
|
||||
if (Input.GetButton("Walk")){
|
||||
if (Time.time > nextSpawn){
|
||||
nextSpawn = Time.time + spawnRate;
|
||||
if (step){
|
||||
AudioManager.instance.Play("Step1");
|
||||
step = false;
|
||||
}else{
|
||||
AudioManager.instance.Play("Step2");
|
||||
step = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue