void BuildHouse(GameObject worker) { // Build(GameObject building, Vector3 pos) WorkerAI Worker2 = worker.GetComponent <WorkerAI>(); houseBuildSpotPos = new Vector3(-255.0f, -0.1f, -73.0f); // we will need to generate a trigger collider at that position so we can send out an event GameObject houseMarker = Instantiate(positionEventCollider, houseBuildSpotPos, Quaternion.identity, this.transform); PositionEventCollider pec = houseMarker.GetComponent <PositionEventCollider>(); pec.eventName = "ReachedHouseBuildSpot"; Worker2.Move(houseBuildSpotPos); // when a worker gets there we will be able to get the event // they begin building with the ReachedLumberBillSpotEvent() }
void BuildLumberMill(GameObject worker) { WorkerAI Worker1 = worker.GetComponent <WorkerAI>(); lumberMillBuildSpotPos = new Vector3(-188.0f, -0.1f, -50.0f); // we will need to generate a trigger collider at that position so we can send out an event GameObject lumberMillMarker = Instantiate(positionEventCollider, lumberMillBuildSpotPos, Quaternion.identity, this.transform); PositionEventCollider pec = lumberMillMarker.GetComponent <PositionEventCollider>(); pec.eventName = "ReachedLumberMillBuildSpot"; Worker1.Move(lumberMillBuildSpotPos); // when a worker gets there we will be able to get the event // they begin building with the ReachedLumberBillSpotEvent() // GameObject lumberMill = Instantiate(lumberMillPrefab, lumberMillBuildSpotPos, Quaternion.identity, this.transform); }