// Start is called before the first frame update void Start() { //Link to UI UI_Manager_script UI_values = UI_Man.GetComponent <UI_Manager_script>(); Display_status = GetComponent <CanvasGroup>(); //Link to players Player_script Values_P1 = P1.GetComponent <Player_script>(); Player_script Values_P2 = P2.GetComponent <Player_script>(); Player_script Values_P3 = P3.GetComponent <Player_script>(); Player_script Values_P4 = P4.GetComponent <Player_script>(); //Set-up Phase 1 UnitDeployed = 0; Unit_To_Be_Deployed = Unit_script.UnitType.Default; Intel.text = ""; }
public void BT_ADD_Rifle(int a) { //player must have enough ressources: 1 Steel and 1 Devise if (PlayerToPlay.Energy_stock > -1 && PlayerToPlay.Steel_stock > 0 && PlayerToPlay.Brick_stock > -1 && PlayerToPlay.Money_stock > 0) { //=>Update information message Intel.text = "Rifle can be created, where do you want it to be deployed?"; // String répétée, à mettre dans une constante et à concaténer UI_values.Step = UI_Manager_script.StepType.Token_creation_case; Unit_To_Be_Deployed = Unit_script.UnitType.Rifle; } else { //=>Update information message Intel.text = "You don't have enough ressources to deploy a new unit."; // String répétée, à mettre dans une constante Unit_To_Be_Deployed = Unit_script.UnitType.Default; } }
public void BT_ADD_Artillery(int a) { //player must have enough ressources: 2 Steel, 1 Energy and 2 Devise if (PlayerToPlay.Energy_stock > 0 && PlayerToPlay.Steel_stock > 1 && PlayerToPlay.Brick_stock > -1 && PlayerToPlay.Money_stock > 1) { //=>Update information message Intel.text = "Artillery can be created, where do you want it to be deployed?"; UI_values.Step = UI_Manager_script.StepType.Token_creation_case; Unit_To_Be_Deployed = Unit_script.UnitType.Artillery; } else { //=>Update information message Intel.text = "You don't have enough ressources to deploy a new unit."; Unit_To_Be_Deployed = Unit_script.UnitType.Default; } }
public void Ressources_Payment(Unit_script.UnitType type) { switch (type) { case Unit_script.UnitType.Rifle: PlayerToPlay.S_stock_change(-1f); PlayerToPlay.E_stock_change(0f); PlayerToPlay.B_stock_change(0f); PlayerToPlay.M_stock_change(-1f); break; case Unit_script.UnitType.Bazooka: PlayerToPlay.S_stock_change(-1f); PlayerToPlay.E_stock_change(-1f); PlayerToPlay.B_stock_change(0f); PlayerToPlay.M_stock_change(-2f); break; case Unit_script.UnitType.Jeep: PlayerToPlay.S_stock_change(-2f); PlayerToPlay.E_stock_change(-1f); PlayerToPlay.B_stock_change(0f); PlayerToPlay.M_stock_change(-1f); break; case Unit_script.UnitType.Tank: PlayerToPlay.S_stock_change(-3f); PlayerToPlay.E_stock_change(-1f); PlayerToPlay.B_stock_change(0f); PlayerToPlay.M_stock_change(-2f); break; case Unit_script.UnitType.Artillery: PlayerToPlay.S_stock_change(-2f); PlayerToPlay.E_stock_change(-1f); PlayerToPlay.B_stock_change(0f); PlayerToPlay.M_stock_change(-2f); break; } }