Exemple #1
0
    private MWB_Path createNewSubPath()
    {
        var subPath = new MWB_SubPath(); //Instantiate(SubPathInstance, Vector3.zero, Quaternion.identity, this.transform);

        subPath.Init();
        m_SubPathsPool.Add(subPath);
        return(subPath);
    }
Exemple #2
0
    public MWB_SubPath GetSubPath(MWB_Path parentPath)
    {
        foreach (MWB_SubPath path in m_SubPathsPool)
        {
            if (path.IsInitialized)
            {
                path.Use();
                path.SetParentPath(parentPath);
                return(path);
            }
        }

        for (int i = 0; i < SpawnLimitPerFrame; i++)
        {
            createNewSubPath();
        }
        MWB_SubPath ret = m_SubPathsPool[m_SubPathsPool.Count - 1];

        ret.Use();
        ret.SetParentPath(parentPath);

        return(ret);
    }