create main menu

This commit is contained in:
2022-11-12 15:15:01 +05:00
parent b9e9cb72fe
commit a488ab8f99
82 changed files with 7068 additions and 989 deletions
+25 -7
View File
@@ -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)