create main menu
This commit is contained in:
@@ -8,6 +8,16 @@ using DG.Tweening;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
public enum Location
|
||||
{
|
||||
Pechatniki,
|
||||
Sherbinka,
|
||||
BulevardSlavyanski,
|
||||
Solnechaya,
|
||||
Shukenskaya,
|
||||
AprelevkaDepo
|
||||
}
|
||||
|
||||
public class GameSystem : MonoBehaviour
|
||||
{
|
||||
public static GameSystem Instance { get; private set; }
|
||||
@@ -18,6 +28,15 @@ public class GameSystem : MonoBehaviour
|
||||
|
||||
public event Action OnSceneLoaded;
|
||||
|
||||
public Dictionary<string, string> locationsName { get; private set; } = new()
|
||||
{
|
||||
{"StationPechatnici", "Станция Печатники"},
|
||||
{"", "Станция Щербинка"},
|
||||
{"", "Станция Славянский бульвар"},
|
||||
{"StationSolnechnaya", "Станция Солнечная"},
|
||||
{"StationShchukinskaya", "Станция Щукенская"},
|
||||
{"", "Депо Апрелевка"}
|
||||
};
|
||||
|
||||
public void LoadScene(string sceneName)
|
||||
{
|
||||
@@ -37,7 +56,6 @@ public class GameSystem : MonoBehaviour
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public void AddGameComponent(IGameComponent component)
|
||||
{
|
||||
if(!gameComponents.Contains(component))
|
||||
@@ -67,20 +85,20 @@ public class GameSystem : MonoBehaviour
|
||||
|
||||
void Update()
|
||||
{
|
||||
Parallel.ForEach(gameComponents,
|
||||
component => component.OnUpdate());
|
||||
for(int i = 0; i < gameComponents.Count; i++)
|
||||
gameComponents[i].OnUpdate();
|
||||
}
|
||||
|
||||
void FixedUpdate()
|
||||
{
|
||||
Parallel.ForEach(gameComponents,
|
||||
component => component.OnFixedUpdate());
|
||||
for(int i = 0; i < gameComponents.Count; i++)
|
||||
gameComponents[i].OnFixedUpdate();
|
||||
}
|
||||
|
||||
void LateUpdate()
|
||||
{
|
||||
Parallel.ForEach(gameComponents,
|
||||
component => component.OnLateUpdate());
|
||||
for(int i = 0; i < gameComponents.Count; i++)
|
||||
gameComponents[i].OnLateUpdate();
|
||||
}
|
||||
|
||||
public void RemoveGameComponent(IGameComponent component)
|
||||
|
||||
Reference in New Issue
Block a user