void SetPlatform(PlatformInfo platformInfo) { ModularPlatform console = platformInfo.platformGameObject.GetComponentInChildren <ModularPlatform>(); console.ChangeSpeed(platformInfo.speed); console.ChangeMaxHeight(platformInfo.maxHeight); console.ControllableToggle(platformInfo.controllable); console.transform.position = platformInfo.consolePosition; console.transform.rotation = platformInfo.consoleRotation; console.currentTarget = platformInfo.currentTarget; console.gameObject.AddComponent <BulldozerObject>(); platformInfo.platformGameObject.GetComponentInChildren <ModularPlatformUnderCollision>().transform.position = platformInfo.platformPosition; for (int i = 0; i < platformInfo.waypoints.Count; ++i) { GameObject TempTarget = new GameObject(); TempTarget.transform.Rotate(new Vector3(-90, 0, 0)); TempTarget.transform.position = platformInfo.waypoints[i]; Transform newTarget = console.PlaceTarget(TempTarget.transform); newTarget.gameObject.AddComponent <PlatformWaypoint>().indexInList = i; newTarget.gameObject.AddComponent <BulldozerObject>(); Destroy(TempTarget); } for (int i = 0; i < platformInfo.platformTops.Count; ++i) { console.SpawnPlatformTop(platformInfo.platformTops[i]); } platformInfo.platformGameObject.GetComponentInChildren <UndoSystem_ModularPlatform>().enabled = false; }