Rework of UI + gamemanager instance

This commit is contained in:
BOT Alex 2024-04-20 22:05:01 +02:00
parent 60ca297352
commit a0f3b673bb
5 changed files with 252 additions and 2185 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 8f7ebe912ef903c458266e5259f4eec7
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,15 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class GameManager : MonoBehaviour
{
public static GameManager Instance;
private void Start()
{
if (Instance != this)
Destroy(Instance);
Instance = this;
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 00e1f7ea5be7c564faf42d035aec7f53
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -12,7 +12,7 @@ public class TowerPlacementManager : MonoBehaviour
/// Sender
/// </summary>
public static event Action<TowerPlacementManager> OnSpawnGridRequested;
public static TowerPlacementManager Singleton;
public static TowerPlacementManager Instance;
// Section: Mouse
private SlotManager CurrentSelectedSlot;
@ -29,9 +29,9 @@ public class TowerPlacementManager : MonoBehaviour
private void Start()
{
if (Singleton != this)
Destroy(Singleton);
Singleton = this;
if (Instance != this)
Destroy(Instance);
Instance = this;
OnSpawnGridRequested?.Invoke(this);
}