public void GenerateBackgrounds(float platformLength) { GameObject bgRootObj = Instantiate(bgRoot) as GameObject; GenerateSkyBackground(platformLength, bgRootObj); GenerateAmbientBackground(platformLength, bgRootObj); GenerateBuildingBackground(platformLength, bgRootObj); initManagerInstance.ChangeState(); }
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(); }
void SpawnPlayer() { playerObj = Instantiate(playerPrefab) as GameObject; //->replace obj type with Player class playerObj.transform.localPosition = startPosSpawner.localPosition; initManagerInstance.ChangeState(); }