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;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,26 +0,0 @@
|
|||
using UnityEngine;
|
||||
|
||||
public class Transition : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private WinCanvas _winCanvas;
|
||||
[SerializeField] private LoseUI _loseUI;
|
||||
[SerializeField] private GameUI _gameUI;
|
||||
|
||||
// Update is called once per frame
|
||||
void LateUpdate()
|
||||
{
|
||||
if (GlobalsVariable.QueenA == null)
|
||||
{
|
||||
_winCanvas.gameObject.SetActive(true);
|
||||
_gameUI.gameObject.SetActive(false);
|
||||
}
|
||||
|
||||
if (Input.GetKeyDown(KeyCode.Space))
|
||||
{
|
||||
print("YOU LOSE");
|
||||
_loseUI.gameObject.SetActive(true);
|
||||
_gameUI.gameObject.SetActive(false);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -1,2 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 152b725e5ef4d734a85ca1350a98f253
|
|
@ -4,7 +4,7 @@ using UnityEngine.SceneManagement;
|
|||
|
||||
public class LoseUI : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private GameUI gameUI;
|
||||
[SerializeField] GameUI gameUI;
|
||||
|
||||
[SerializeField] TextMeshProUGUI time;
|
||||
|
||||
|
@ -14,9 +14,15 @@ public class LoseUI : MonoBehaviour
|
|||
time.text = gameUI.GetComponent<GameUI>().time.ToString();
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void Retry()
|
||||
{
|
||||
GameManager.Instance.ReloadLevel();
|
||||
SceneManager.LoadSceneAsync(SceneManager.GetActiveScene().name);
|
||||
}
|
||||
|
||||
public void MainMenu()
|
||||
|
|
|
@ -5,18 +5,16 @@ using UnityEngine.SceneManagement;
|
|||
public class WinCanvas : MonoBehaviour
|
||||
{
|
||||
[SerializeField] TextMeshProUGUI time;
|
||||
private GameUI gameUI;
|
||||
[SerializeField] GameObject gameUI;
|
||||
|
||||
void Start()
|
||||
{
|
||||
gameUI = GameObject.FindWithTag("GameUI").GetComponent<GameUI>();
|
||||
time.text = gameUI.GetComponent<GameUI>().time.ToString();
|
||||
}
|
||||
|
||||
|
||||
public void NextLevel()
|
||||
{
|
||||
GameManager.Instance.GoNextLevel();
|
||||
SceneManager.LoadSceneAsync(SceneManager.GetActiveScene().buildIndex + 1);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@ public class OffensiveBehaviour : AbstractBehaviour
|
|||
if (GlobalsVariable.QueenA == null) return;
|
||||
}
|
||||
|
||||
CurrentMinecraftUnit.MovementHandler.TargetUnit = CurrentMinecraftUnit.IsTeamA ? GlobalsVariable.QueenB : GlobalsVariable.QueenA;
|
||||
CurrentMinecraftUnit.MovementHandler.TargetUnit = GlobalsVariable.QueenB;
|
||||
Vector3 targetPos = CurrentMinecraftUnit.MovementHandler.TargetUnit.transform.position;
|
||||
Vector3 goalPos = targetPos + (transform.position - targetPos).normalized * distanceGoal;
|
||||
CurrentMinecraftUnit.MovementHandler.MoveTowards(goalPos);
|
||||
|
|
|
@ -16,8 +16,6 @@ public class MinecraftUnit : AbstractUnit
|
|||
[field: SerializeField] public BaseCapacity Capacity { get; private set; }
|
||||
// Not required
|
||||
[field: SerializeField] public Animator Animator { get; private set; }
|
||||
|
||||
public bool isActive { get; private set; }
|
||||
|
||||
|
||||
|
||||
|
@ -68,7 +66,6 @@ public class MinecraftUnit : AbstractUnit
|
|||
|
||||
public override void StartFight()
|
||||
{
|
||||
isActive = true;
|
||||
Component[] components = GetComponents<Component>();
|
||||
|
||||
foreach (Component component in components)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue