Crown Placement and Start of Game

Lisez pas mes commits svp T_T
This commit is contained in:
Kirabsol 2025-01-28 12:01:04 +01:00
parent c2af70eeb4
commit e805b7eb9c
13 changed files with 4399 additions and 3688 deletions

View file

@ -6,13 +6,15 @@ public class Crown : MonoBehaviour
{
public event Action OnClicked;
private bool crowned=false;
public bool crowned=false;
[SerializeField] TextMeshProUGUI texte;
[SerializeField] private Camera _camera;
[SerializeField] private LayerMask placementLayer;
[SerializeField] private GameObject startButton;
private void Start()
{
texte.enabled = false;
@ -40,6 +42,8 @@ public class Crown : MonoBehaviour
if (Physics.Raycast(ray, out hit, 100, placementLayer))
{
OnClicked -= Crowning;
crowned = true;
startButton.SetActive(true);
return hit.transform.gameObject;
}
else

View file

@ -0,0 +1,17 @@
using UnityEngine;
public class StartGame : MonoBehaviour
{
[SerializeField] GameObject ShopUI;
[SerializeField] GameObject GameUI;
public void Starting()
{
GameManager.Instance.StartFightForAll();
GameUI.SetActive(true);
GameUI.GetComponent<GameUI>().timerActive = true;
ShopUI.SetActive(false);
}
}

View file

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 80a056dd50b538342a641ab274b8e7aa

View file

@ -7,12 +7,11 @@ using System;
public class UnitButton : MonoBehaviour
{
[SerializeField] private GameObject Mask;
[SerializeField] GameObject unitPrefab;
[SerializeField] UnitPlacement unitPlacement;
public event Action OnClicked, OnExit;
private bool clicked;
private int cost;
[SerializeField] TextMeshProUGUI texteCout;
@ -35,7 +34,6 @@ public class UnitButton : MonoBehaviour
{
Debug.Log("I'm *in");
//Mask.SetActive(true);
OnClicked += PlaceUnit;
OnExit += StopPlacing;
@ -54,7 +52,6 @@ public class UnitButton : MonoBehaviour
public void StopPlacing()
{
//Mask.SetActive(false);
OnClicked -= PlaceUnit;
OnExit -= StopPlacing;
}

View file

@ -18,7 +18,7 @@ public static class GlobalsVariable
{ "Zombie",1 },
{ "Squelette",2 },
{ "Creeper",3 },
{ "Sorcière",3 },
{ "Sorciere",3 },
{ "Golem",8 }
};

View file

@ -54,13 +54,13 @@ public class HealthHandler : MonoBehaviour
GlobalsVariable.AliveUnitsTeamB = new List<AbstractUnit>();
GlobalsVariable.AliveUnitsTeamA = new List<AbstractUnit>();
if (deathState == DeathSate.QueenADead)
if (deathState == DeathSate.QueenBDead)
{
print("get good, reload current scene");
SceneManager.LoadSceneAsync(SceneManager.GetActiveScene().name);
}
if (deathState == DeathSate.QueenBDead)
if (deathState == DeathSate.QueenADead)
{
print("GG going to next scene");
GameManager.Instance.GoNextLevel();