示例#1
0
 public void Pop()
 {
     if (isDeadly)
     {
         gcScript.GameOver();
     }
     else
     {
         gcScript.AddPoints(1);
         Deactivate();
     }
 }
    // Test for player to go next scene once game has finished
    public IEnumerator testClickButtonToNextScene()
    {
        GameObject           obj = GameObject.Find("GameController");
        GameControllerScript gcs = obj.GetComponent <GameControllerScript>();

        // adds 10 points immediately to end game
        gcs.AddPoints(10);

        // this is to allow the animation of well done to end
        yield return(new WaitForSeconds(5f));

        // checks if the scene has changed
        Scene currentScene = SceneManager.GetActiveScene();

        Assert.AreEqual("4-cutscene", currentScene.name);  // the next scene is 4-cutscene

        yield return(null);
    }