private void Awake() { GuideUI.Instance = this; GameObject gameObject = GameObject.FindWithTag("UICamera"); if (gameObject == null) { return; } this.uiCamera = gameObject.GetComponent <Camera>(); if (this.uiCamera == null) { LogSystem.LogWarning(new object[] { "UICamera is not find" }); return; } if (this.uiCamera.gameObject.GetComponent <UICamera>() == null) { this.uiCamera.gameObject.AddComponent <UICamera>(); } if ((float)ResolutionConstrain.Instance.width * 1f / (float)ResolutionConstrain.Instance.height >= 1.77777779f) { this.uiCamera.orthographicSize = 720f / (float)ResolutionConstrain.Instance.height; } else { this.uiCamera.orthographicSize = 1280f / (float)ResolutionConstrain.Instance.width; } }
private void OnDestroy() { if (this.muiEffect != null) { UnityEngine.Object.Destroy(this.muiEffect); this.muiEffect = null; } if (this.muiBackPanel != null) { UnityEngine.Object.Destroy(this.muiBackPanel); this.muiBackPanel = null; } if (this.uiLoading != null) { UnityEngine.Object.Destroy(this.uiLoading); this.uiLoading = null; } this.uiCamera = null; this.mlblRate = null; this.moMessageBox = null; this.uiMessageBox = null; this.mOkCallback = null; this.mCancelCallback = null; this.uiLoading = null; this.muiBackPanel = null; this.m_UIProgressLabel = null; this.m_UIProgressRate = null; this.m_UIProgressThumb = null; this.m_UIProgressEffect = null; this.mlblDestVersion = null; this.mlblSourceVersion = null; this.mSpLeft = null; this.mSpRight = null; this.mSpIcon = null; GuideUI.Instance = null; }
private void ShowUI() { if (mGuideUI == null) { GameObject obj = WindowManager.Instance.CloneCommonUI("GuideArrowUI"); obj.SetActive(false); GameObject.DontDestroyOnLoad(obj); mGuideUI = new GuideUI(obj); } if (mGuideUI != null && !mGuideUI.IsOpned()) { mGuideUI.Open(); if (!mGuideRuntime.IsWeak()) { InputSystem.Instance.SetLockMove(true); } } if (mGuideTalkUI != null && mGuideTalkUI.IsOpened()) { mGuideTalkUI.Show(); } }
private void Awake() { this.muiGuide = UnityEngine.Object.FindObjectOfType <GuideUI>(); }
private void Awake() { base.gameObject.AddComponent <WebStreamLoader>(); this.muiGuide = UnityEngine.Object.FindObjectOfType <GuideUI>(); }
public SixtySix2PlayerMainView(IEventAggregator aggregator, TestOptions test, SixtySix2PlayerVMData model, IGamePackageResolver resolver ) { _aggregator = aggregator; _model = model; _resolver = resolver; _aggregator.Subscribe(this); _deckGPile = new BaseDeckWPF <SixtySix2PlayerCardInformation, ts, DeckOfCardsWPF <SixtySix2PlayerCardInformation> >(); _discardGPile = new BasePileWPF <SixtySix2PlayerCardInformation, ts, DeckOfCardsWPF <SixtySix2PlayerCardInformation> >(); _score = new ScoreBoardWPF(); _playerHandWPF = new BaseHandWPF <SixtySix2PlayerCardInformation, ts, DeckOfCardsWPF <SixtySix2PlayerCardInformation> >(); _trick1 = new TwoPlayerTrickWPF <EnumSuitList, SixtySix2PlayerCardInformation, ts, DeckOfCardsWPF <SixtySix2PlayerCardInformation> >(); _deckStack = new StackPanel(); _marriage1 = new BaseHandWPF <SixtySix2PlayerCardInformation, ts, DeckOfCardsWPF <SixtySix2PlayerCardInformation> >(); _guide1 = new GuideUI(); StackPanel mainStack = new StackPanel(); ParentSingleUIContainer?restoreP = null; if (test.SaveOption == EnumTestSaveCategory.RestoreOnly) { restoreP = new ParentSingleUIContainer() { Name = nameof(SixtySix2PlayerMainViewModel.RestoreScreen) }; } StackPanel otherStack = new StackPanel(); otherStack.Orientation = Orientation.Horizontal; otherStack.Children.Add(_deckStack); _deckStack.Children.Add(_discardGPile); // can reposition or not even have as well. mainStack.Children.Add(otherStack); _score.AddColumn("Cards Left", true, nameof(SixtySix2PlayerPlayerItem.ObjectCount)); _score.AddColumn("Tricks Won", true, nameof(SixtySix2PlayerPlayerItem.TricksWon)); _score.AddColumn("Score Round", true, nameof(SixtySix2PlayerPlayerItem.ScoreRound)); _score.AddColumn("Game Points Round", true, nameof(SixtySix2PlayerPlayerItem.GamePointsRound)); _score.AddColumn("Total Points Game", true, nameof(SixtySix2PlayerPlayerItem.GamePointsGame)); SimpleLabelGrid firstInfo = new SimpleLabelGrid(); firstInfo.AddRow("Turn", nameof(SixtySix2PlayerMainViewModel.NormalTurn)); firstInfo.AddRow("Trump", nameof(SixtySix2PlayerMainViewModel.TrumpSuit)); firstInfo.AddRow("Status", nameof(SixtySix2PlayerMainViewModel.Status)); firstInfo.AddRow("Bonus", nameof(SixtySix2PlayerMainViewModel.BonusPoints)); otherStack.Children.Add(_trick1); mainStack.Children.Add(_playerHandWPF); mainStack.Children.Add(firstInfo.GetContent); mainStack.Children.Add(_score); otherStack = new StackPanel(); otherStack.Orientation = Orientation.Horizontal; var thisBut = GetGamingButton("Go Out", nameof(SixtySix2PlayerMainViewModel.GoOutAsync)); otherStack.Children.Add(thisBut); thisBut = GetGamingButton("Announce Marriage", nameof(SixtySix2PlayerMainViewModel.AnnouceMarriageAsync)); otherStack.Children.Add(thisBut); mainStack.Children.Add(otherStack); mainStack.Children.Add(_marriage1); Grid finalGrid = new Grid(); AddLeftOverColumn(finalGrid, 60); AddLeftOverColumn(finalGrid, 40); // hopefully that works. AddControlToGrid(finalGrid, mainStack, 0, 0); AddControlToGrid(finalGrid, _guide1, 0, 1); _deckGPile.Margin = new Thickness(5, 5, 5, 5); _discardGPile.Margin = new Thickness(5, 5, 5, 5); if (restoreP != null) { mainStack.Children.Add(restoreP); //default add to grid but does not have to. } Content = finalGrid; }
public Pinochle2PlayerMainView(IEventAggregator aggregator, TestOptions test, Pinochle2PlayerVMData model, IGamePackageResolver resolver ) { _aggregator = aggregator; _model = model; _resolver = resolver; _aggregator.Subscribe(this); _deckGPile = new BaseDeckWPF <Pinochle2PlayerCardInformation, ts, DeckOfCardsWPF <Pinochle2PlayerCardInformation> >(); _discardGPile = new BasePileWPF <Pinochle2PlayerCardInformation, ts, DeckOfCardsWPF <Pinochle2PlayerCardInformation> >(); _score = new ScoreBoardWPF(); _playerHandWPF = new BaseHandWPF <Pinochle2PlayerCardInformation, ts, DeckOfCardsWPF <Pinochle2PlayerCardInformation> >(); _trick1 = new TwoPlayerTrickWPF <EnumSuitList, Pinochle2PlayerCardInformation, ts, DeckOfCardsWPF <Pinochle2PlayerCardInformation> >(); _guide1 = new GuideUI(); _deckStack = new StackPanel(); _yourMeld = new BaseHandWPF <Pinochle2PlayerCardInformation, ts, DeckOfCardsWPF <Pinochle2PlayerCardInformation> >(); _opponentMeld = new BaseHandWPF <Pinochle2PlayerCardInformation, ts, DeckOfCardsWPF <Pinochle2PlayerCardInformation> >(); _tempG = new TempRummySetsWPF <EnumSuitList, EnumColorList, Pinochle2PlayerCardInformation, ts, DeckOfCardsWPF <Pinochle2PlayerCardInformation> >(); _trick1.Width = 500; // i think. _yourMeld.Divider = 1.5; _opponentMeld.Divider = 1.5; _yourMeld.HandType = HandObservable <Pinochle2PlayerCardInformation> .EnumHandList.Vertical; _opponentMeld.HandType = HandObservable <Pinochle2PlayerCardInformation> .EnumHandList.Vertical; _tempG.Height = 250; //i think. StackPanel mainStack = new StackPanel(); ParentSingleUIContainer?restoreP = null; if (test.SaveOption == EnumTestSaveCategory.RestoreOnly) { restoreP = new ParentSingleUIContainer() { Name = nameof(Pinochle2PlayerMainViewModel.RestoreScreen) }; } StackPanel otherStack = new StackPanel(); otherStack.Orientation = Orientation.Horizontal; otherStack.Children.Add(_deckStack); _deckStack.Children.Add(_discardGPile); otherStack.Children.Add(_trick1); otherStack.Children.Add(_tempG); mainStack.Children.Add(otherStack); _score.AddColumn("Cards Left", false, nameof(Pinochle2PlayerPlayerItem.ObjectCount)); //very common. _score.AddColumn("Tricks Won", false, nameof(Pinochle2PlayerPlayerItem.TricksWon)); _score.AddColumn("Current Score", false, nameof(Pinochle2PlayerPlayerItem.CurrentScore)); _score.AddColumn("Total Score", false, nameof(Pinochle2PlayerPlayerItem.TotalScore)); SimpleLabelGrid firstInfo = new SimpleLabelGrid(); firstInfo.AddRow("Turn", nameof(Pinochle2PlayerMainViewModel.NormalTurn)); firstInfo.AddRow("Trump", nameof(Pinochle2PlayerMainViewModel.TrumpSuit)); firstInfo.AddRow("Status", nameof(Pinochle2PlayerMainViewModel.Status)); mainStack.Children.Add(_playerHandWPF); var endButton = GetGamingButton("End Turn", nameof(Pinochle2PlayerMainViewModel.EndTurnAsync)); endButton.HorizontalAlignment = HorizontalAlignment.Left; var meldBut = GetGamingButton("Meld", nameof(Pinochle2PlayerMainViewModel.MeldAsync)); otherStack = new StackPanel(); otherStack.Orientation = Orientation.Horizontal; StackPanel tempStack = new StackPanel(); tempStack.Children.Add(meldBut); tempStack.Children.Add(endButton); otherStack.Children.Add(tempStack); otherStack.Children.Add(_yourMeld); otherStack.Children.Add(_opponentMeld); mainStack.Children.Add(otherStack); StackPanel scoreStack = new StackPanel(); scoreStack.Children.Add(_score); scoreStack.Children.Add(firstInfo.GetContent); scoreStack.Children.Add(_guide1); Grid finalGrid = new Grid(); AddLeftOverColumn(finalGrid, 70); AddLeftOverColumn(finalGrid, 30); // hopefully that works. AddControlToGrid(finalGrid, mainStack, 0, 0); AddControlToGrid(finalGrid, scoreStack, 0, 1); _deckGPile.Margin = new Thickness(5, 5, 5, 5); _discardGPile.Margin = new Thickness(5, 5, 5, 5); if (restoreP != null) { //todo: figure out where to place the restore ui if there is a restore option. mainStack.Children.Add(restoreP); //default add to grid but does not have to. } Content = finalGrid; }
private void InitGuideUI() { GameObject gameObject = new GameObject("GuideUI"); this.guideui = gameObject.AddComponent <GuideUI>(); }