コード例 #1
0
    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);
    }