/// <summary> /// Set the agent that we're currently directing /// </summary> /// <param name="agentNumber"></param>the agent number private void SetAgent(int agentNumber) { directedAgent = directedAgents[agentNumber]; //Turn off (and on) the correct bg image for (int i = 0; i < bgImages.Length; i++) { bgImages[i].enabled = false; } bgImages[agentNumber].enabled = true; }
public void MakeEthan() { // getting player transform Transform place = player.GetComponents <Transform> ()[0]; // instantiating Ethan from the prefab at the same position and rotation GameObject gobject = Instantiate(ethanFab, place.position, place.rotation) as GameObject; // getting the DirectedAgent component of Ethan and starting the movement agent = gobject.GetComponent <DirectedAgent> (); agent.moveToLocation(endPoint); AudioSource ethanAudio = agent.GetComponent <AudioSource>(); playerHelp.setEthanAudio(ethanAudio); }