Example #1
0
    public void CheckEndLevel()
    {
        bool tmpLevelEnd = true;

        for (int i = 0; i < gameEntities.Count; i++)
        {
            if (gameEntities[i] is IEnemyActor)
            {
                EnemyStatus tmpStatus = (gameEntities[i] as IEnemyActor).getStatus();
                if (tmpStatus != EnemyStatus.Dead)
                {
                    tmpLevelEnd = false;
                }
            }
        }
        if (tmpLevelEnd)
        {
            currentLevel++;
            if (currentLevel >= 7 && totalLevels > 6)
            {
                myPlayerCursor.useColor = true;
            }
        }

        if (currentLevel > totalLevels)
        {
            //Debug.Log("SHOW WIN SCREEN");
            for (loopVar1 = 0; loopVar1 < gameEntities.Count; loopVar1++)
            {
                if (gameEntities[loopVar1] is IGameActor)
                {
                    tmpActor = gameEntities[loopVar1] as IGameActor;
                    tmpActor.TakeMessage("PlayerDied");
                }
            }
            myUiLogic.playerWins();
        }
        else
        {
            levelEnded = tmpLevelEnd;
            if (tmpLevelEnd && currentLevel == 7 && totalLevels > 6)
            {
                //Show The Second Tome Screen Here
            }
        }
    }