예제 #1
0
 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);
     }
 }
예제 #2
0
 public static void ChangeColumns()
 {
     charPosition = CharController.GetVectorChar();
     Destroy(firstPlatform);
     firstPlatform  = secondPlatform;
     secondPlatform = BuildPlatform(1);
     PlayerPrefs.SetInt(EPISODE_GAME_KEY, 5);
 }
예제 #3
0
 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());
 }
예제 #4
0
 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());
 }
예제 #5
0
 void Start()
 {
     charPosition = CharController.GetVectorChar();
 }