public void DeselectEchelon() { if (selectedEchelon != null) { if (selectedEchelon as HOCBehavior != null) { UnhighlightNodes(); } selectedEchelon.GetComponent <Image>().color = Color.white; selectedEchelon = null; SelectedEchelonDescription.text = ""; } }
private IEnumerator InputEnemyAttributes(EchelonBehavior behavior) { enemyCreatorHolder.SetActive(true); creatingNewEnemy = false; while (!creatingNewEnemy) { yield return(new WaitForEndOfFrame()); } if (enemyCreator.GetEnemyID().Length > 0) { behavior.SetID(int.Parse(enemyCreator.GetEnemyID())); } behavior.SetFaction(enemyCreator.GetEnemyFaction()); behavior.GetComponent <Image>().sprite = enemyCreator.GetChosenSprite(); enemyCreator.ResetInputField(); enemyCreatorHolder.SetActive(false); }
public void SelectEchelon(EchelonBehavior echelon) { if (!MoveEcheToNode(echelon.GetNode())) { DeselectEchelon(); selectedEchelon = echelon; selectedEchelon.GetComponent <Image>().color = Color.yellow; SelectedEchelonDescription.text = "Echelon: " + echelon.GetID() + "\nFaction: " + echelon.GetFaction(); if (selectedEchelon.GetFaction() == Faction.Blue && !NPCs.Contains(selectedEchelon)) { SelectedEchelonDescription.text += "\nSupply: " + echelon.GetSupply().x + " / " + echelon.GetSupply().y; } if (selectedEchelon.GetName().Length > 0) { SelectedEchelonDescription.text = SelectedEchelonDescription.text.Insert(0, "Name: " + selectedEchelon.GetName() + "\n"); } ParachuteBehavior para = echelon as ParachuteBehavior; if (para != null) { SelectedEchelonDescription.text += "\nParachute CD: " + para.GetCooldown(); } else { HOCBehavior HOC = echelon as HOCBehavior; if (HOC != null) { SelectedEchelonDescription.text += "\nRange: " + HOC.GetRange(); nodesInSelectedHOCRange = HOC.GetAllNodesInRange(); HighlightNodesInHOCRange(); } } } }