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()); }
public void MainMenu_OnEnter() { cameraSize = 3.5f; charObj = GameObject.Find("Player"); CharController.SetStartCharPosition(); Camera.main.orthographicSize = 1f; transform.position = new Vector3( charObj.transform.position.x + 0.5f, charObj.transform.position.y, gameObject.transform.position.z); PlayerPrefs.SetInt(EPISODE_GAME_KEY, 7); StickController.DeleteObjectStick(); PlatformController.DeletePlatform(0); PlatformController.DeletePlatform(1); PlatformController.BuildFirstPlatform(); }
void Update() { if (PlayerPrefs.GetInt(EPISODE_GAME_KEY).Equals(0) || PlayerPrefs.GetInt(EPISODE_GAME_KEY).Equals(7)) { transform.position = VectorMoveHero; } if (!transform.position.Equals(VectorMoveHero)) { transform.position = Vector3.MoveTowards( transform.position, VectorMoveHero, Time.deltaTime * speedRotationStick); } else if (PlayerPrefs.GetInt(EPISODE_GAME_KEY).Equals(4)) { StickController.DeleteObjectStick(); StickController.CreateObjectStick(VectorMoveHero); PlatformController.ChangeColumns(); } }