Пример #1
0
    // Use this for initialization
    IEnumerator Start()
    {
        if (target == null)
        {
            target = transform;
        }

        currentNodeInThePath = 0;
        simulator            = GameObject.FindGameObjectWithTag("RVOSim").GetComponent <RVOSimulator>();
        pathNodes            = new List <Vector3>();
        yield return(StartCoroutine(StartPaths()));

        if (agentIndex == -1)
        {
            agentIndex = simulator.addAgentToSim(transform.position, gameObject, pathNodes);
        }
        isAbleToStart = true;
    }
Пример #2
0
    IEnumerator Start()
    {
        currentNodeInThePath = 0;
        simulator            = GameObject.FindGameObjectWithTag("RVOSim").GetComponent <RVOSimulator>();
        pathNodes            = new List <Vector3>();
        yield return(StartCoroutine(StartPaths()));

        agentIndex = simulator.addAgentToSim(transform.position, gameObject, pathNodes);

        if (updatePathtime <= 0)
        {
            Debug.Log("Incorrect Value of updatePathtime, setted to 1");
            updatePathtime = 1;
        }
        updatePathtime_tmp = updatePathtime;

        isAbleToStart = true;
    }