File name
Commit message
Commit date
File name
Commit message
Commit date
File name
Commit message
Commit date
File name
Commit message
Commit date
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using BNG;
public class InputController : MonoBehaviour
{
public PlayManager playManager;
public UIManager uIManager;
public AudioSource audioSource;
private bool isUseDelay;
// Start is called before the first frame update
void Start()
{
isUseDelay = false;
}
void ResetDelay()
{
isUseDelay = false;
}
// Update is called once per frame
void Update()
{
if ((InputBridge.Instance.LeftTriggerUp) || Input.GetKeyDown(KeyCode.Alpha1))
{
if (playManager.divideState == PlayManager.DivideState.Off || playManager.divideState == PlayManager.DivideState.Auto)
{
if (playManager.isPause)
{
playManager.Play();
}
else
{
playManager.Pause();
}
}
else if (playManager.divideState == PlayManager.DivideState.On)
{
if (playManager.isPause)
{
playManager.Play();
}
}
}
if(InputBridge.Instance.RightTriggerUp || Input.GetKeyDown(KeyCode.Alpha2))
{
Debug.Log("isPause : " + playManager.isPause);
playManager.Play();
}
if ((InputBridge.Instance.YButtonUp && InputBridge.Instance.BButtonUp == false) || Input.GetKeyDown(KeyCode.Alpha3))
{
if(isUseDelay == false)
{
audioSource.Play();
playManager.SetLoopFront();
}
}
if ((InputBridge.Instance.YButtonDown) && InputBridge.Instance.BButtonDown)
{
if(isUseDelay == false)
{
isUseDelay = true;
playManager.ResetAll();
Invoke("ResetDelay", 1f);
}
}
if (InputBridge.Instance.XButtonUp || Input.GetKeyDown(KeyCode.Alpha4))
{
playManager.SetSpeedSlow();
}
if ((InputBridge.Instance.BButtonUp && InputBridge.Instance.YButtonUp == false) || Input.GetKeyDown(KeyCode.Alpha5))
{
if (isUseDelay == false)
{
audioSource.Play();
playManager.SetLoopEnd();
}
// playManager.SetPlayOrPause();
//playManager.SetGotoEnd();
}
if(InputBridge.Instance.AButtonUp || Input.GetKeyDown(KeyCode.Alpha6))
{
//playManager.ResetLoop();
playManager.SetSpeedFast();
}
if (InputBridge.Instance.StartButton || Input.GetKeyDown(KeyCode.Escape))
{
// UnityEngine.SceneManagement.SceneManager.LoadScene(0);
uIManager.SetUI();
}
}
}