Esempio n. 1
0
    public void collisionWithObstacleStopsTime()
    {
        GameObject  deadScreen  = new GameObject();
        GameObject  bird        = new GameObject();
        CrashScript crashScript = bird.AddComponent <CrashScript>();

        GameObject     obstacle         = new GameObject();
        SphereCollider obstacleCollider = obstacle.AddComponent <SphereCollider>();

        obstacle.tag = "Obstacle";

        crashScript.deadScreen = deadScreen;

        crashScript.OnTriggerEnter(obstacleCollider);

        Assert.IsTrue(Time.timeScale == 0.0f);
    }
Esempio n. 2
0
    public void collisionWithNPCStopsTime()
    {
        GameObject  deadScreen  = new GameObject();
        GameObject  bird        = new GameObject();
        CrashScript crashScript = bird.AddComponent <CrashScript>();

        GameObject     npc         = new GameObject();
        SphereCollider npcCollider = npc.AddComponent <SphereCollider>();

        npc.tag = "NPC";

        crashScript.deadScreen = deadScreen;

        crashScript.OnTriggerEnter(npcCollider);

        Assert.IsTrue(Time.timeScale == 0.0f);
    }
Esempio n. 3
0
    public void collisionWithObstacleEnablesDeadScreen()
    {
        GameObject  deadScreen  = new GameObject();
        GameObject  bird        = new GameObject();
        CrashScript crashScript = bird.AddComponent <CrashScript>();

        GameObject     obstacle         = new GameObject();
        SphereCollider obstacleCollider = obstacle.AddComponent <SphereCollider>();

        obstacle.tag = "Obstacle";

        crashScript.deadScreen = deadScreen;
        deadScreen.SetActive(false);

        crashScript.OnTriggerEnter(obstacleCollider);

        Assert.IsTrue(deadScreen.activeSelf);
    }
Esempio n. 4
0
    public void collisionWithNPCEnablesDeadScreen()
    {
        GameObject  deadScreen  = new GameObject();
        GameObject  bird        = new GameObject();
        CrashScript crashScript = bird.AddComponent <CrashScript>();

        GameObject     npc         = new GameObject();
        SphereCollider npcCollider = npc.AddComponent <SphereCollider>();

        npc.tag = "NPC";

        crashScript.deadScreen = deadScreen;
        deadScreen.SetActive(false);

        crashScript.OnTriggerEnter(npcCollider);

        Assert.IsTrue(deadScreen.activeSelf);
    }