Revert "Merge branch 'Integration'"
This reverts commit0727e44b80
, reversing changes made to1fb3c9bfbe
.
This commit is contained in:
parent
0727e44b80
commit
97b9d94930
103 changed files with 780 additions and 10299 deletions
|
@ -9,24 +9,28 @@ public class GameManager : MonoBehaviourSingletonPersistent<GameManager>
|
|||
[SerializeField] private List<string> levelNames;
|
||||
[SerializeField] private List<string> levelMusics;
|
||||
[SerializeField] private List<int> levelsMoney;
|
||||
int current_level = 0;
|
||||
int current_level = -1;
|
||||
|
||||
GameObject _gameUI;
|
||||
GameObject _loseUI;
|
||||
GameObject _winUI;
|
||||
|
||||
// for compativility with other team
|
||||
public bool fightStarted = false;
|
||||
[SerializeField] GameObject GameUI;
|
||||
[SerializeField] GameObject LoseUI;
|
||||
[SerializeField] GameObject WinUI;
|
||||
|
||||
private void Update()
|
||||
|
||||
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
||||
void Start()
|
||||
{
|
||||
if (Input.GetKeyDown(KeyCode.Space))
|
||||
{
|
||||
GoNextLevel();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
// Delete, use only for Debug
|
||||
if (Input.GetKeyDown(KeyCode.Space))
|
||||
{
|
||||
StartFightForAll();
|
||||
}
|
||||
}
|
||||
|
||||
public void StartFightForAll()
|
||||
{
|
||||
AbstractUnit[] units = FindObjectsByType<AbstractUnit>(FindObjectsSortMode.None);
|
||||
|
@ -34,7 +38,6 @@ public class GameManager : MonoBehaviourSingletonPersistent<GameManager>
|
|||
{
|
||||
unit.StartFight();
|
||||
}
|
||||
fightStarted = true;
|
||||
}
|
||||
|
||||
private void SetGlobals(int current_level)
|
||||
|
@ -44,8 +47,6 @@ public class GameManager : MonoBehaviourSingletonPersistent<GameManager>
|
|||
GlobalsVariable.QueenA = null;
|
||||
GlobalsVariable.QueenB = null;
|
||||
GlobalsVariable.money = levelsMoney[current_level];
|
||||
fightStarted = false;
|
||||
|
||||
}
|
||||
|
||||
public void ReloadLevel()
|
||||
|
@ -57,19 +58,23 @@ public class GameManager : MonoBehaviourSingletonPersistent<GameManager>
|
|||
|
||||
public void GoNextLevel()
|
||||
{
|
||||
if (current_level <= levelNames.Count)
|
||||
if (current_level < levelNames.Count)
|
||||
{
|
||||
current_level++;
|
||||
}
|
||||
else
|
||||
{
|
||||
current_level = 0;
|
||||
SetGlobals(current_level);
|
||||
SceneManager.LoadScene(levelNames[current_level]);
|
||||
SoundManager.Instance.PlayMusic(levelMusics[current_level]);
|
||||
}
|
||||
|
||||
SetGlobals(current_level);
|
||||
SceneManager.LoadScene(levelNames[current_level]);
|
||||
SoundManager.Instance.PlayMusic(levelMusics[current_level]);
|
||||
throw new Exception("Bro there is no next level like stop pls");
|
||||
|
||||
}
|
||||
|
||||
public void Losing()
|
||||
{
|
||||
|
||||
LoseUI.SetActive(true);
|
||||
this.enabled = false;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue