44 lines
1.3 KiB
C#
44 lines
1.3 KiB
C#
using UnityEngine;
|
|
using UnityEngine.Playables;
|
|
|
|
public class AlternateUniversePlayerController : MonoBehaviour
|
|
{
|
|
[SerializeField] private PlayableDirector AlternateGhostUniversePlayableDirector;
|
|
[SerializeField] private PlayableDirector AlternateGhostUniversePhaseOutDirector;
|
|
|
|
private static AlternateUniversePlayerController _instance;
|
|
public static AlternateUniversePlayerController GetInstance() { return _instance; }
|
|
|
|
private void Awake()
|
|
{
|
|
if (!_instance)
|
|
{
|
|
_instance = this;
|
|
}
|
|
}
|
|
|
|
public void Update()
|
|
{
|
|
if (ClockController.GetInstance().isUsingPocketWatch && AlternateUniverseManager.GetInstance().CanTearFabricOfReality)
|
|
{
|
|
if (Input.GetKeyDown(KeyCode.Return) || Input.GetKeyDown(KeyCode.JoystickButton0))
|
|
{
|
|
if (AlternateUniverseManager.GetInstance().IsInGhostUniverse)
|
|
{
|
|
AlternateGhostUniversePlayableDirector.Play();
|
|
}
|
|
else
|
|
{
|
|
AlternateGhostUniversePlayableDirector.Play();
|
|
}
|
|
ClockController.GetInstance().ClosePocketWatch();
|
|
}
|
|
}
|
|
}
|
|
|
|
public void PhaseOutOfGhostUniverse()
|
|
{
|
|
AlternateGhostUniversePhaseOutDirector.Play();
|
|
}
|
|
}
|