timer death

This commit is contained in:
cemt1363
2026-06-07 09:54:33 +02:00
parent fefe7ea97a
commit be72837ff0
6 changed files with 27 additions and 15 deletions
+8 -2
View File
@@ -119,6 +119,11 @@ NavMeshSettings:
debug:
m_Flags: 0
m_NavMeshData: {fileID: 0}
--- !u!1 &118794739 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 2141180002423843430, guid: d56297e435f8410a584581d73d99d2e4, type: 3}
m_PrefabInstance: {fileID: 1445156949}
m_PrefabAsset: {fileID: 0}
--- !u!1 &505713147
GameObject:
m_ObjectHideFlags: 0
@@ -1824,8 +1829,9 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier: Assembly-CSharp::Timer
timeText: {fileID: 2009337314}
timeRemaining: 89
targetObject: {fileID: 0}
timeRemaining: 10
targetObject: {fileID: 118794739}
damageHandler: {fileID: 0}
--- !u!114 &2112957321
MonoBehaviour:
m_ObjectHideFlags: 0
+2 -2
View File
@@ -552,8 +552,8 @@ Transform:
m_GameObject: {fileID: 596651170}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_LocalPosition: {x: -0.0115, y: -0.023, z: 0}
m_LocalScale: {x: 0.9196271, y: 0.9231282, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
+3 -3
View File
@@ -517,7 +517,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
m_IsActive: 1
--- !u!212 &1431685197
SpriteRenderer:
serializedVersion: 2
@@ -586,8 +586,8 @@ Transform:
m_GameObject: {fileID: 1431685196}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_LocalPosition: {x: -0.0115, y: -0.0346, z: 0}
m_LocalScale: {x: 0.9219821, y: 0.9252364, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
+4 -2
View File
@@ -154,8 +154,10 @@ public class DamageHandler : MonoBehaviour
{
Debug.Log("Fell too much");
SceneManager.LoadScene(3, LoadSceneMode.Single);
} else if (reason == "Timer")
{
SceneManager.LoadScene(3,LoadSceneMode.Single);
}
Destroy(gameObject);
}
}
}
-2
View File
@@ -12,8 +12,6 @@ public class DropletMovement : MonoBehaviour
private bool isGrounded = false;
private float facingDirection = 1f;
private bool isDropping = false;
private float fallTimer;
private bool isFalling;
public float maxFallTime = 0.5f;
// movement
+8 -2
View File
@@ -11,6 +11,12 @@ public class Timer : MonoBehaviour
private bool timerIsRunning = false;
public GameObject targetObject;
public DamageHandler damageHandler;
private void Start()
{
damageHandler = targetObject.GetComponent<DamageHandler>();
}
void Update()
{
@@ -51,8 +57,8 @@ public class Timer : MonoBehaviour
if (timeRemaining <= 0)
{
SceneManager.LoadScene(4, LoadSceneMode.Single);
Destroy(targetObject);
//SceneManager.LoadScene(3, LoadSceneMode.Single);
damageHandler.Die("Timer");
}
}