| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- using cfg;
- using SimpleJSON;
- using System.Collections;
- using System.Collections.Generic;
- using System.IO;
- using UnityEngine;
- using TMPro;
- public class GameManager : MonoBehaviour
- {
- public static GameManager instance;
- public float gameTime;
- public Tables allCfgData;
- public UIHP p1uiHP;
- public UIHP p1uiMP;
- public GameObject[] demonicNum;
- public TextMeshProUGUI text;
- private JSONNode Loader(string fileName)
- {
- return JSON.Parse(File.ReadAllText("GenerateDatas/json/" + fileName + ".json"));
- }
- public void GetAllExcel()
- {
- allCfgData = new Tables(Loader);
- }
- private void Awake()
- {
- if (!instance)
- {
- instance = this;
- GetAllExcel();
- }
- else
- {
- DestroyImmediate(gameObject);
- return;
- }
- }
- private void Start()
- {
- gameTime = 0;
- }
- private void FixedUpdate()
- {
- gameTime += Time.deltaTime;
- EnemyCreater.instance.OnGameTimeChange(gameTime);
- int timeText = (int)gameTime;
- text.text = $"{timeText / 60:D2}:{timeText % 60:D2}({timeText}s)";
- }
- }
|