Browse Source

Fixed replayability + 45input error

develop
Joshua Reason 3 years ago
parent
commit
adb5ae7608
3 changed files with 10 additions and 2 deletions
  1. +1
    -1
      Assets/Scripts/Player Scripts/PlayerInputController.cs
  2. +8
    -1
      Assets/Scripts/Player Scripts/PlayerManager.cs
  3. +1
    -0
      Assets/Scripts/UI/CreditScreen/CreditUIController.cs

+ 1
- 1
Assets/Scripts/Player Scripts/PlayerInputController.cs View File

@ -50,7 +50,7 @@ public class PlayerInputController : InputBehaviour
private void OnMovement(InputAction.CallbackContext value) private void OnMovement(InputAction.CallbackContext value)
{ {
Vector2 m_recievedInput = value.ReadValue<Vector2>(); Vector2 m_recievedInput = value.ReadValue<Vector2>();
m_desiredDirection = new Vector3(m_recievedInput.x, 0.0f, m_recievedInput.y);
m_desiredDirection = Quaternion.Euler(0.0f,Camera.main.transform.rotation.eulerAngles.y,0.0f) * new Vector3(m_recievedInput.x, 0.0f, m_recievedInput.y);
} }

+ 8
- 1
Assets/Scripts/Player Scripts/PlayerManager.cs View File

@ -34,7 +34,6 @@ public class PlayerManager : MonoBehaviour
newPlayer.transform.SetParent(transform, false); newPlayer.transform.SetParent(transform, false);
} }
public void AllowJoin(bool value) public void AllowJoin(bool value)
{ {
if (value) if (value)
@ -55,7 +54,15 @@ public class PlayerManager : MonoBehaviour
{ {
Destroy(gameObject); Destroy(gameObject);
} }
}
public static void Clear()
{
if (Instance != null)
{
Instance.m_connectedPlayers.Players.Clear();
Destroy(Instance.gameObject);
}
} }
} }

+ 1
- 0
Assets/Scripts/UI/CreditScreen/CreditUIController.cs View File

@ -120,6 +120,7 @@ public class CreditUIController : MonoBehaviour
public void OnMenuClick() public void OnMenuClick()
{ {
PlayerManager.Clear();
UnityEngine.SceneManagement.SceneManager.LoadScene(m_MainMenuScene); UnityEngine.SceneManagement.SceneManager.LoadScene(m_MainMenuScene);
} }

Loading…
Cancel
Save