This commit is contained in:
spoody 2024-02-07 21:47:09 +01:00
parent 36215ed3e9
commit 25b3be6ffe
5 changed files with 198 additions and 35 deletions

File diff suppressed because one or more lines are too long

View File

@ -976,7 +976,7 @@ GameObject:
m_Component:
- component: {fileID: 514680251}
- component: {fileID: 514680253}
- component: {fileID: 514680252}
- component: {fileID: 514680254}
m_Layer: 5
m_Name: RawImage (1)
m_TagString: Untagged
@ -1003,7 +1003,15 @@ RectTransform:
m_AnchoredPosition: {x: -390, y: -380}
m_SizeDelta: {x: 100, y: 100}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &514680252
--- !u!222 &514680253
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 514680250}
m_CullTransparentMesh: 1
--- !u!114 &514680254
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
@ -1012,7 +1020,7 @@ MonoBehaviour:
m_GameObject: {fileID: 514680250}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 1344c3c82d62a2a41a3576d8abb8e3ea, type: 3}
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
@ -1023,21 +1031,16 @@ MonoBehaviour:
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Texture: {fileID: 2800000, guid: 51dfe6d21bc5bc44482149df2da2db87, type: 3}
m_UVRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
--- !u!222 &514680253
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 514680250}
m_CullTransparentMesh: 1
m_Sprite: {fileID: 21300000, guid: 51dfe6d21bc5bc44482149df2da2db87, type: 3}
m_Type: 3
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!1 &576358554
GameObject:
m_ObjectHideFlags: 0
@ -1663,6 +1666,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 858666303fe5d464a806d086b87f5c30, type: 3}
m_Name:
m_EditorClassIdentifier:
QuitGraphic: {fileID: 514680254}
--- !u!1 &1526912310
GameObject:
m_ObjectHideFlags: 0

View File

@ -63,6 +63,7 @@ public class GameManager : MonoBehaviour
var g = who.GetComponent<HealthComponent>();
// heal
g.setMaxHealth(g.getMaxHealth(), true);
g.resetKillFlag();
// REVIVE SOUND HERE
AudioManager.PlaySound("Revive_SFX", who.transform.position);

View File

@ -33,6 +33,10 @@ public class HealthComponent : MonoBehaviour, ISquezeDamageReceiver
bool alreadyReachedZero = false;
public void resetKillFlag() {
alreadyReachedZero = false;
}
void Awake()
{
currentHealth = maxHealth;

View File

@ -1,13 +1,26 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.InputSystem;
#if UNITY_EDITOR
using UnityEditor;
#endif
public class QuitGame : MonoBehaviour
{
public Image QuitGraphic;
private float HoldTime = 0.0f;
public void Quit()
{
#if UNITY_EDITOR
UnityEditor.EditorApplication.isPlaying = false;
#else
Application.Quit();
#endif
}
private void Update()
@ -16,8 +29,20 @@ public class QuitGame : MonoBehaviour
{
if (controller.squareButton.IsPressed())
{
HoldTime += Time.deltaTime;
QuitGraphic.fillAmount = HoldTime/2f;
if (HoldTime > 2f)
Quit();
return;
}
}
// Debug.Log("C# even managed to fuck up return statements");
QuitGraphic.fillAmount = 1f;
HoldTime = 0.0f;
}
}