Exemple #1
0
    public void GenerateBackgrounds(float platformLength)
    {
        GameObject bgRootObj = Instantiate(bgRoot) as GameObject;

        GenerateSkyBackground(platformLength, bgRootObj);
        GenerateAmbientBackground(platformLength, bgRootObj);
        GenerateBuildingBackground(platformLength, bgRootObj);

        initManagerInstance.ChangeState();
    }
Exemple #2
0
    public void GeneratePlatform(float platformLength, float platformSingleSize)
    {
        GameObject parentObj = Instantiate(platformParentPrefab) as GameObject;

        for (int i = -1; i < platformLength; i++)
        {
            GameObject platformObj = Instantiate(platformPrefab) as GameObject;
            platformObj.transform.localPosition = new Vector3(i * platformSingleSize, 0, 0);
            platformObj.transform.SetParent(parentObj.transform, false);
        }

        initManagerInstance.ChangeState();
    }
Exemple #3
0
 void SpawnPlayer()
 {
     playerObj = Instantiate(playerPrefab) as GameObject;         //->replace obj type with Player class
     playerObj.transform.localPosition = startPosSpawner.localPosition;
     initManagerInstance.ChangeState();
 }