/// <summary> /// Arrete le choix d'unité /// </summary> void StopEventModeUnit() { _titleValidation = ""; _descriptionValidation = ""; _numberOfUnitToChoose = 0; _chooseUnitForEvent = false; _redPlayerUseEvent = false; IllusionStratégique = false; _canSelectMultiples = false; _eventCall = null; foreach (GameObject gam in _selectableUnit) { //Détruit l'enfant avec le tag selectable tile GameObject tile = TilesManager.Instance.TileList[gam.GetComponent <UnitScript>().ActualTiledId]; if (tile != null) { tile.GetComponent <TileScript>().ActiveChildObj(MYthsAndSteel_Enum.ChildTileType.EventSelect, _normalEventSprite); tile.GetComponent <TileScript>().DesActiveChildObj(MYthsAndSteel_Enum.ChildTileType.EventSelect); } } _selectableUnit.Clear(); }
/// <summary> /// Aller à la phase de jeu renseigner en paramètre /// </summary> /// <param name="phaseToGoTo"></param> public void ChangePhase() { //Affiche le panneau de transition d'UI _isInTurn = false; _eventCall = null; _eventCallCancel = null; OnclickedEvent(); }
/// <summary> /// Commence le mode event pour choisir une case du plateau /// </summary> /// <param name="numberOfTile"></param> /// <param name="redPlayer"></param> /// <param name="_tileSelectable"></param> public void StartEventModeTiles(int numberOfTile, bool redPlayer, List <GameObject> _tileSelectable, string title, string description, bool multiplesTile = false) { UIInstance.Instance.DesactivateNextPhaseButton(); _titleValidation = title; _descriptionValidation = description; _chooseTileForEvent = true; _redPlayerUseEvent = redPlayer; _numberOfTilesToChoose = numberOfTile; _selectableTiles.AddRange(_tileSelectable); _canSelectMultiples = multiplesTile; foreach (GameObject gam in _selectableTiles) { gam.GetComponent <TileScript>().ActiveChildObj(MYthsAndSteel_Enum.ChildTileType.EventSelect); } _eventCall += StopEventModeTile; }
/// <summary> /// Commence le mode event pour choisir une unité /// </summary> /// <param name="numberUnit"></param> /// <param name="opponentUnit"></param> /// <param name="armyUnit"></param> public void StartEventModeUnit(int numberUnit, bool redPlayer, List <GameObject> _unitSelectable, string title, string description, bool multiplesUnit = false) { UIInstance.Instance.DesactivateNextPhaseButton(); Debug.Log("Set Event param"); _titleValidation = title; _descriptionValidation = description; _numberOfUnitToChoose = numberUnit; _chooseUnitForEvent = true; _selectableUnit.AddRange(_unitSelectable); _redPlayerUseEvent = redPlayer; _canSelectMultiples = multiplesUnit; foreach (GameObject gam in _selectableUnit) { TilesManager.Instance.TileList[gam.GetComponent <UnitScript>().ActualTiledId].GetComponent <TileScript>().ActiveChildObj(MYthsAndSteel_Enum.ChildTileType.EventSelect); Debug.Log("Show EventSelect" + gam); } _eventCall += StopEventModeUnit; }
/// <summary> /// Arrete le choix de case /// </summary> void StopEventModeTile() { _titleValidation = ""; _descriptionValidation = ""; _numberOfTilesToChoose = 0; _chooseTileForEvent = false; _redPlayerUseEvent = false; IllusionStratégique = false; _canSelectMultiples = false; _eventCall = null; foreach (GameObject gam in _selectableTiles) { gam.GetComponent <TileScript>().ActiveChildObj(MYthsAndSteel_Enum.ChildTileType.EventSelect, _normalEventSprite); gam.GetComponent <TileScript>().DesActiveChildObj(MYthsAndSteel_Enum.ChildTileType.EventSelect); } _selectableTiles.Clear(); }
/// <summary> /// Quand le joueur annule le fait de passer une phase /// </summary> void CancelSkipPhase() { _eventCall = null; _eventCallCancel = null; UIInstance.Instance.ActivateNextPhaseButton(); }
/// <summary> /// Quand le joueur clic pour passer à la phase suivante /// </summary> public void CliCToChangePhase() { UIInstance.Instance.ShowValidationPanel("Passer à la phase suivante", "Êtes-vous sur de vouloir passer à la phase suivante? En passant la phase vous n'aurez pas la possibilité de revenir en arrière."); _eventCall += ChangePhase; _eventCallCancel += CancelSkipPhase; }