Ejemplo n.º 1
0
    // Update is called once per frame
    void FixedUpdate()
    {
        transform.position = new Vector2(transform.position.x, transform.position.y + 0.005f);

        if (transform.position.y > 7)
        {
            if (isEnd == false)
            {
                isEnd = true;
                StartCoroutine(Stop());
                wf.FadeOutCoroutine(() => {
                    Application.LoadLevel("ThankYou");
                });
            }
        }
    }
Ejemplo n.º 2
0
 // Update is called once per frame
 void Update()
 {
     if (wf.color > 0 && isFadeIn == false)
     {
         wf.FadeIn(0.5f);
     }
     else
     {
         isFadeIn = true;
         actTime++;
         if (actTime > 10)
         {
             if (audioSource.isPlaying == false && isPlay == false)
             {
                 audioSource.Play();
                 isPlay = true;
             }
         }
         if (actTime > 250)
         {
             if (pl2.transform.localScale.x > 0)
             {
                 pl2.transform.localScale = new Vector2(-2, 2);
             }
         }
         if (actTime > 330)
         {
             exc.transform.position = new Vector2(0.65f, 0.05f);
         }
         if (actTime > 410)
         {
             if (exc.transform.position.x > 0)
             {
                 exc.transform.position = new Vector2(-3, 0);
             }
         }
         if (actTime > 480)
         {
             if (pl.transform.localScale.x > 0)
             {
                 pl.transform.localScale = new Vector2(-2, 2);
             }
         }
         if (actTime > 530)
         {
             pl.transform.position = new Vector2(pl.transform.position.x - 0.01f, pl.transform.position.y);
             if (pl.GetComponent <OpAnimator> ().animationNum == 0)
             {
                 pl.GetComponent <OpAnimator> ().Action();
             }
         }
         if (actTime > 545)
         {
             pl2.transform.position = new Vector2(pl2.transform.position.x - 0.01f, pl2.transform.position.y);
             if (pl2.GetComponent <OpAnimator> ().animationNum == 0)
             {
                 pl2.GetComponent <OpAnimator> ().Action();
             }
         }
         if (actTime > 580)
         {
             if (isFadeOut == false)
             {
                 isFadeOut = true;
                 wf.FadeOutCoroutine(() => { Application.LoadLevel("EndingRoll"); });
             }
         }
     }
 }
Ejemplo n.º 3
0
    // Update is called once per frame
    void FixedUpdate()
    {
        time++;
        if (isBossSpawn == true)
        {
            if (bossIns == null)
            {
                //	if (timeMax > 100)
                //		timeMax -= 40;
                spawnNum    = 1;
                isBossSpawn = false;
                time        = 0;
                timeMax     = 300;

                if (stage < stageMax)
                {
                    im.StageText("Stage " + stage + "\nClear!!", new Color(0.2f, 0.2f, 0.2f));
                    stage++;
                }
                else
                {
                    wf.FadeOutCoroutine(() => { Application.LoadLevel("EndingMovie"); });
                    spawnNum++;
                    Statics.isCleard = 1;
                    //stage = 1;
                }

                //level += 10;
            }
        }
        if (time > timeMax)
        {
            /*
             * enpc++;
             * if (enpc > 5) {
             *      enpc = 0;
             *      if (enemynum < enemyList.Count) {
             *              enemynum++;
             *              if (enemynum > enemyList.Count)
             *                      enemynum = enemyList.Count;
             *      }
             *
             * }*/
            //if(timeMax > 30)timeMax--;
            time = 0;
            //int hp = (240 - timeMax) / 3;
            ////Spawn (Random.Range (0, enemynum), new Vector3 (-3.33f + 6.66f * Random.Range (0, 2), Random.Range (0, 5) * 0.2f - 0.3f, 1 + hp));
            if (spawnNum > 12)
            {
                spawnNum = 12;
            }
            if (stage == 1)
            {
                Stage1();
            }
            if (stage == 2)
            {
                Stage2();
            }
            if (stage == 3)
            {
                Stage3();
            }
            if (stage == 4)
            {
                Stage4();
            }
        }
        //Debug.Log (spawnNum);
    }