コード例 #1
0
ファイル: LevelController.cs プロジェクト: OwlyCode/LD44
    void Start()
    {
        if (GlobalState.hasEmergencyShieldUpgrade)
        {
            GlobalState.emergencyShieldLife = 1;
        }
        if (GlobalState.hasDeflector)
        {
            GlobalState.emergencyShieldLife = 3;
        }


        dialogsQueue      = new Queue <Dialog>(dialogs);
        expandedChunkList = new List <ChunkSettings>();

        levelContent = new Queue <List <Vector3> >();

        foreach (ChunkSettings settings in chunkSettings)
        {
            for (int i = 0; i < settings.repeat; i++)
            {
                expandedChunkList.Add(settings);
                levelContent.Enqueue(PoissonSphere.GeneratePoints(settings.spacing, asteroidSpawner.GetComponent <AsteroidSpawnerV2>().sampleRegionSize, asteroidSpawner.GetComponent <AsteroidSpawnerV2>().rejectionSamples));
            }
        }

        startingPosition = ship.transform.position.z;
        SpawnChunk(0);
    }
コード例 #2
0
    public IEnumerator SpawnAsteroids(float spacing, float scale, float agitation)
    {
        List <Vector3> points = PoissonSphere.GeneratePoints(spacing, sampleRegionSize, rejectionSamples);

        yield return(SpawnAsteroids(points, scale, agitation));
    }