CODE
This commit is contained in:
parent
36215ed3e9
commit
25b3be6ffe
File diff suppressed because one or more lines are too long
|
@ -976,7 +976,7 @@ GameObject:
|
||||||
m_Component:
|
m_Component:
|
||||||
- component: {fileID: 514680251}
|
- component: {fileID: 514680251}
|
||||||
- component: {fileID: 514680253}
|
- component: {fileID: 514680253}
|
||||||
- component: {fileID: 514680252}
|
- component: {fileID: 514680254}
|
||||||
m_Layer: 5
|
m_Layer: 5
|
||||||
m_Name: RawImage (1)
|
m_Name: RawImage (1)
|
||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
|
@ -1003,7 +1003,15 @@ RectTransform:
|
||||||
m_AnchoredPosition: {x: -390, y: -380}
|
m_AnchoredPosition: {x: -390, y: -380}
|
||||||
m_SizeDelta: {x: 100, y: 100}
|
m_SizeDelta: {x: 100, y: 100}
|
||||||
m_Pivot: {x: 0.5, y: 0.5}
|
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:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
@ -1012,7 +1020,7 @@ MonoBehaviour:
|
||||||
m_GameObject: {fileID: 514680250}
|
m_GameObject: {fileID: 514680250}
|
||||||
m_Enabled: 1
|
m_Enabled: 1
|
||||||
m_EditorHideFlags: 0
|
m_EditorHideFlags: 0
|
||||||
m_Script: {fileID: 11500000, guid: 1344c3c82d62a2a41a3576d8abb8e3ea, type: 3}
|
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
m_Material: {fileID: 0}
|
m_Material: {fileID: 0}
|
||||||
|
@ -1023,21 +1031,16 @@ MonoBehaviour:
|
||||||
m_OnCullStateChanged:
|
m_OnCullStateChanged:
|
||||||
m_PersistentCalls:
|
m_PersistentCalls:
|
||||||
m_Calls: []
|
m_Calls: []
|
||||||
m_Texture: {fileID: 2800000, guid: 51dfe6d21bc5bc44482149df2da2db87, type: 3}
|
m_Sprite: {fileID: 21300000, guid: 51dfe6d21bc5bc44482149df2da2db87, type: 3}
|
||||||
m_UVRect:
|
m_Type: 3
|
||||||
serializedVersion: 2
|
m_PreserveAspect: 0
|
||||||
x: 0
|
m_FillCenter: 1
|
||||||
y: 0
|
m_FillMethod: 4
|
||||||
width: 1
|
m_FillAmount: 1
|
||||||
height: 1
|
m_FillClockwise: 1
|
||||||
--- !u!222 &514680253
|
m_FillOrigin: 0
|
||||||
CanvasRenderer:
|
m_UseSpriteMesh: 0
|
||||||
m_ObjectHideFlags: 0
|
m_PixelsPerUnitMultiplier: 1
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 514680250}
|
|
||||||
m_CullTransparentMesh: 1
|
|
||||||
--- !u!1 &576358554
|
--- !u!1 &576358554
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
@ -1663,6 +1666,7 @@ MonoBehaviour:
|
||||||
m_Script: {fileID: 11500000, guid: 858666303fe5d464a806d086b87f5c30, type: 3}
|
m_Script: {fileID: 11500000, guid: 858666303fe5d464a806d086b87f5c30, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
|
QuitGraphic: {fileID: 514680254}
|
||||||
--- !u!1 &1526912310
|
--- !u!1 &1526912310
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
|
@ -63,6 +63,7 @@ public class GameManager : MonoBehaviour
|
||||||
var g = who.GetComponent<HealthComponent>();
|
var g = who.GetComponent<HealthComponent>();
|
||||||
// heal
|
// heal
|
||||||
g.setMaxHealth(g.getMaxHealth(), true);
|
g.setMaxHealth(g.getMaxHealth(), true);
|
||||||
|
g.resetKillFlag();
|
||||||
|
|
||||||
// REVIVE SOUND HERE
|
// REVIVE SOUND HERE
|
||||||
AudioManager.PlaySound("Revive_SFX", who.transform.position);
|
AudioManager.PlaySound("Revive_SFX", who.transform.position);
|
||||||
|
|
|
@ -33,6 +33,10 @@ public class HealthComponent : MonoBehaviour, ISquezeDamageReceiver
|
||||||
|
|
||||||
bool alreadyReachedZero = false;
|
bool alreadyReachedZero = false;
|
||||||
|
|
||||||
|
public void resetKillFlag() {
|
||||||
|
alreadyReachedZero = false;
|
||||||
|
}
|
||||||
|
|
||||||
void Awake()
|
void Awake()
|
||||||
{
|
{
|
||||||
currentHealth = maxHealth;
|
currentHealth = maxHealth;
|
||||||
|
|
|
@ -1,13 +1,26 @@
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
using UnityEngine.UI;
|
||||||
using UnityEngine.InputSystem;
|
using UnityEngine.InputSystem;
|
||||||
|
|
||||||
|
#if UNITY_EDITOR
|
||||||
|
using UnityEditor;
|
||||||
|
#endif
|
||||||
|
|
||||||
public class QuitGame : MonoBehaviour
|
public class QuitGame : MonoBehaviour
|
||||||
{
|
{
|
||||||
|
public Image QuitGraphic;
|
||||||
|
|
||||||
|
private float HoldTime = 0.0f;
|
||||||
|
|
||||||
public void Quit()
|
public void Quit()
|
||||||
{
|
{
|
||||||
Application.Quit();
|
#if UNITY_EDITOR
|
||||||
|
UnityEditor.EditorApplication.isPlaying = false;
|
||||||
|
#else
|
||||||
|
Application.Quit();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Update()
|
private void Update()
|
||||||
|
@ -16,8 +29,20 @@ public class QuitGame : MonoBehaviour
|
||||||
{
|
{
|
||||||
if (controller.squareButton.IsPressed())
|
if (controller.squareButton.IsPressed())
|
||||||
{
|
{
|
||||||
Quit();
|
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue