Compare commits

...

2 Commits

Author SHA1 Message Date
SpoodyTheOne 3ac2466bd4 Merge remote-tracking branch 'origin/main' 2024-02-04 10:31:56 +01:00
SpoodyTheOne f4db945309 nig 2024-02-04 10:31:50 +01:00
4 changed files with 55 additions and 15 deletions

View File

@ -372,6 +372,7 @@ GameObject:
- component: {fileID: 1111096819}
- component: {fileID: 1111096818}
- component: {fileID: 1111096817}
- component: {fileID: 1111096820}
m_Layer: 5
m_Name: Returnbtn
m_TagString: Untagged
@ -442,7 +443,20 @@ MonoBehaviour:
m_TargetGraphic: {fileID: 1111096818}
m_OnClick:
m_PersistentCalls:
m_Calls: []
m_Calls:
- m_Target: {fileID: 1111096820}
m_TargetAssemblyTypeName: GameOverMainMenuReturnerButtonScriptForLoadingTheMainMenuSceneOnceAPlayerHasDiedAndHasThenPressedTheMainMenuButtonOnTheGameOverScreen,
Assembly-CSharp
m_MethodName: r
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
--- !u!114 &1111096818
MonoBehaviour:
m_ObjectHideFlags: 0
@ -481,6 +495,18 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1111096815}
m_CullTransparentMesh: 1
--- !u!114 &1111096820
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1111096815}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: ebc1ff2ca6301ea418d24447257776ae, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &1464315473
GameObject:
m_ObjectHideFlags: 0

View File

@ -5,15 +5,7 @@ using UnityEngine.SceneManagement;
public class GameOverMainMenuReturnerButtonScriptForLoadingTheMainMenuSceneOnceAPlayerHasDiedAndHasThenPressedTheMainMenuButtonOnTheGameOverScreen : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
public void r() {
SceneManager.LoadScene(0);
}
}

View File

@ -3,6 +3,7 @@ using System.Collections.Generic;
using System;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.SceneManagement;
public class GameManager : MonoBehaviour
{
@ -12,12 +13,15 @@ public class GameManager : MonoBehaviour
private string penisSuriveTime = "";
public int Revives { get; private set; }
void Awake()
{
if (Instance == null)
{
Instance = this;
DontDestroyOnLoad(gameObject);
Revives = 0;
}
else
{
@ -29,12 +33,30 @@ public class GameManager : MonoBehaviour
{
}
public void playerDied(int who)
public void playerDied(GameObject who)
{
Debug.Break();
if (Revives == 0)
SceneManager.LoadScene(3);
else {
Revives--;
Collider2D[] d = Physics2D.OverlapCircleAll(who.transform.position, 5f);
foreach (Collider2D c in d) {
if (c.gameObject.CompareTag("Enemy")) {
c.gameObject.GetComponent<HealthComponent>().TakeDamage(9999999999);
}
}
var g = who.GetComponent<HealthComponent>();
// heal
g.setMaxHealth(g.getMaxHealth(), true);
// REVIVE SOUND HERE
}
}
public void setTime(string t) {
public void setTime(string t)
{
penisSuriveTime = t;
}

View File

@ -14,7 +14,6 @@ public class PlayerMovement : MonoBehaviour
private bool right = false;
[Header("Whipping")]
[SerializeField]
RopeWhipAttack whipAttack;
@ -37,6 +36,7 @@ public class PlayerMovement : MonoBehaviour
rb = GetComponent<Rigidbody2D>();
playerInput = GetComponent<PlayerInput>();
hp = GetComponent<HealthComponent>();
attack = GetComponent<PlayerCollideAttack>();
if (gameObject.name == "Player2")
{