Beispiel #1
0
    // Update is called once per frame
    void Update()
    {
        // Change moon's sprite
        if (moonChangeTimeCount == 0)
        {
            spriteIndex++;
            gameObject.GetComponent <SpriteRenderer>().sprite = sprites[spriteIndex % sprites.Length];
            moonChangeTimeCount = moonChangeTime;
        }

        // If it's blood moon, boost player's speed and increase player's speed permanently after blood moon
        if (spriteIndex % sprites.Length == indexOfBloodMoon && !boosting)
        {
            player.startTsuyoTsuyoMode();
            boosting        = true;
            speedIncreasing = false;
            background.BloodSky();
        }
        else if (spriteIndex % sprites.Length == (indexOfBloodMoon + 1) % sprites.Length && !speedIncreasing)
        {
            player.SpeedUp();
            speedIncreasing = true;
            boosting        = false;
            background.NormalSky();
        }

        // If it's dark moon, generate mirei eye
        if (spriteIndex % sprites.Length == indexOfDarkMoon && !mireiTime)
        {
            mireiTime = true;
            StartCoroutine("MireiTime");
        }
        else if (spriteIndex % sprites.Length == (indexOfDarkMoon + 1) % sprites.Length)
        {
            mireiTime = false;
        }
    }