void Start() { uiMaster = GameObject.FindGameObjectWithTag("GM").GetComponent <UI_Master> (); dialoguePanel = uiMaster.dialoguePanel; dialogueText = uiMaster.dialogueText; charPortrait = uiMaster.charPortrait; survivorPanel = uiMaster.survivorPanel; charName = uiMaster.charName; myTransform = transform; if (mySprite == null) { // when this Survivor is spawned they need a name name = GetName(false); // get the Sprite (for the Player's UI if this Survivor joins a town) mySprite = GetComponent <SpriteRenderer> ().sprite; } // get the current mood Type moodType = GetMoodType(); // and store the current mood currMood = mood; if (townCentral == null) { townCentral = GameObject.FindGameObjectWithTag("Town_Central").GetComponent <Town_Central>(); } }
void Start() { // check that we're not in the game over screen if (Application.loadedLevel == 0) { townCentral = GameObject.FindGameObjectWithTag("Town_Central").GetComponent <Town_Central>(); } }
void Start() { townCentral = GameObject.FindGameObjectWithTag("Town_Central").GetComponent <Town_Central> (); // boost the gather timer // townCentral.gatherTimeBoost = townCentral.gatherTimeBoost + timeBoost; // add habitants to Survivor Vacancies // townCentral.survivorVacancies = townCentral.survivorVacancies + maxHabitants; // townCentral.maxGatherers = townCentral.maxGatherers + maxHabitants; // decrease this town tile's HP because house's lower their defenses townTileProps = GetComponentInParent <TownTile_Properties> (); townTileProps.tileHitPoints = townTileProps.tileHitPoints - hpLoss; }
void Start() { gmScript = GameObject.FindGameObjectWithTag("GM").GetComponent <GameMaster> (); if (Application.loadedLevel == 0) { townCentral = GameObject.FindGameObjectWithTag("Town_Central").GetComponent <Town_Central>(); camFollowScript = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <Camera_Follow>(); mapScript = GetComponent <Map_Manager>(); } myTransform = transform; // FOR NOW im going to spawn a selection box here to be able to see what town tile i have selected GameObject tileSelectBox = Instantiate(selectionBox, myTransform.position, Quaternion.identity) as GameObject; tileSelectBox.transform.parent = myTransform; stopSelecting = false; }
public Mouse_Controls mouse; // to tell it to stop selecting void Start() { // check if name is null to see if this is a new gatherer or if it's already on the list if (name == null) { name = GetName(false); } myTransform = transform; town = GameObject.FindGameObjectWithTag("Town_Central"); townResources = town.GetComponent <TownResources> (); townCentral = town.GetComponent <Town_Central> (); GameObject map = GameObject.FindGameObjectWithTag("Map_Manager"); mapManager = map.GetComponent <Map_Manager> (); mouse = map.GetComponent <Mouse_Controls> (); gathering = true; }
void Start() { gmScript = GameObject.FindGameObjectWithTag("GM").GetComponent <GameMaster> (); townCentral = GameObject.FindGameObjectWithTag("Town_Central").GetComponent <Town_Central> (); // get the Position of the Player's capital (so we can move the Rigidbody towards it) capitalPosition = gmScript.startingPlayerPos; rb = GetComponent <Rigidbody2D> (); // TEST: create 5 AI elite units // for (int x = 0; x <= 5; x++) { // hordeMembers.Add(new Unit_Data(description: "Some description.", allegiance: Unit_Data.Allegiance.monster, quality: Unit_Data.Quality.high, fireRate: 1, sDamage: 2f, mDamage: 3f, lDamage: 5f)); // } // TEST2: create 1 AI high // hordeMembers.Add(new Unit_Data(description: "Some description.", allegiance: Unit_Data.Allegiance.monster, quality: Unit_Data.Quality.high, fireRate: 1, sDamage: 2f, mDamage: 3f, lDamage: 5f)); // unitHolder.gameObject.AddComponent <AI_Enemy> (); // leader = unitHolder.GetComponent<AI_Enemy> (); // leader.ForceInit (Battle_Unit.Quality.high); myTransform = transform; }
void Awake() { hordeSpwn = GetComponentInParent <HordeSpawner> (); townCentral = GameObject.FindGameObjectWithTag("Town_Central").GetComponent <Town_Central> (); }