void OnDisable() { if (Instance == this) { Instance = null; } }
void Start() { myTransform = transform; lastPos = myTransform.position; // record this position buildControlText = buildControlBttn.GetComponentInChildren <Text> (); // townTile = mapScript.GetTownTile (); // ShowBasicBuildings(); townResources = townRes.GetComponent <TownResources> (); // CheckWhatTile (); // INSTEAD OF CHECKING TILE AT THE BEGINNING, CHECK TILE WHEN PLAYER PRESSES BUILD CONTROL BUTTON buildControlBttn.image.sprite = emptyButtonSprite; buildControlText.text = "BUILD"; }
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 Awake() { InitFarmValues(myBuildMaterial); // init values according to material of this building myTransform = transform; GameObject town = GameObject.FindGameObjectWithTag("Town_Central"); townCentral = town.GetComponent <Town_Central> (); townResources = town.GetComponent <TownResources> (); if (townTProps == null) { townTProps = GetComponentInParent <TownTile_Properties> (); } if (townCentral != null) { townCentral.farms.Add(this); farmListID = townCentral.farms.Count - 1; } }
void OnEnable() { Instance = this; }
void OnDisable() { if (Instance == this) Instance = null; }