コード例 #1
0
    public void updateStats(SelectLevelController.difficult Difficult, bool isWon = false)
    {
        stats.moves += gameManager.moves;
        stats.time += gameManager.timer;

        if (Difficult == SelectLevelController.difficult.DIFFICULT_EASY) updateValues(ref stats.easy, isWon);
        else if (Difficult == SelectLevelController.difficult.DIFFICULT_MEDIUM) updateValues(ref stats.medium, isWon);
        else if (Difficult == SelectLevelController.difficult.DIFFICULT_HARD) updateValues(ref stats.hard, isWon);
    }
コード例 #2
0
    public SelectLevelController()
    {
        instance = this;

        UpdateController.toUpdate      = Update;
        UpdateController.toFixedUpdate = FixedUpdate;

        new SlideController(1920 / 100f * Settings.FhdToHD, 1080 / 100f * Settings.FhdToHD, SlideController.Mode.Slide, 3);
        new GUIController();

        CameraController.ResizeCamera(Mathf.Min(CameraController.GetWidthInMeters(1080 / 50f * Settings.FhdToHD), 1920 / 50f * Settings.FhdToHD));

        Create();
    }
コード例 #3
0
    void Start()
    {
        exitPanel        = gameObject.transform.GetComponentInChildren <ExitGameController>();
        mainMenu         = gameObject.transform.GetComponentInChildren <MainController>();
        selectModePanel  = gameObject.transform.GetComponentInChildren <SelectModeController>();
        selectLevelPanel = gameObject.transform.GetComponentInChildren <SelectLevelController>();
        addLevels        = gameObject.transform.GetComponentInChildren <DebugAddingLevelsController>();
        settings         = gameObject.transform.GetComponentInChildren <SettingsController>();
        stats            = gameObject.transform.GetComponentInChildren <StatisticsController>();

        mainMenu.setActive(true);
        exitPanel.setActive(false);
        selectModePanel.setActive(false);
        selectLevelPanel.setActive(false);
        addLevels.setActive(false);
        settings.setActive(false);
        stats.setActive(false);
    }
コード例 #4
0
ファイル: MainMenuManager.cs プロジェクト: mengtest/Sudoku
	void Start () 
    {
        exitPanel = gameObject.transform.GetComponentInChildren<ExitGameController>();
        mainMenu = gameObject.transform.GetComponentInChildren<MainController>();
        selectModePanel = gameObject.transform.GetComponentInChildren<SelectModeController>();
        selectLevelPanel = gameObject.transform.GetComponentInChildren<SelectLevelController>();
        addLevels = gameObject.transform.GetComponentInChildren<DebugAddingLevelsController>();
        settings = gameObject.transform.GetComponentInChildren<SettingsController>();
        stats = gameObject.transform.GetComponentInChildren<StatisticsController>();

        mainMenu.setActive(true);
        exitPanel.setActive(false);
        selectModePanel.setActive(false);
        selectLevelPanel.setActive(false);
        addLevels.setActive(false);
        settings.setActive(false);
        stats.setActive(false);
	}
コード例 #5
0
        private void Awake()
        {
            GetComponentInChildren <Text>()
            .text = level.ToString();

            button.interactable = SettingHelper.IsLevelUnlocked(level)
                                  .GetOrDefault(level == 1);

            var score = SettingHelper.GetLevelScore(level).GetOrDefault(0);

            score1.enabled = score >= 1;
            score2.enabled = score >= 2;
            score3.enabled = score >= 3;

            button.onClick.AddListener(() =>
                                       SelectLevelController.LoadLevel(level)
                                       );
        }
コード例 #6
0
ファイル: MainController.cs プロジェクト: schlash/Box-XNA
        /// Implementation of IControl
        /// <summary>
        /// Push a new controller to the controller stack
        /// </summary>
        /// <param name="controller">Controller type to add</param>
        public void Push(ControllerType controllerType)
        {
            // Allocate a new controller from requested type
            IController controller = null;
            switch (controllerType)
            {
                case ControllerType.CONTROLLER_TYPE_SPLASH:
                    controller = new SplashController(this, m_content, m_graphicsDevice);
                    break;
                case ControllerType.CONTROLLER_TYPE_MAIN_MENU:
                    controller = new MainMenuController(this, m_content, m_graphicsDevice);
                    break;
                case ControllerType.CONTROLLER_TYPE_SELECT_LEVEL:
                    controller = new SelectLevelController(this, m_content, m_graphicsDevice);
                    break;
                case ControllerType.CONTROLLER_TYPE_INGAME:
                    controller = new GameController(this, m_content, m_graphicsDevice);
                    break;
                case ControllerType.CONTROLLER_TYPE_GAME_COMPLETE:
                    controller = new GameCompleteController(this, m_content, m_graphicsDevice);
                    break;
            }

            // Push controller to the stack
            if (controller != null)
                m_controllers.Push(controller);
        }