Exemple #1
0
    public void CreateObstacles(Vector3 coordinates)
    {
        var randId = Random.Range(_prefabsID.Obst1_ID, _prefabsID.Obst2_ID + 1);

        var newObst = _pool.Pull(randId);

        newObst.transform.position = coordinates;
        newObst.transform.SetParent(_obstacles.transform);
    }
    public void CreateNewWayPoint(Vector2 position)
    {
        var dot = _pool.Pull();

        dot.transform.position = position;
        _wayPoints.Add(dot);

        _routeLine.positionCount++;
        _routeLine.SetPosition(_routeLine.positionCount - 1, position);
    }