public UITitleTopPage(CanvasContainer canvasContainer) : base(canvasContainer) { _backgroundPresenter = CreatePresenter <UITitleBackgroundPresenter, UITitleBackgroundWindow>(canvasContainer.Canvases[0], UITitlePrefabPathDef.UITitleBackgroundWindow); _staffCreditPresenter = CreatePresenter <UITitleStaffCreditPresenter, UITitleStaffCreditDialog>(canvasContainer.Canvases[1], UITitlePrefabPathDef.UITitleStaffCreditDialog); _backgroundPresenter.SetActiveView(true); // イベントの購読 _backgroundPresenter .OnTapCreditButton .Subscribe(async _ => await _staffCreditPresenter.ShowAsync()) .AddTo(_backgroundPresenter.TargetView); _backgroundPresenter .OnPointerDown .Subscribe(async _ => await SceneManager.LoadSceneAsync(SceneDef.HomeScene)) .AddTo(_backgroundPresenter.TargetView); _staffCreditPresenter .ReturnButtonAsObservable .Subscribe(async _ => await _staffCreditPresenter.HideAsync()) .AddTo(_staffCreditPresenter.TargetView); }
public TicTacToePresenter(TicTacToeForm ticTacToeForm) { _gameCanvases = EnumUtil.GetListOfEnumElement <CanvasType>("Matrix"); _ticTacToeForm = ticTacToeForm; _canvasContainer = new CanvasContainer(); _network = new ActivationNetwork(new SigmoidFunction(2), 100, 14, 2); new BackPropagationLearning(_network); _pen = new Pen(Color.Black, 5); _crossDesignator = new CrossDesignator(); _network = (ActivationNetwork)Network.Load("Net.bin"); _gameUtil = new GameUtil(); _computerPlayer = new ComputerPlayer(_gameUtil, _gameCanvases); _board = new GameBoard(_gameCanvases); _game = new Game(_gameUtil, _board, _computerPlayer); _ticTacToeForm.DrawAction += Draw; _ticTacToeForm.LearnAction += ExecuteLearnAction; _ticTacToeForm.CrossAction += ExecuteCrossAction; _ticTacToeForm.CircleAction += ExecuteCircleAction; _ticTacToeForm.ClearAction += ExecuteClearAction; _ticTacToeForm.CopyAction += ExecuteCopyAction; _ticTacToeForm.TestAction += ExecuteTestAction; _ticTacToeForm.NewGameAction += ExecuteNewGameAction; _ticTacToeForm.PlayAction += ExecutePlayAction; _ticTacToeForm.BackAction += ExecuteBackAction; _lastModifiedCanvas = CanvasType.Matrix11; _paintFactory = new PaintFactory(_pen, _crossDesignator); }
public ViewFactory(CanvasContainer canvasContainer, ViewsContainer viewsContainer, ICameraManager cameraManager, ILoggerManager loggerManager) { _cameraManager = cameraManager; _canvasContainer = canvasContainer; _viewsContainer = viewsContainer; _logger = loggerManager.GetLogger(); }
public void GetEnumerator_WithChildren_EnumeratorMatchesChildren() { CanvasContainer container = new CanvasContainer(); CanvasObject co = new ButtonObject(); container.Add(co); Assert.AreEqual(1, container.Count()); }
public UIInGameBattlePage(CanvasContainer canvasContainer) : base(canvasContainer) { _inGameBattlePresenter = CreatePresenter <UIInGameBattlePresenter, UIInGameBattleWindow>(canvasContainer.Canvases[0], UIInGamePrefabPathDef.UIInGameBattleWindow); _inGameBattlePresenter.SetActiveView(true); _inGameBattlePresenter.InitializeUIInGameBattleWindow(canvasContainer.Canvases[0].GetCamera()); }
public void Draw_WithChildren_DrawForwarded() { CanvasContainer container = new CanvasContainer(); DummyObject co = new DummyObject(); container.Add(co); container.Draw(null, null); Assert.AreEqual(1, co.drawCount); }
public UIHomeTopPage(CanvasContainer canvasContainer) : base(canvasContainer) { _backgroundPresenter = CreatePresenter <UIHomeBackgroundPresenter, UIHomeBackgroundWindow>(canvasContainer.Canvases[0], UIHomePrefabPathDef.UIHomeBackgroundWindow); _backgroundPresenter.SetActiveView(true); _backgroundPresenter .OnTapMatchingButton .Subscribe(_ => ShowPage <UIHomeMatchingPage>(canvasContainer)) .AddTo(_backgroundPresenter.TargetView); }
public UIHomeMatchingPage(CanvasContainer canvasContainer) : base(canvasContainer) { _matchingTopPresenter = CreatePresenter <UIHomeMatchingTopPresenter, UIHomeMatchingTopWindow>(canvasContainer.Canvases[0], UIHomePrefabPathDef.UIHomeMatchingTopWindow); _matchingTopPresenter.ShowWindowCommonAsync().Forget(); _matchingTopPresenter .OnTapReturnButton .Subscribe(_ => ShowPage <UIHomeTopPage>(canvasContainer)) .AddTo(_matchingTopPresenter.TargetView); }
public void Add_Child_ChildAddedCollectionChangedTriggered() { int collectionChangedCount = 0; CanvasContainer container = new CanvasContainer(); container.CollectionChanged += (sender, e) => collectionChangedCount++; CanvasObject co = new ButtonObject(); container.Add(co); Assert.AreEqual(1, collectionChangedCount); Assert.AreEqual(1, container.Count); }
public void Clear_Existing_AllChildRemoved() { int collectionChangedCount = 0; CanvasContainer container = new CanvasContainer(); CanvasObject co = new ButtonObject(); container.Add(co); container.CollectionChanged += (sender, e) => collectionChangedCount++; container.Clear(); Assert.AreEqual(1, collectionChangedCount); Assert.AreEqual(0, container.Count); }
public void Add_ChildRedraw_RedrawForwarded() { int redrawCount = 0; CanvasContainer container = new CanvasContainer(); container.RedrawEvent += (c, area) => redrawCount++; CanvasObject co = new ButtonObject(); container.Add(co); co.ReDraw(); Assert.AreEqual(1, redrawCount); }
private void Viewmodel_PropertyChanged(object sender, PropertyChangedEventArgs e) { if (e.PropertyName == nameof(ViewModel.Card)) { if (ViewModel.Card != null) { GoToState(CardDataName); CanvasContainer.AbortAnimation(ThrobAnimationName); } else { GoToState(NoCardDataName); CanvasContainer.Animate(ThrobAnimationName, _promptThrobAnimation, rate: 16, length: 3000, repeat: () => true); } } }
private void BuildCanvas(Transform homeMainTransform, ICamera homeUICamera) { // CanvasのPrefabのパスのリスト var canvasPaths = new List <string>() { UICommonDef.App0CanvasPrefabPath, UICommonDef.App1CanvasPrefabPath }; var canvasPathParams = new CanvasPathParams(UICommonDef.CanvasRootName, canvasPaths); var canvasRoot = EmptyObjectFactory.Create(canvasPathParams.CanvasRootName, homeMainTransform); _canvasContainer = CanvasBuilder.BuildCanvases(homeUICamera, canvasPathParams, UICommonDef.UITouchBlockWindow, canvasRoot.transform); }
void CreateCanvas() { GameObject cnvs = Instantiate(canvasPrefab, transform.position, Quaternion.identity) as GameObject; cnvs.name = "CanvasMain"; cnvs.transform.SetParent(transform); cnvs.transform.position = Vector2.zero; canvasContainer = cnvs.GetComponent <CanvasContainer>(); dialogAnimator = canvasContainer.dialogAnimator; dialogText = canvasContainer.dialogText; actionFeedbackController = canvasContainer.actionFeedback; gui.healthbar = canvasContainer.healthbar; gui.saveAnimator = canvasContainer.saveAnimator; gui.reloadController = canvasContainer.reloadController; gui.fadeAnimator = canvasContainer.fadeAnimator; gui.fadeImg = canvasContainer.fadeImg; inventory = canvasContainer.inventory; canvasContainer.SetRenderCamera(); }
void Initialize() { container = transform.parent.gameObject.GetComponent <CanvasContainer>(); gridSize = CanvasContainer.size; }
public static TPage Create(CanvasContainer canvasContainer) { _delegateCache ??= CreateInstanceDelegate(); return(_delegateCache(canvasContainer)); }
protected void ShowPage <TPage>(CanvasContainer canvasContainer) where TPage : IPage { PageFactory <TPage> .Create(canvasContainer); Dispose(); }
protected PageBase(CanvasContainer canvasContainer) { }
void Start() { canvasContainer = transform.GetComponentInParent <CanvasContainer>(); }