Beispiel #1
0
        public void AddCamera(TableLayoutPanel tableLayoutPanel, string cameraName, Point point)
        {
            var playPanel = FindPlayPanel(cameraName);

            if (playPanel != null)
            {
                //xóa play panel cũ
                playPanels.Remove(playPanel);
            }

            playPanel           = new PlayPanel();
            playPanel.Padding   = new Padding(0);
            playPanel.Margin    = new Padding(0);
            playPanel.BackColor = Color.Black;
            playPanel.Name      = cameraName;
            playPanel.Dock      = DockStyle.Fill;
            playPanel.setBorderColor(Color.White, 1);

            playPanels.Add(playPanel);
            tableLayoutPanel.Controls.Clear();
            if (tableLayoutPanel.InvokeRequired)
            {
                tableLayoutPanel.BeginInvoke((MethodInvoker) delegate()
                {
                    tableLayoutPanel.Controls.Add(playPanel, point.X, point.Y);
                });
            }
            else
            {
                tableLayoutPanel.Controls.Add(playPanel, point.X, point.Y);
            }
        }
 public void Init(RoomInfo roomInfo, PlayPanel playPanel, BasePool pool, MainMenuController mainMenuController)
 {
     this.mainMenuController = mainMenuController;
     this.roomInfo           = roomInfo;
     this.pool      = pool;
     this.playPanel = playPanel;
     Refresh();
 }
Beispiel #3
0
 public void RegresarMenuPrincipal()
 {
     MainPanel.SetActive(true);
     PlayPanel.SetActive(false);
     CreditsPanel.SetActive(false);
     OpcionesPanel.SetActive(false);
     GameObject.Find("EventSystem").GetComponent <EventSystem>().SetSelectedGameObject(firstMain, null);
 }
Beispiel #4
0
 public void PlayCreditosMenu()
 {
     MainPanel.SetActive(false);
     PlayPanel.SetActive(false);
     CreditsPanel.SetActive(true);
     OpcionesPanel.SetActive(false);
     GameObject.Find("EventSystem").GetComponent <EventSystem>().SetSelectedGameObject(firstCred, null);
 }
Beispiel #5
0
 void Start()
 {
     MainPanel.SetActive(true);
     PlayPanel.SetActive(false);
     CreditsPanel.SetActive(false);
     OpcionesPanel.SetActive(false);
     print(PlayPanel.activeSelf);
 }
Beispiel #6
0
    void Start()
    {
        Instance = this;
        Load();
        if (GameDataSave.clampedPowerUPTypeAmount != null)
        {
            PlayerController.Instance.clampedPowerUPTypeAmount = GameDataSave.clampedPowerUPTypeAmount;
        }

        foreach (Transform t in PlayerContent)
        {
            Destroy(t.gameObject);
        }
        int player = 0;

        AllPlayerSettings = new List <PlayerSetter>();
        foreach (Character c in Enum.GetValues(typeof(Character)))
        {
            PlayerSetter playerSetter = Instantiate(PlayerSetterPrefab);
            playerSetter.transform.SetParent(PlayerContent, false);
            playerSetter.playerNumber = player;
            if (GameDataSave != null)
            {
                playerSetter.Set(GameDataSave.playerSettings.Find(x => x.playerNumber == player));
            }
            else
            {
                playerSetter.character = c;
            }
            AllPlayerSettings.Add(playerSetter);
            player++;
        }
        StartGameButton.onClick.AddListener(Save);
        StartGameButton.onClick.AddListener(PlayerController.Instance.StartGame);
        WinSlider.onValueChanged.AddListener(OnWinSliderChange);
        SuddenDeathSlider.onValueChanged.AddListener(OnSuddenDeathSliderChange);
        RandomSpawnsToggle.onValueChanged.AddListener(OnRandomSpawnToggle);
        RandomMapsToggle.onValueChanged.AddListener(OnRandomMapOrderToggle);
        ShakeAmountSlider.onValueChanged.AddListener(OnShakeAmountSliderChange);
        ClampUpgradesToggle.onValueChanged.AddListener(OnClampUgrades);
        WinSlider.value          = PlayerController.Instance.NumberOfWins;
        SuddenDeathSlider.value  = PlayerController.Instance.SuddenDeathTimerStart / 5;
        RandomSpawnsToggle.isOn  = PlayerController.Instance.RandomSpawns;
        RandomMapsToggle.isOn    = PlayerController.Instance.RandomMapOrder;
        ShakeAmountSlider.value  = BombController.ShakeAmount;
        ClampUpgradesToggle.isOn = PlayerController.Instance.ClampUpgrades;

        if (GameDataSave != null)
        {
            WinSlider.value          = GameDataSave.numberOfWins;
            SuddenDeathSlider.value  = GameDataSave.timeToSuddenDeath / 5;
            RandomSpawnsToggle.isOn  = GameDataSave.RandomSpawns;
            RandomMapsToggle.isOn    = GameDataSave.RandomMaps;
            ClampUpgradesToggle.isOn = GameDataSave.ClampUpgrades;
            ShakeAmountSlider.value  = GameDataSave.ShakeAmount;
        }
    }
 void Start()
 {
     if (Shop != null)
     {
         PlayPanel.SetActive(false);
         Shop.SetActive(false);
         Dungeon.SetActive(false);
         Taverne.SetActive(false);
     }
 }
	void Init(){
		mainPanel =  GameObjectTools.GetComponentInChildren <MainPanel> (gameObject);
		playPanel = GameObjectTools.GetComponentInChildren<PlayPanel> (gameObject);
		pausePanel = GameObjectTools.GetComponentInChildren<PausePanel> (gameObject);
		gameOverPanel = GameObjectTools.GetComponentInChildren<GameOverPanel> (gameObject);

		mainPanel.gameObject.SetActive (true);
		playPanel.gameObject.SetActive (false);
		pausePanel.gameObject.SetActive (false);
		gameOverPanel.gameObject.SetActive (false);

		mainPanel.Init ();
		playPanel.Init ();
		pausePanel.Init ();
		gameOverPanel.Init ();
	}
Beispiel #9
0
    void Init()
    {
        mainPanel     = GameObjectTools.GetComponentInChildren <MainPanel> (gameObject);
        playPanel     = GameObjectTools.GetComponentInChildren <PlayPanel> (gameObject);
        pausePanel    = GameObjectTools.GetComponentInChildren <PausePanel> (gameObject);
        gameOverPanel = GameObjectTools.GetComponentInChildren <GameOverPanel> (gameObject);

        mainPanel.gameObject.SetActive(true);
        playPanel.gameObject.SetActive(false);
        pausePanel.gameObject.SetActive(false);
        gameOverPanel.gameObject.SetActive(false);

        mainPanel.Init();
        playPanel.Init();
        pausePanel.Init();
        gameOverPanel.Init();
    }
Beispiel #10
0
    protected override void IntroEnter()
    {
        base.IntroEnter();
        if (_playPanel == null)
        {
            _playPanel = UIManager.Instance.GetPanel("PlayPanel") as PlayPanel;
        }
        _playPanel.Show();

        if (_resultPanel == null)
        {
            _resultPanel = UIManager.Instance.GetPanel("ResultPanel") as ResultPanel;
        }

        if (gameplayCamera != null)
        {
            gameplayCamera.enabled = true;
        }
        ResetLevel();
    }
Beispiel #11
0
 private void PlayButton_Click(object sender, EventArgs e)
 {
     MainPanel.Hide();
     SettingsPanel.Hide();
     PlayPanel.Show();
 }
 public override void Init(params object[] args)
 {
     base.Init(args);
     layer    = PanelLayer.Panel;
     instance = this;
 }
Beispiel #13
0
        /// <summary>
        /// Handles the key down.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The <see cref="T:System.Windows.Input.KeyEventArgs" /> instance containing the event data.</param>
        public void HandleKeyDown(object sender, KeyEventArgs e)
        {
            // send keystrokes to the mini play panel?
            if (MovieControlModel.GetInstance.PlayOptionsVisible)
            {
                PlayPanel.HandleKeyDown(sender, e);
                return;
            }


            // we like the ability to skip through preview
            if (MediaPlayerModel.GetInstance.IsPlayingMediaPlayer())
            {
                if (e.Key == Key.Left ||
                    e.Key == Key.Right ||
                    e.Key == Key.MediaNextTrack ||
                    e.Key == Key.N ||
                    e.Key == Key.P || e.Key == (Key)177 || e.Key == Key.MediaPreviousTrack)
                {
                    MediaPlayerModel.GetInstance.HandleKeyDown(this, e);
                }
            }

            // backspace
            if (e.Key == Key.Back)
            {
                PageModel.GetInstance.NavigateBackwards();
                MediaPlayerModel.GetInstance.PreviewMedia(true);
            }

            // up
            if (e.Key == Key.Up)
            {
                PageModel.GetInstance.MoveUp();
                PageModel.GetInstance.BindItems();
                PageModel.GetInstance.UpdatePaginationLabels();
                MediaPlayerModel.GetInstance.PreviewMedia(false);
            }

            // down
            if (e.Key == Key.Down)
            {
                PageModel.GetInstance.MoveDown();
                PageModel.GetInstance.BindItems();
                PageModel.GetInstance.UpdatePaginationLabels();
                MediaPlayerModel.GetInstance.PreviewMedia(false);
            }

            // enter
            if (e.Key == Key.Enter)
            {
                // Are we pressing enter whislt a video file is selected?
                MenuItemModel selectedItemModel = PageModel.GetInstance.VisibleMenuItemModels.Where(m => m.IsSelected).First();
                if (selectedItemModel.FilePath != null)
                {
                    // go to the play panel
                    PageModel.GetInstance.VisibleMenuItemModels.Where(m => m.IsSelected).First().RelayCommand.Execute(null);
                }
                else
                {
                    // go to the next sub folder
                    PageModel.GetInstance.VisibleMenuItemModels.Where(m => m.IsSelected).First().RelayCommand.Execute(null);

                    MediaPlayerModel.GetInstance.PreviewMedia(false);
                }
            }
            PageModel.GetInstance.DoBreadCrumbs(this.ComponentName);
        }