public override IEnumerator ConstructBuilding(GameObject building) { Entity buildScript = building.GetComponent <Entity>(); Debug.Log("Construct"); BattleSystem.CurrentPlayer.ChangeOre(buildScript.Cost * (-1)); BattleSystem.Player(); yield return(new WaitForSeconds(0f)); }
public override IEnumerator Start() { Debug.Log("SelectedTile State Active."); Player tileOwner = BattleSystem.SelectedTile.GetComponent <Tile>().Owner; if (tileOwner == BattleSystem.CurrentPlayer || tileOwner == null) { BattleSystem.BuildingInterface.SetActive(false); BattleSystem.TileInterface.SetTileInterface(BattleSystem.SelectedTile.gameObject); } else { BattleSystem.Player(); } yield return(new WaitForSeconds(0f)); }
public override IEnumerator Tile() { //if (BattleSystem.SelectedUnit.Tile.CanStrikeTile(BattleSystem.SelectedTile, BattleSystem.SelectedUnit.GetRange())) if (BattleSystem.SelectedUnit.tilesWithinRange.Contains(BattleSystem.SelectedTile)) { HighlightManager.UnHighlightTileList(BattleSystem.SelectedUnit.tilesWithinRange); Tile targetTile = BattleSystem.SelectedTile; targetTile.strikeParticles.Play(); if (BattleSystem.SelectedUnit.GetSplash()) { targetTile.SplashDamage(BattleSystem.SelectedUnit.GetDamage()); } else { targetTile.DistributeDamage(BattleSystem.SelectedUnit.GetDamage()); } BattleSystem.SelectedUnit.OnStrike(); } BattleSystem.Player(); yield return(new WaitForSeconds(0f)); }