Пример #1
0
    void Handle_ClickOnIntermissionScreen()
    {
        Counters.movementWarmupCounter = Consts.MOVEMENT_WARMUP;

        Camera cameraObj = Camera.main;

        if (cameraObj == null)
        {
            Debug.Log("Unable to access main Camera");
            return;
        }
        Intermission intermission = cameraObj.GetComponent <Intermission>();

        if (intermission == null)
        {
            Debug.Log("Unable to access Intermission");
            return;
        }
        intermission.SendMessage("PerformDestroyIntermission");

        if (WorldState.currentLevel.ReachedFinal())
        {
            WorldState.currentLevel.Set(1);
            BuildMenu buildMenu = cameraObj.GetComponent <BuildMenu>();
            if (buildMenu == null)
            {
                Debug.Log("Unable to access BuildMenu");
                return;
            }
            buildMenu.Start();
            WorldState.gameState = WorldState.GameState.SplashScreen;
        }
        else
        {
            WorldState.gameState = WorldState.GameState.Game;
            BuildLevel buildLevel = cameraObj.GetComponent <BuildLevel>();
            if (buildLevel == null)
            {
                Debug.Log("Unable to access BuildLevel");
                return;
            }
            buildLevel.PerformBuild();
            WorldState.DisableGravity();
            WorldState.build_virtual_level_representation();
            WorldState.debug_print_virtual_level();
        }
    }