private static GameObject BuildPlatform(int numberOfPlatform) { if (numberOfPlatform == 0) { charPosition = CharController.GetVectorChar(); GameObject platform = Instantiate( Resources.Load("PlatformPrefab"), new Vector3( charPosition.x + 0.45f, charPosition.y - 2.2f, charPosition.z), Quaternion.identity) as GameObject; platform.transform.localScale = new Vector3(1.5f, 4f, 1f); return(platform); } else { charPosition = CharController.GetVectorChar(); GameObject platform = Instantiate( Resources.Load("PlatformPrefab"), new Vector3( Random.Range(3f, 5f) + charPosition.x + 0.45f, charPosition.y - 2.2f, charPosition.z), Quaternion.identity) as GameObject; platform.transform.localScale = new Vector3(Random.Range(0.75f, 2.5f), 4f, 1f); return(platform); } }
public static void ChangeColumns() { charPosition = CharController.GetVectorChar(); Destroy(firstPlatform); firstPlatform = secondPlatform; secondPlatform = BuildPlatform(1); PlayerPrefs.SetInt(EPISODE_GAME_KEY, 5); }
public void StartButton_OnClick() { Camera.main.orthographicSize = cameraSize; PlayerPrefs.SetInt(EPISODE_GAME_KEY, 0); PlatformController.BuildSecondPlatform(); StickController.SetSpeedGrowStick(0); StickController.SetSpeedRotationStick(0); StickController.CreateObjectStick(CharController.GetVectorChar()); }
public void RestartButton_OnClick() { PlayerPrefs.SetInt(EPISODE_GAME_KEY, 0); CharController.SetStartCharPosition(); StickController.DeleteObjectStick(); PlatformController.DeletePlatform(0); PlatformController.DeletePlatform(1); PlatformController.BuildSecondPlatform(); PlatformController.BuildFirstPlatform(); StickController.SetSpeedGrowStick(0); StickController.SetSpeedRotationStick(0); StickController.CreateObjectStick(CharController.GetVectorChar()); }
void Start() { charPosition = CharController.GetVectorChar(); }