Exemplo n.º 1
0
    public void OnEnable()
    {
        //We might have an rvoAgent
        //which was disabled previously
        //if so, we can simply add it to the simulation again
        if (rvoAgent != null)
        {
            simulator.AddAgent(rvoAgent);
        }
        else
        {
            rvoAgent = simulator.AddAgent(transform.position);
        }

        UpdateAgentProperties();
        rvoAgent.Position = transform.position;
        adjustedY         = rvoAgent.Position.y;
    }
Exemplo n.º 2
0
    public void OnEnable()
    {
        if (simulator == null)
        {
            return;
        }

        //We might have an rvoAgent
        //which was disabled previously
        //if so, we can simply add it to the simulation again
        if (rvoAgent != null)
        {
            simulator.AddAgent(rvoAgent);
        }
        else
        {
            rvoAgent = simulator.AddAgent(transform.position);
        }

        UpdateAgentProperties();
        rvoAgent.Teleport(transform.position);
    }