Rework of UI + gamemanager instance
This commit is contained in:
parent
60ca297352
commit
a0f3b673bb
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,8 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 8f7ebe912ef903c458266e5259f4eec7
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
|
@ -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;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,11 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 00e1f7ea5be7c564faf42d035aec7f53
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
|
@ -12,7 +12,7 @@ public class TowerPlacementManager : MonoBehaviour
|
||||||
/// Sender
|
/// Sender
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static event Action<TowerPlacementManager> OnSpawnGridRequested;
|
public static event Action<TowerPlacementManager> OnSpawnGridRequested;
|
||||||
public static TowerPlacementManager Singleton;
|
public static TowerPlacementManager Instance;
|
||||||
|
|
||||||
// Section: Mouse
|
// Section: Mouse
|
||||||
private SlotManager CurrentSelectedSlot;
|
private SlotManager CurrentSelectedSlot;
|
||||||
|
@ -29,9 +29,9 @@ public class TowerPlacementManager : MonoBehaviour
|
||||||
|
|
||||||
private void Start()
|
private void Start()
|
||||||
{
|
{
|
||||||
if (Singleton != this)
|
if (Instance != this)
|
||||||
Destroy(Singleton);
|
Destroy(Instance);
|
||||||
Singleton = this;
|
Instance = this;
|
||||||
|
|
||||||
OnSpawnGridRequested?.Invoke(this);
|
OnSpawnGridRequested?.Invoke(this);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue