using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class SigmaWalkingSound : MonoBehaviour
{
public AudioSource InsaneSigmaWalkingSound;
public Animator ANI;
public bool walking;
// Start is called before the first frame update
void Start()
{
InsaneSigmaWalkingSound.enabled = false;
}
// Update is called once per frame
void Update()
{
if (Input.GetKey("w") || (Input.GetKey("s")) || (Input.GetKey("a") || (Input.GetKey("d"))))
{
InsaneSigmaWalkingSound.enabled = true;
}
else
{
InsaneSigmaWalkingSound.enabled = false;
}
if(Input.GetKeyDown(KeyCode.W)){
ANI.SetTrigger("walk");
ANI.ResetTrigger("idle");
walking = true;
//steps1.SetActive(true);
}
if(Input.GetKeyUp(KeyCode.W)){
ANI.ResetTrigger("walk");
ANI.SetTrigger("idle");
walking = false;
//steps1.SetActive(false);
}
if(Input.GetKeyDown(KeyCode.A)){
ANI.SetTrigger("left");
ANI.ResetTrigger("idle");
//steps1.SetActive(true);
}
if(Input.GetKeyUp(KeyCode.D)){
ANI.ResetTrigger("right");
ANI.SetTrigger("idle");
//steps1.SetActive(false);
}
}
}