Beispiel #1
0
    private PlaneController SpawnPlane()
    {
        Vector3   position = new Vector3(Random.Range(_xLimits.x, _xLimits.y), Random.Range(_yLimits.x, _yLimits.y), 0);
        PlaneData data     = _planeData[Random.Range(0, _planeData.Count)];

        PlaneController plane = Instantiate(_planePrefab, position, Quaternion.identity);

        plane.SetData(data);

        return(plane);
    }