i3e-asg2/Assets/Scripts/GameManager.cs

23 lines
460 B
C#
Raw Normal View History

2024-06-24 21:26:41 +08:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class GameManager : MonoBehaviour
{
public static GameManager instance;
void Awake()
{
if (instance == null)
{
instance = this;
DontDestroyOnLoad(gameObject);
}
else if (instance != null && instance != this)
{
Destroy(gameObject);
}
}
2024-07-01 11:11:10 +08:00
public int playerHealth = 100;
2024-06-24 21:26:41 +08:00
}