Example #1
0
    private void InstantiateNextPatch()
    {
        pathDrawer pDrawer = currPatch.GetComponentInChildren <pathDrawer>();

        patchDistance = pDrawer.patchLength;
        nextPatch     = (GameObject)Instantiate(patchesPrefabs[Random.Range(0, patchesPrefabs.Length)], new Vector3(prevDistance + patchDistance, 0, 0), new Quaternion());
    }
Example #2
0
    public void SetNextPatchCPs()
    {
        pathDrawer pDrawer = nextPath.GetComponent <pathDrawer>();

        nextCPPositions = new Vector3[pDrawer.CP_pos.Length];
        for (int i = 0; i < nextCPPositions.Length; i++)
        {
            nextCPPositions[i]   = pDrawer.CP_pos[i].position;
            nextCPPositions[i].x = nextCPPositions[i].x + patchDistance;
        }
    }
Example #3
0
    public void SetCurrentPatchCPs()            //берем контрольные точки
    {
        currAngle = 90.0f;
        pathDrawer pDrawer = currPath.GetComponent <pathDrawer>();

        patchDistance = pDrawer.patchLength;

        currCPPositions = new Vector3[pDrawer.CP_pos.Length];
        for (int i = 0; i < currCPPositions.Length; i++)
        {
            currCPPositions[i]   = pDrawer.CP_pos[i].position;
            currCPPositions[i].x = currCPPositions[i].x;
        }
    }