コード例 #1
0
    void Update()
    {
        if (!WinLoseSystem.gameStateIsWin() && !WinLoseSystem.gameStateIsLose())
        {
            if (!GameManager.instance.isBusy)
            {
                hugeStone.GetComponent <Animator>().SetBool("IsHit", false);
                WinLoseSystem.comparingScore(score); //membandingkan score dan maxScore jika score >= maxScore maka state jadi "IsWin"
                WinLoseSystem.checkingMovesLeft();   //mengecek sisa langkah jika 0 maka state menjadi "IsLose"
            }

            if (isTimeToPlusOne(24))
            {
                hugeStone.GetComponent <Animator>().SetBool("IsHit", false);
            }
        }

        if (WinLoseSystem.gameStateIsWin())
        {
            Debug.Log("IsWin");
        }
        if (WinLoseSystem.gameStateIsLose())
        {
            Debug.Log("IsLose");
        }
    }
コード例 #2
0
    internal void AddScore()
    {
        //saat proses matching berhasil
        int temp = 10 * numberOfItemsPoppedInaRow * (numberOfItemsPoppedInaRow / 5 + 1);

        //  print(temp);
        score += temp;
        StringPusher.addStringDependInt(scoreText, score, 6, "0");
        scoreText.text += score.ToString();
        cEC.createCrushEffect();
        if (!WinLoseSystem.gameStateIsWin() && !WinLoseSystem.gameStateIsLose())
        {
            hugeStone.GetComponent <Animator>().SetBool("IsHit", true);
        }
    }