Fixed stuff
This commit is contained in:
@@ -9,34 +9,45 @@ namespace InterfaceOff.WorldScene
|
||||
{
|
||||
[SerializeField] private GameObject HurtOverlay;
|
||||
[SerializeField] private Slider SliderThing;
|
||||
[SerializeField] private WindowSpawner Spawner;
|
||||
|
||||
[field: SerializeField] public int HitsTaken { get; private set; }
|
||||
|
||||
private Rigidbody body;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
body = GetComponent<Rigidbody>();
|
||||
|
||||
Vector3 pos = transform.localPosition;
|
||||
pos.y = Mathf.Infinity;
|
||||
transform.localPosition = pos;
|
||||
}
|
||||
|
||||
void LateUpdate()
|
||||
{
|
||||
Vector3 pos = transform.localPosition;
|
||||
pos.y = Mathf.Clamp(pos.y, 0, 10);
|
||||
|
||||
if (Mathf.Approximately(pos.y, 0.0f))
|
||||
if (Spawner.AutoSpawn)
|
||||
{
|
||||
StartCoroutine(routine: DisplayHurtOverlay());
|
||||
|
||||
body.velocity = Vector3.zero;
|
||||
pos.y = 10.0f;
|
||||
}
|
||||
Vector3 pos = transform.localPosition;
|
||||
pos.y = Mathf.Clamp(pos.y, 0, 10);
|
||||
|
||||
if (Mathf.Approximately(pos.y, 10.0f))
|
||||
{
|
||||
body.velocity = Vector3.zero;
|
||||
}
|
||||
if (Mathf.Approximately(pos.y, 0.0f))
|
||||
{
|
||||
StartCoroutine(routine: DisplayHurtOverlay());
|
||||
HitsTaken++;
|
||||
|
||||
transform.localPosition = pos;
|
||||
SliderThing.value = pos.y;
|
||||
body.velocity = Vector3.zero;
|
||||
pos.y = 10.0f;
|
||||
}
|
||||
|
||||
if (Mathf.Approximately(pos.y, 10.0f))
|
||||
{
|
||||
body.velocity = Vector3.zero;
|
||||
}
|
||||
|
||||
transform.localPosition = pos;
|
||||
SliderThing.value = pos.y;
|
||||
}
|
||||
}
|
||||
|
||||
[UsedImplicitly] public void AddForceUp()
|
||||
|
||||
@@ -130,12 +130,12 @@ namespace InterfaceOff
|
||||
PasswordField.SetActive(false);
|
||||
|
||||
/* Else checks if it should change the active scene */
|
||||
if (Input.GetKey(KeyCode.Space) && LeaderboardObject.activeSelf)
|
||||
if (Input.GetKey(KeyCode.Space) && !LeaderboardObject.activeSelf)
|
||||
{
|
||||
SceneController.ReloadScene();
|
||||
}
|
||||
|
||||
else if (Input.GetKey(KeyCode.Tab) && LeaderboardObject.activeSelf)
|
||||
else if (Input.GetKey(KeyCode.Tab) && !LeaderboardObject.activeSelf)
|
||||
{
|
||||
SceneController.Load(name: "MenuScene");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user