// Use this for initialization void Start() { InvokeRepeating("Update_Target", 0f, .07f); tirerScript = GetComponent <Tirer>(); unitStats = GetComponent <Unit_Stats>(); activation = GetComponent <TurretActivation>(); }
public void nextTurn() { if (index < 3) { Unit_Stats currentUnit = unitStats[index]; if (!currentUnit.isDead()) { if (currentUnit.Side == 0) { Debug.Log("Player Turn"); ChangeState(new Select_Command_State(this)); } else { //ChangeState(new Enemy_Turn_State(this)); ChangeState(new End_Turn_State(this)); Debug.Log("Enemy Turn"); } } } else { index = 0; } }
void Start() { //Claim Tile FindTileBeneath().status = unitOwner; GameBoard.singleton.tiles[FindTileBeneath().index].status = unitOwner; myStats = myUnit.unitStats; }
// Use this for initialization void Start() { ToggleLights(true); listOfPathsToLookAt = GameObject.FindGameObjectWithTag("Paths").transform; nodesAffectedBySpotLight = new List <Node>(); unitStats = GetComponent <Unit_Stats>(); ActivateNearbyNodes(); SeekNewTarget(); }
private void Set_Icons_For_All_Buttons() { foreach (TurretBlueprint turret in availableTurrets) { Unit_Stats unitStats = turret.turret.gameObject.GetComponent <Unit_Stats>(); if (!unitStats.CanHitFlyingEnemies) { turret.associatedButton.transform.GetChild(3).Find("Wing Icon".Trim()).GetComponent <Image>().color = colorTurretAttributeDisabled; } if (!unitStats.CanUseAOE) { turret.associatedButton.transform.GetChild(3).Find("AOE Icon".Trim()).GetComponent <Image>().color = colorTurretAttributeDisabled; } if (!unitStats.CanSlowDownEnemies) { turret.associatedButton.transform.GetChild(3).Find("Slow Icon".Trim()).GetComponent <Image>().color = colorTurretAttributeDisabled; } } foreach (TurretBlueprint building in availableBuildings) { Unit_Stats unitStats = building.turret.gameObject.GetComponent <Unit_Stats>(); if (!unitStats.isGenerator) { building.associatedButton.transform.GetChild(3).Find("Generator Icon".Trim()).GetComponent <Image>().color = colorTurretAttributeDisabled; } if (!unitStats.isSpotlight) { building.associatedButton.transform.GetChild(3).Find("Spotlight Icon".Trim()).GetComponent <Image>().color = colorTurretAttributeDisabled; } if (!unitStats.isTargetForEnemies) { building.associatedButton.transform.GetChild(3).Find("Target Icon".Trim()).GetComponent <Image>().color = colorTurretAttributeDisabled; } } }
// Use this for initialization void Start() { nodesAffectedByGenerator = new List <Node>(); unitStats = GetComponent <Unit_Stats>(); ActivateNearbyNodes(); }
// Use this for initialization void Start() { ia = GetComponent <TurretIA>(); unitStats = GetComponent <Unit_Stats>(); activation = GetComponent <TurretActivation>(); }