void Start() { floatBonus1 = 0; intBonus1 = 0; // first Spawn them at the default spawnPosition spawnPosition = new Vector3(transform.position.x, transform.position.y - 1, 0); newPosition = spawnPosition; Spawn(); mouse = GameObject.FindGameObjectWithTag("Map_Manager").GetComponent <Mouse_Controls> (); townTProps = GetComponentInParent <TownTile_Properties> (); }
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() { mapScript = GetComponent <Map_Manager> (); mouseControls = GetComponent <Mouse_Controls> (); stopMouse = mouseControls.stopSelecting; }
// Use this for initialization void OnMouseOver() { mouse = GameObject.FindGameObjectWithTag("Map_Manager").GetComponent <Mouse_Controls> (); mouse.resourceTileToDestroy = this.gameObject; }