Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void CreatePlatform(){
- Vector3 newPlatformPosition = oldPlatformPos;
- GameObject chosenPlatform = getRandomPlatform ();
- newPlatformPosition.z += chosenPlatform.GetComponent<Renderer> ().bounds.size.z;
- GameObject gameObj =(GameObject)Instantiate (chosenPlatform, newPlatformPosition, Quaternion.identity);
- gameObj.name = "Platform#" + platformCounter;
- gameObj.tag = "Platform";
- platformCounter++;
- oldPlatformPos = newPlatformPosition;
- //GenerateObstacle
- CreateCubeObstacle (gameObj);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement