コード例 #1
0
    public IEnumerator Test_TeleporterIsBlockedWhileTeleportInProgress()
    {
        Player             player   = CreatePlayer();
        GameController     gameCtr  = CreateGameController(player);
        TeleportToPosition teleport = CreateTeleporter(new Vector3(1, 1, 1));

        teleport.GameCtr = gameCtr;

        yield return(new WaitForEndOfFrame());

        Assert.IsTrue(teleport.CanTeleport(), "Teleporter was blocked before any teleporting started!");

        teleport.PlayerTeleport();

        yield return(new WaitForEndOfFrame());

        Assert.IsFalse(teleport.CanTeleport(), "Teleporter was not blocked after teleporting started!");

        yield return(new WaitForSeconds(teleport.TeleportTime));

        Assert.IsTrue(teleport.CanTeleport(), "Teleporter was still blocked after teleporting finished!");
    }