Exemple #1
0
 // Update is called once per frame
 void Update()
 {
     if (this.flag.activeSelf == false)
     {
         checkStageClear();
         SceneManager.LoadScene("3_mapscreen");
     }
     // 플레이어가 화면 밖으로 나갔다면 처음부터
     if (this.cat.transform.position.y < -10)
     {
         // 난이도: 하 (savepoint + checkpoint)
         if (savepoint_obj.activeSelf == true && checkpoint1.activeSelf == true && checkpoint2.activeSelf == true)
         {
             this.checkpoint = currentcheckpoint.GetComponent <CheckPoint>();
             if (savepoint.SaveReach == true)
             {
                 if (checkpoint.priority == 2 && checkpoint.CheckReach == true && checkpoint.savecount > 0)
                 {
                     this.cat.transform.position = this.currentcheckpoint.transform.position + new Vector3(0, 1, 0);
                     checkpoint.LoseHeart();
                     checkpoint.savecount--;
                 }
                 else
                 {
                     checkpoint.ResetPoint();
                     this.cat.transform.position = this.currentsavepoint.transform.position + new Vector3(0, 1, 0);
                 }
             }
             else
             {
                 if (checkpoint.CheckReach == true && checkpoint.savecount > 0)
                 {
                     this.cat.transform.position = this.currentcheckpoint.transform.position + new Vector3(0, 1, 0);
                     checkpoint.LoseHeart();
                     checkpoint.savecount--;
                 }
                 else
                 {
                     checkpoint.ResetPoint();
                     this.cat.transform.position = new Vector3(0, 1, 0);
                 }
             }
         }
         // 난이도: 중 (savepoint)
         else if (savepoint_obj.activeSelf == true && checkpoint1.activeSelf == false && checkpoint2.activeSelf == false)
         {
             if (savepoint.SaveReach == true)
             {
                 this.cat.transform.position = this.currentsavepoint.transform.position + new Vector3(0, 1, 0);
             }
             else
             {
                 this.cat.transform.position = new Vector3(0, 1, 0);
             }
         }
         // 난이도: 상 ()
         else
         {
             this.cat.transform.position = new Vector3(0, 1, 0);
         }
     }
 }