// Use this for initialization void Start() { //Get current Game Manager instance gm = FindObjectOfType <GameManager>(); //Get current backend instance bm = FindObjectOfType <BackendManager>(); //By default the payload is uncaptured. Only changes when an agent catches it. State = PayloadState.Uncaptured; agent.AgentLanded += Agent_AgentLanded; }
private void Agent_AgentLanded(object sender, Agent.AgentLocation e) { //Change our state State = PayloadState.Captured; //Instantiate the bubble object on the spot the agent landed Vector3 locn = new Vector3(e.Location.x, 0, e.Location.z); Quaternion rotation = new Quaternion(); Instantiate(gameObject, locn, rotation); //SetInactive after 3 secs StartCoroutine(gm.ChangeActiveAfter(3, gameObject, false)); return; }