예제 #1
0
    public ChunkFlow(ProceduralGeneratorOfChunk proceduralGeneratorOfChunk, Chunk lastChunk, ChunkBag chunkBag, int seed, int startingChunkId, Vector3 startingPosition, float angle)
    {
        lastRoomEndPosition             = startingPosition;
        this.proceduralGeneratorOfChunk = proceduralGeneratorOfChunk;
        generationParentTransform       = proceduralGeneratorOfChunk.transform;
        this.chunkBag    = chunkBag;
        this.lastChunk   = lastChunk;
        this.seed        = seed;
        this.random      = new System.Random(seed);
        this.nextChunkId = startingChunkId;
        rotation         = angle;

        makeStartChunk();
    }
예제 #2
0
    void Update()
    {
        if (hasBeenDone)
        {
            return;
        }
        hasBeenDone = true;
        ProceduralGeneratorOfChunk pc = getMeOrCreate("ProceduralGeneratorOfChunk", "Prefab/Game/ProceduralGeneratorOfChunk").GetComponent <ProceduralGeneratorOfChunk>();
        RunnerCamera rc = getMeOrCreate("Main Camera", "Prefab/Main Camera").GetComponent <RunnerCamera>();
        Runner       ru = getMeOrCreate("Runner", "Prefab/Runner").GetComponent <Runner>();
        References   gm = getMeOrCreate("GameManager", "Prefab/GameManager").GetComponent <References>();

        getMeOrCreate("PureData", "Prefab/PureData").GetComponent <PureData>();


        gm.runner       = ru;
        gm.runnerCamera = rc;
        gm.proceduralGeneratorOfChunk = pc;
        pc.playersTransform           = rc.transform;

        Object.DestroyImmediate(gameObject);
    }