2022-07-15 19:40:57 +03:00
|
|
|
using System;
|
2022-07-18 19:49:23 +03:00
|
|
|
using System.Collections.Generic;
|
2022-07-15 19:40:57 +03:00
|
|
|
using System.IO;
|
2023-10-26 22:42:28 +03:00
|
|
|
using System.Linq;
|
2023-12-03 02:36:58 +02:00
|
|
|
using SharedGame;
|
2022-07-15 19:40:57 +03:00
|
|
|
using UnityEngine;
|
2022-08-09 21:48:58 +03:00
|
|
|
using UnityEngine.InputSystem;
|
2022-07-15 19:40:57 +03:00
|
|
|
|
|
|
|
|
public class ReplayManager : MonoBehaviour
|
|
|
|
|
{
|
2023-09-22 16:54:55 +03:00
|
|
|
[SerializeField] private ReplaySO _replaySO = default;
|
2022-09-14 23:06:52 +03:00
|
|
|
[SerializeField] private PauseMenu _replayPauseMenu = default;
|
|
|
|
|
[SerializeField] private TextAsset _versionTextAsset = default;
|
|
|
|
|
[SerializeField] private GameObject _replayPrompts = default;
|
|
|
|
|
[SerializeField] private GameObject _replayInput = default;
|
|
|
|
|
[SerializeField] private Animator _replayNotificationAnimator = default;
|
|
|
|
|
[SerializeField] private InputHistory _playerOneInputHistory = default;
|
|
|
|
|
[SerializeField] private InputHistory _playerTwoInputHistory = default;
|
|
|
|
|
[Header("Debug")]
|
|
|
|
|
[SerializeField] private bool _isReplayMode;
|
|
|
|
|
[Range(0, 99)]
|
|
|
|
|
[SerializeField] private int _replayIndex;
|
|
|
|
|
private readonly string _versionSplit = "Version:";
|
|
|
|
|
private readonly string _patchNotesSplit = "Patch Notes:";
|
2023-10-24 09:27:27 +03:00
|
|
|
|
2022-07-15 19:40:57 +03:00
|
|
|
|
2022-09-14 23:06:52 +03:00
|
|
|
public string VersionNumber { get; private set; }
|
|
|
|
|
public int Skip { get; set; }
|
2023-09-22 16:54:55 +03:00
|
|
|
public int ReplayAmount { get { return _replaySO.replays.Count; } private set { } }
|
2022-09-14 23:06:52 +03:00
|
|
|
public static ReplayManager Instance { get; private set; }
|
2022-07-15 23:58:02 +03:00
|
|
|
|
2022-09-14 23:06:52 +03:00
|
|
|
void Awake()
|
|
|
|
|
{
|
|
|
|
|
if (!SceneSettings.SceneSettingsDecide)
|
|
|
|
|
{
|
|
|
|
|
SceneSettings.ReplayMode = _isReplayMode;
|
|
|
|
|
SceneSettings.ReplayIndex = _replayIndex;
|
|
|
|
|
}
|
2022-11-21 18:08:37 +02:00
|
|
|
|
2022-09-14 23:06:52 +03:00
|
|
|
if (SceneSettings.ReplayMode)
|
|
|
|
|
{
|
|
|
|
|
SetReplay();
|
|
|
|
|
}
|
|
|
|
|
CheckInstance();
|
|
|
|
|
}
|
2022-07-15 19:40:57 +03:00
|
|
|
|
2023-03-11 16:35:39 +02:00
|
|
|
|
2022-09-14 23:06:52 +03:00
|
|
|
public void SetReplay()
|
|
|
|
|
{
|
2023-09-22 16:54:55 +03:00
|
|
|
ReplayData replayCardData = GetReplayData(SceneSettings.ReplayIndex);
|
|
|
|
|
SceneSettings.PlayerOne = replayCardData.playerOneCharacter;
|
|
|
|
|
SceneSettings.ColorOne = replayCardData.playerOneColor;
|
|
|
|
|
SceneSettings.AssistOne = replayCardData.playerOneAssist;
|
|
|
|
|
SceneSettings.PlayerTwo = replayCardData.playerTwoCharacter;
|
|
|
|
|
SceneSettings.ColorTwo = replayCardData.playerTwoColor;
|
|
|
|
|
SceneSettings.AssistTwo = replayCardData.playerTwoAssist;
|
2022-09-14 23:06:52 +03:00
|
|
|
SceneSettings.StageIndex = replayCardData.stage;
|
2023-09-22 16:54:55 +03:00
|
|
|
SceneSettings.MusicName = replayCardData.music;
|
|
|
|
|
SceneSettings.Bit1 = replayCardData.theme;
|
2022-09-14 23:06:52 +03:00
|
|
|
SceneSettings.ControllerOne = InputSystem.devices[0];
|
|
|
|
|
SceneSettings.ControllerTwo = InputSystem.devices[0];
|
|
|
|
|
SceneSettings.ReplayMode = true;
|
|
|
|
|
}
|
2022-07-18 22:59:16 +03:00
|
|
|
|
2022-09-14 23:06:52 +03:00
|
|
|
private void CheckInstance()
|
|
|
|
|
{
|
|
|
|
|
if (Instance != null && Instance != this)
|
|
|
|
|
Destroy(gameObject);
|
|
|
|
|
else
|
|
|
|
|
Instance = this;
|
|
|
|
|
}
|
2022-07-15 19:40:57 +03:00
|
|
|
|
2023-01-26 00:38:34 +02:00
|
|
|
private void Start()
|
2022-09-14 23:06:52 +03:00
|
|
|
{
|
2023-01-18 21:41:03 +02:00
|
|
|
string versionText = _versionTextAsset.text;
|
|
|
|
|
int versionTextPosition = versionText.IndexOf(_versionSplit) + _versionSplit.Length;
|
|
|
|
|
VersionNumber = versionText[versionTextPosition..versionText.LastIndexOf(_patchNotesSplit)].Trim();
|
2023-01-26 00:38:34 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void StartReplay()
|
|
|
|
|
{
|
2022-09-14 23:06:52 +03:00
|
|
|
if (SceneSettings.ReplayMode)
|
|
|
|
|
LoadReplay();
|
|
|
|
|
}
|
2022-07-16 18:09:48 +03:00
|
|
|
|
2022-09-14 23:06:52 +03:00
|
|
|
public void SaveReplay()
|
|
|
|
|
{
|
2023-12-03 02:36:58 +02:00
|
|
|
if (GameplayManager.Instance.PlayerOneController.ControllerInputName == "CPU" || GameplayManager.Instance.PlayerTwoController.ControllerInputName == "CPU")
|
|
|
|
|
return;
|
2023-02-02 03:08:56 +02:00
|
|
|
if (NetworkInput.IS_LOCAL)
|
2022-09-14 23:06:52 +03:00
|
|
|
{
|
2023-02-02 03:08:56 +02:00
|
|
|
if (!SceneSettings.IsTrainingMode && !SceneSettings.ReplayMode && _replayNotificationAnimator != null)
|
2022-09-14 23:06:52 +03:00
|
|
|
{
|
2023-10-26 22:42:28 +03:00
|
|
|
ReplayData replayData = new()
|
|
|
|
|
{
|
|
|
|
|
version = VersionNumber,
|
|
|
|
|
date = DateTime.Now.ToString("MM/dd/yyyy HH:mm"),
|
|
|
|
|
playerOneCharacter = SceneSettings.PlayerOne,
|
|
|
|
|
playerOneAssist = SceneSettings.AssistOne,
|
|
|
|
|
playerOneColor = SceneSettings.ColorOne,
|
|
|
|
|
playerTwoCharacter = SceneSettings.PlayerTwo,
|
|
|
|
|
playerTwoAssist = SceneSettings.AssistTwo,
|
|
|
|
|
playerTwoColor = SceneSettings.ColorTwo,
|
|
|
|
|
stage = SceneSettings.StageIndex,
|
|
|
|
|
music = GameplayManager.Instance.CurrentMusic.name,
|
|
|
|
|
theme = SceneSettings.Bit1,
|
|
|
|
|
playerOneInputs = new List<ReplayInput>(),
|
|
|
|
|
playerTwoInputs = new List<ReplayInput>()
|
|
|
|
|
};
|
2023-10-24 09:27:27 +03:00
|
|
|
|
2023-10-26 22:42:28 +03:00
|
|
|
for (int i = 0; i < _playerOneInputHistory.Inputs.Count; i++)
|
|
|
|
|
{
|
|
|
|
|
InputItemNetwork inputItem = _playerOneInputHistory.Inputs[i];
|
|
|
|
|
if (inputItem.time > 0)
|
|
|
|
|
{
|
|
|
|
|
ReplayInput replayInput = new()
|
|
|
|
|
{
|
|
|
|
|
input = inputItem.inputEnum,
|
|
|
|
|
time = inputItem.time
|
|
|
|
|
};
|
|
|
|
|
replayData.playerOneInputs.Add(replayInput);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
replayData.playerOneInputs = replayData.playerOneInputs.OrderBy(d => d.time).ToList();
|
|
|
|
|
for (int i = 0; i < _playerTwoInputHistory.Inputs.Count; i++)
|
|
|
|
|
{
|
|
|
|
|
InputItemNetwork inputItem = _playerTwoInputHistory.Inputs[i];
|
|
|
|
|
if (inputItem.time > 0)
|
|
|
|
|
{
|
|
|
|
|
ReplayInput replayInput = new()
|
|
|
|
|
{
|
|
|
|
|
input = inputItem.inputEnum,
|
|
|
|
|
time = inputItem.time
|
|
|
|
|
};
|
|
|
|
|
replayData.playerTwoInputs.Add(replayInput);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
replayData.playerTwoInputs = replayData.playerTwoInputs.OrderBy(d => d.time).ToList();
|
2023-10-24 09:27:27 +03:00
|
|
|
replayData.skipTime = Skip;
|
2023-02-02 03:08:56 +02:00
|
|
|
_replayNotificationAnimator.SetTrigger("Save");
|
2023-10-24 09:27:27 +03:00
|
|
|
_replaySO.replays.Add(replayData);
|
2022-09-14 23:06:52 +03:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-07-15 19:40:57 +03:00
|
|
|
|
2022-09-14 23:06:52 +03:00
|
|
|
public void LoadReplay()
|
|
|
|
|
{
|
|
|
|
|
SceneSettings.ReplayMode = true;
|
2022-12-04 21:35:31 +02:00
|
|
|
GameplayManager.Instance.PlayerOne.GetComponent<PlayerInput>().enabled = false;
|
|
|
|
|
GameplayManager.Instance.PlayerTwo.GetComponent<PlayerInput>().enabled = false;
|
2022-09-14 23:06:52 +03:00
|
|
|
replayCardData = GetReplayData(SceneSettings.ReplayIndex);
|
2022-11-21 18:08:37 +02:00
|
|
|
initialReplayStart = true;
|
2022-09-14 23:06:52 +03:00
|
|
|
}
|
2022-07-16 18:43:27 +03:00
|
|
|
|
2023-09-22 16:54:55 +03:00
|
|
|
private ReplayData replayCardData;
|
2022-11-21 18:08:37 +02:00
|
|
|
bool runReplay;
|
|
|
|
|
bool initialReplayStart;
|
2023-10-26 22:42:28 +03:00
|
|
|
private int playerOneReplayIndex;
|
|
|
|
|
private int playerTwoReplayIndex;
|
2022-07-23 13:08:05 +03:00
|
|
|
|
2023-10-24 09:27:27 +03:00
|
|
|
public ReplayData GetReplayData(int index) => _replaySO.replays[index];
|
2023-09-22 16:54:55 +03:00
|
|
|
|
2022-09-14 23:06:52 +03:00
|
|
|
public void StartLoadReplay()
|
|
|
|
|
{
|
|
|
|
|
replayCardData = GetReplayData(SceneSettings.ReplayIndex);
|
2022-11-21 18:08:37 +02:00
|
|
|
runReplay = true;
|
2022-09-14 23:06:52 +03:00
|
|
|
}
|
2023-10-26 22:42:28 +03:00
|
|
|
private void Update()
|
2022-09-14 23:06:52 +03:00
|
|
|
{
|
2023-10-26 22:42:28 +03:00
|
|
|
#if UNITY_EDITOR
|
|
|
|
|
if (Input.GetKeyDown(KeyCode.CapsLock) && !SceneSettings.IsTrainingMode)
|
|
|
|
|
SaveReplay();
|
|
|
|
|
#endif
|
2022-11-21 18:08:37 +02:00
|
|
|
if (initialReplayStart)
|
2022-09-14 23:06:52 +03:00
|
|
|
{
|
2023-09-22 16:54:55 +03:00
|
|
|
if (DemonicsWorld.Frame == replayCardData.skipTime && replayCardData.skipTime > 0)
|
2022-09-14 23:06:52 +03:00
|
|
|
{
|
2023-01-23 18:31:58 +02:00
|
|
|
GameSimulation.Skip = true;
|
2022-11-21 18:08:37 +02:00
|
|
|
initialReplayStart = false;
|
|
|
|
|
runReplay = true;
|
2022-09-14 23:06:52 +03:00
|
|
|
}
|
|
|
|
|
}
|
2022-11-21 18:08:37 +02:00
|
|
|
if (runReplay)
|
2022-09-14 23:06:52 +03:00
|
|
|
{
|
2023-10-26 22:42:28 +03:00
|
|
|
NetworkInput.ONE_NEUTRAL_INPUT = false;
|
|
|
|
|
NetworkInput.ONE_UP_INPUT = false;
|
|
|
|
|
NetworkInput.ONE_DOWN_INPUT = false;
|
|
|
|
|
NetworkInput.ONE_LEFT_INPUT = false;
|
|
|
|
|
NetworkInput.ONE_RIGHT_INPUT = false;
|
|
|
|
|
NetworkInput.ONE_UP_RIGHT_INPUT = false;
|
|
|
|
|
NetworkInput.ONE_UP_LEFT_INPUT = false;
|
|
|
|
|
NetworkInput.ONE_DOWN_RIGHT_INPUT = false;
|
|
|
|
|
NetworkInput.ONE_DOWN_LEFT_INPUT = false;
|
|
|
|
|
|
|
|
|
|
NetworkInput.ONE_LIGHT_INPUT = false;
|
|
|
|
|
NetworkInput.ONE_MEDIUM_INPUT = false;
|
|
|
|
|
NetworkInput.ONE_HEAVY_INPUT = false;
|
|
|
|
|
NetworkInput.ONE_SHADOW_INPUT = false;
|
|
|
|
|
NetworkInput.ONE_ARCANA_INPUT = false;
|
|
|
|
|
NetworkInput.ONE_DASH_FORWARD_INPUT = false;
|
|
|
|
|
NetworkInput.ONE_DASH_BACKWARD_INPUT = false;
|
|
|
|
|
NetworkInput.ONE_GRAB_INPUT = false;
|
|
|
|
|
NetworkInput.ONE_BLUE_FRENZY_INPUT = false;
|
|
|
|
|
NetworkInput.ONE_RED_FRENZY_INPUT = false;
|
|
|
|
|
|
|
|
|
|
NetworkInput.TWO_NEUTRAL_INPUT = false;
|
|
|
|
|
NetworkInput.TWO_UP_INPUT = false;
|
|
|
|
|
NetworkInput.TWO_DOWN_INPUT = false;
|
|
|
|
|
NetworkInput.TWO_LEFT_INPUT = false;
|
|
|
|
|
NetworkInput.TWO_RIGHT_INPUT = false;
|
|
|
|
|
NetworkInput.TWO_UP_RIGHT_INPUT = false;
|
|
|
|
|
NetworkInput.TWO_UP_LEFT_INPUT = false;
|
|
|
|
|
NetworkInput.TWO_DOWN_RIGHT_INPUT = false;
|
|
|
|
|
NetworkInput.TWO_DOWN_LEFT_INPUT = false;
|
|
|
|
|
|
|
|
|
|
NetworkInput.TWO_LIGHT_INPUT = false;
|
|
|
|
|
NetworkInput.TWO_MEDIUM_INPUT = false;
|
|
|
|
|
NetworkInput.TWO_HEAVY_INPUT = false;
|
|
|
|
|
NetworkInput.TWO_SHADOW_INPUT = false;
|
|
|
|
|
NetworkInput.TWO_ARCANA_INPUT = false;
|
|
|
|
|
NetworkInput.TWO_DASH_FORWARD_INPUT = false;
|
|
|
|
|
NetworkInput.TWO_DASH_BACKWARD_INPUT = false;
|
|
|
|
|
NetworkInput.TWO_GRAB_INPUT = false;
|
|
|
|
|
NetworkInput.TWO_BLUE_FRENZY_INPUT = false;
|
|
|
|
|
NetworkInput.TWO_RED_FRENZY_INPUT = false;
|
2022-09-14 23:06:52 +03:00
|
|
|
NextReplayAction();
|
2022-11-13 22:31:31 +02:00
|
|
|
NextReplayAction2();
|
2022-09-14 23:06:52 +03:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
private void NextReplayAction()
|
|
|
|
|
{
|
2023-10-26 22:42:28 +03:00
|
|
|
if (playerOneReplayIndex < replayCardData.playerOneInputs.Count)
|
2022-09-14 23:06:52 +03:00
|
|
|
{
|
2023-10-26 22:42:28 +03:00
|
|
|
if (DemonicsWorld.Frame >= replayCardData.playerOneInputs[playerOneReplayIndex].time)
|
2022-09-14 23:06:52 +03:00
|
|
|
{
|
2023-10-26 22:42:28 +03:00
|
|
|
if (replayCardData.playerOneInputs[playerOneReplayIndex].input == InputEnum.Neutral)
|
|
|
|
|
NetworkInput.ONE_NEUTRAL_INPUT = true;
|
|
|
|
|
if (replayCardData.playerOneInputs[playerOneReplayIndex].input == InputEnum.Up)
|
|
|
|
|
NetworkInput.ONE_UP_INPUT = true;
|
|
|
|
|
if (replayCardData.playerOneInputs[playerOneReplayIndex].input == InputEnum.Down)
|
|
|
|
|
NetworkInput.ONE_DOWN_INPUT = true;
|
|
|
|
|
if (replayCardData.playerOneInputs[playerOneReplayIndex].input == InputEnum.Left)
|
|
|
|
|
NetworkInput.ONE_LEFT_INPUT = true;
|
|
|
|
|
if (replayCardData.playerOneInputs[playerOneReplayIndex].input == InputEnum.Right)
|
|
|
|
|
NetworkInput.ONE_RIGHT_INPUT = true;
|
|
|
|
|
if (replayCardData.playerOneInputs[playerOneReplayIndex].input == InputEnum.UpRight)
|
|
|
|
|
NetworkInput.ONE_UP_RIGHT_INPUT = true;
|
|
|
|
|
if (replayCardData.playerOneInputs[playerOneReplayIndex].input == InputEnum.UpLeft)
|
|
|
|
|
NetworkInput.ONE_UP_LEFT_INPUT = true;
|
|
|
|
|
if (replayCardData.playerOneInputs[playerOneReplayIndex].input == InputEnum.DownRight)
|
|
|
|
|
NetworkInput.ONE_DOWN_RIGHT_INPUT = true;
|
|
|
|
|
if (replayCardData.playerOneInputs[playerOneReplayIndex].input == InputEnum.DownLeft)
|
|
|
|
|
NetworkInput.ONE_DOWN_LEFT_INPUT = true;
|
|
|
|
|
|
|
|
|
|
if (replayCardData.playerOneInputs[playerOneReplayIndex].input == InputEnum.Light)
|
2023-01-23 18:31:58 +02:00
|
|
|
NetworkInput.ONE_LIGHT_INPUT = true;
|
2023-10-26 22:42:28 +03:00
|
|
|
if (replayCardData.playerOneInputs[playerOneReplayIndex].input == InputEnum.Medium)
|
2023-01-23 18:31:58 +02:00
|
|
|
NetworkInput.ONE_MEDIUM_INPUT = true;
|
2023-10-26 22:42:28 +03:00
|
|
|
if (replayCardData.playerOneInputs[playerOneReplayIndex].input == InputEnum.Heavy)
|
2023-01-23 18:31:58 +02:00
|
|
|
NetworkInput.ONE_HEAVY_INPUT = true;
|
2023-10-26 22:42:28 +03:00
|
|
|
if (replayCardData.playerOneInputs[playerOneReplayIndex].input == InputEnum.Assist)
|
2023-01-23 18:31:58 +02:00
|
|
|
NetworkInput.ONE_SHADOW_INPUT = true;
|
2023-10-26 22:42:28 +03:00
|
|
|
if (replayCardData.playerOneInputs[playerOneReplayIndex].input == InputEnum.Special)
|
2023-01-23 18:31:58 +02:00
|
|
|
NetworkInput.ONE_ARCANA_INPUT = true;
|
2023-10-26 22:42:28 +03:00
|
|
|
if (replayCardData.playerOneInputs[playerOneReplayIndex].input == InputEnum.ForwardDash)
|
2023-01-23 18:31:58 +02:00
|
|
|
NetworkInput.ONE_DASH_FORWARD_INPUT = true;
|
2023-10-26 22:42:28 +03:00
|
|
|
if (replayCardData.playerOneInputs[playerOneReplayIndex].input == InputEnum.BackDash)
|
2023-01-23 18:31:58 +02:00
|
|
|
NetworkInput.ONE_DASH_BACKWARD_INPUT = true;
|
2023-10-26 22:42:28 +03:00
|
|
|
if (replayCardData.playerOneInputs[playerOneReplayIndex].input == InputEnum.Throw)
|
2023-01-23 18:31:58 +02:00
|
|
|
NetworkInput.ONE_GRAB_INPUT = true;
|
2023-10-26 22:42:28 +03:00
|
|
|
if (replayCardData.playerOneInputs[playerOneReplayIndex].input == InputEnum.Parry)
|
2023-01-23 18:31:58 +02:00
|
|
|
NetworkInput.ONE_BLUE_FRENZY_INPUT = true;
|
2023-10-26 22:42:28 +03:00
|
|
|
if (replayCardData.playerOneInputs[playerOneReplayIndex].input == InputEnum.RedFrenzy)
|
2023-01-23 18:31:58 +02:00
|
|
|
NetworkInput.ONE_RED_FRENZY_INPUT = true;
|
2023-10-26 22:42:28 +03:00
|
|
|
playerOneReplayIndex++;
|
2022-09-14 23:06:52 +03:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-11-13 22:31:31 +02:00
|
|
|
private void NextReplayAction2()
|
|
|
|
|
{
|
2023-10-26 22:42:28 +03:00
|
|
|
if (playerTwoReplayIndex < replayCardData.playerTwoInputs.Count)
|
|
|
|
|
{
|
|
|
|
|
if (DemonicsWorld.Frame >= replayCardData.playerTwoInputs[playerTwoReplayIndex].time)
|
|
|
|
|
{
|
|
|
|
|
if (replayCardData.playerTwoInputs[playerTwoReplayIndex].input == InputEnum.Neutral)
|
|
|
|
|
NetworkInput.TWO_NEUTRAL_INPUT = true;
|
|
|
|
|
if (replayCardData.playerTwoInputs[playerTwoReplayIndex].input == InputEnum.Up)
|
|
|
|
|
NetworkInput.TWO_UP_INPUT = true;
|
|
|
|
|
if (replayCardData.playerTwoInputs[playerTwoReplayIndex].input == InputEnum.Down)
|
|
|
|
|
NetworkInput.TWO_DOWN_INPUT = true;
|
|
|
|
|
if (replayCardData.playerTwoInputs[playerTwoReplayIndex].input == InputEnum.Left)
|
|
|
|
|
NetworkInput.TWO_LEFT_INPUT = true;
|
|
|
|
|
if (replayCardData.playerTwoInputs[playerTwoReplayIndex].input == InputEnum.Right)
|
|
|
|
|
NetworkInput.TWO_RIGHT_INPUT = true;
|
|
|
|
|
if (replayCardData.playerTwoInputs[playerTwoReplayIndex].input == InputEnum.UpRight)
|
|
|
|
|
NetworkInput.TWO_UP_RIGHT_INPUT = true;
|
|
|
|
|
if (replayCardData.playerTwoInputs[playerTwoReplayIndex].input == InputEnum.UpLeft)
|
|
|
|
|
NetworkInput.TWO_UP_LEFT_INPUT = true;
|
|
|
|
|
if (replayCardData.playerTwoInputs[playerTwoReplayIndex].input == InputEnum.DownRight)
|
|
|
|
|
NetworkInput.TWO_DOWN_RIGHT_INPUT = true;
|
|
|
|
|
if (replayCardData.playerTwoInputs[playerTwoReplayIndex].input == InputEnum.DownLeft)
|
|
|
|
|
NetworkInput.TWO_DOWN_LEFT_INPUT = true;
|
|
|
|
|
|
|
|
|
|
if (replayCardData.playerTwoInputs[playerTwoReplayIndex].input == InputEnum.Light)
|
|
|
|
|
NetworkInput.TWO_LIGHT_INPUT = true;
|
|
|
|
|
if (replayCardData.playerTwoInputs[playerTwoReplayIndex].input == InputEnum.Medium)
|
|
|
|
|
NetworkInput.TWO_MEDIUM_INPUT = true;
|
|
|
|
|
if (replayCardData.playerTwoInputs[playerTwoReplayIndex].input == InputEnum.Heavy)
|
|
|
|
|
NetworkInput.TWO_HEAVY_INPUT = true;
|
|
|
|
|
if (replayCardData.playerTwoInputs[playerTwoReplayIndex].input == InputEnum.Assist)
|
|
|
|
|
NetworkInput.TWO_SHADOW_INPUT = true;
|
|
|
|
|
if (replayCardData.playerTwoInputs[playerTwoReplayIndex].input == InputEnum.Special)
|
|
|
|
|
NetworkInput.TWO_ARCANA_INPUT = true;
|
|
|
|
|
if (replayCardData.playerTwoInputs[playerTwoReplayIndex].input == InputEnum.ForwardDash)
|
|
|
|
|
NetworkInput.TWO_DASH_FORWARD_INPUT = true;
|
|
|
|
|
if (replayCardData.playerTwoInputs[playerTwoReplayIndex].input == InputEnum.BackDash)
|
|
|
|
|
NetworkInput.TWO_DASH_BACKWARD_INPUT = true;
|
|
|
|
|
if (replayCardData.playerTwoInputs[playerTwoReplayIndex].input == InputEnum.Throw)
|
|
|
|
|
NetworkInput.TWO_GRAB_INPUT = true;
|
|
|
|
|
if (replayCardData.playerTwoInputs[playerTwoReplayIndex].input == InputEnum.Parry)
|
|
|
|
|
NetworkInput.TWO_BLUE_FRENZY_INPUT = true;
|
|
|
|
|
if (replayCardData.playerTwoInputs[playerTwoReplayIndex].input == InputEnum.RedFrenzy)
|
|
|
|
|
NetworkInput.TWO_RED_FRENZY_INPUT = true;
|
|
|
|
|
playerTwoReplayIndex++;
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-11-13 22:31:31 +02:00
|
|
|
}
|
2022-07-17 14:36:52 +03:00
|
|
|
|
2022-09-14 23:06:52 +03:00
|
|
|
private void DeleteReplay()
|
|
|
|
|
{
|
2023-09-22 16:54:55 +03:00
|
|
|
if (_replaySO.replays.Count > 0)
|
|
|
|
|
_replaySO.replays.Remove(_replaySO.replays[0]);
|
2022-09-14 23:06:52 +03:00
|
|
|
}
|
2022-07-16 13:19:43 +03:00
|
|
|
|
2022-09-14 23:06:52 +03:00
|
|
|
public void Pause()
|
|
|
|
|
{
|
|
|
|
|
Time.timeScale = 0.0f;
|
2022-12-04 21:35:31 +02:00
|
|
|
GameplayManager.Instance.DisableAllInput();
|
|
|
|
|
GameplayManager.Instance.PauseMusic();
|
2022-09-14 23:06:52 +03:00
|
|
|
_replayPauseMenu.Show();
|
|
|
|
|
}
|
2022-07-16 13:19:43 +03:00
|
|
|
|
2022-09-14 23:06:52 +03:00
|
|
|
public void ShowReplayPrompts()
|
|
|
|
|
{
|
2023-10-26 22:42:28 +03:00
|
|
|
_replayInput.SetActive(true);
|
|
|
|
|
_replayPrompts.SetActive(true);
|
2022-09-14 23:06:52 +03:00
|
|
|
}
|
2022-07-18 13:53:09 +03:00
|
|
|
|
2022-09-14 23:06:52 +03:00
|
|
|
public void ToggleReplayInputHistory()
|
|
|
|
|
{
|
|
|
|
|
GameObject playerOneInputHistory = _playerOneInputHistory.transform.GetChild(0).gameObject;
|
|
|
|
|
GameObject playerTwoInputHistory = _playerTwoInputHistory.transform.GetChild(0).gameObject;
|
2022-07-25 18:38:24 +03:00
|
|
|
|
2022-09-14 23:06:52 +03:00
|
|
|
if (playerOneInputHistory.activeSelf)
|
|
|
|
|
{
|
|
|
|
|
playerOneInputHistory.SetActive(false);
|
|
|
|
|
playerTwoInputHistory.SetActive(false);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
playerOneInputHistory.SetActive(true);
|
|
|
|
|
playerTwoInputHistory.SetActive(true);
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-07-23 15:15:30 +03:00
|
|
|
}
|
|
|
|
|
|