// Update is called once per frame void Update() { if (Input.GetKeyDown(KeyCode.Escape) && isBlock == false) { switch (scene.name) { case "Game": // 활성화된 팝업이 없는 경우 일시정지창 팝업 if (PopupContainer.GetActivatedPopup() == null) { PopupContainer.CreatePopup(PopupType.PausePopup).Init(); } // 활성화된 팝업이 존재하는 경우 팝업 종료 else { BasePopup popup = PopupContainer.GetActivatedPopup(); ResultPopup resultPopup = popup as ResultPopup; if (resultPopup == null) { popup.Close(); } } break; } } }
IEnumerator CoEndGame() { yield return(new WaitForSeconds(1)); // 결과창 팝업 PopupContainer.CreatePopup(PopupType.ResultPopup).Init(Score + ItemScore); }
public void TestAltPos() { var wrap = new LayoutContainer(); var container = new PopupContainer { CustomMinimumSize = (100, 100) }; wrap.AddChild(container); // Need this wrapper so that container has the correct size. wrap.ForceRunLayoutUpdate(); var popup = new Control { CustomMinimumSize = (50, 50) }; container.AddChild(popup); PopupContainer.SetPopupOrigin(popup, (75, 75)); PopupContainer.SetAltOrigin(popup, (65, 25)); container.ForceRunLayoutUpdate(); Assert.That(popup.Position, Is.EqualTo(new Vector2(15, 25))); Assert.That(popup.Size, Is.EqualTo(new Vector2(50, 50))); }
protected void Page_Init() { if (_popupTemplate != null) { var container = new PopupContainer(); _popupTemplate.InstantiateIn(container); popupContent.Controls.Add(container); } }
public override void onRightClick() { PopupContainer popup = Main.instance.findPopup <PopupContainer>(); if (popup != null) { popup.open(); popup.setInventory(this.inventory); } }
public PopupContainer PopStacks() //讲栈中元素全部弹出 { var container = new PopupContainer(mPopupStack); GetCurrentPopup().SetActive(false); gameObject.SetActive(false); mPopupStack.Clear(); return(container); }
protected override void Dispose(bool disposing) { if (disposing) { if (Grid != null) { Grid.Dispose(); } if (PopupContainer != null) { PopupContainer.Dispose(); } } base.Dispose(disposing); }
public override void onRightClick() { base.onRightClick(); PopupContainer popup = Main.instance.findPopup <PopupContainer>(); if (popup != null) { popup.open(); popup.setInventory(this.inventory); } else { Debug.LogWarning("Could not find PopupContainer"); } }
private void _initializeCommon() { RootControl = new Control { Name = "UIRoot", MouseFilter = Control.MouseFilterMode.Ignore, IsInsideTree = true }; RootControl.Size = _displayManager.ScreenSize / UIScale; _displayManager.OnWindowResized += args => _updateRootSize(); StateRoot = new LayoutContainer { Name = "StateRoot", MouseFilter = Control.MouseFilterMode.Ignore }; RootControl.AddChild(StateRoot); WindowRoot = new LayoutContainer { Name = "WindowRoot", MouseFilter = Control.MouseFilterMode.Ignore }; RootControl.AddChild(WindowRoot); PopupRoot = new LayoutContainer { Name = "PopupRoot", MouseFilter = Control.MouseFilterMode.Ignore }; RootControl.AddChild(PopupRoot); ModalRoot = new PopupContainer { Name = "ModalRoot", MouseFilter = Control.MouseFilterMode.Ignore, }; RootControl.AddChild(ModalRoot); _tooltip = new Tooltip(); PopupRoot.AddChild(_tooltip); _tooltip.Visible = false; }
public void Test() { var wrap = new LayoutContainer(); var container = new PopupContainer { CustomMinimumSize = (100, 100) }; wrap.AddChild(container); // Need this wrapper so that container has the correct size. wrap.ForceRunLayoutUpdate(); var popup = new Control { CustomMinimumSize = (50, 50) }; container.AddChild(popup); PopupContainer.SetPopupOrigin(popup, (25, 25)); container.ForceRunLayoutUpdate(); Assert.That(popup.Position, Is.EqualTo(new Vector2(25, 25))); Assert.That(popup.Size, Is.EqualTo(new Vector2(50, 50))); // Test that pos gets pushed back to the top left if the size + offset is too large to fit. PopupContainer.SetPopupOrigin(popup, (75, 75)); container.ForceRunLayoutUpdate(); Assert.That(popup.Position, Is.EqualTo(new Vector2(50, 50))); Assert.That(popup.Size, Is.EqualTo(new Vector2(50, 50))); // Test that pos = 0 if the popup is too large to fit. popup.CustomMinimumSize = (150, 150); container.ForceRunLayoutUpdate(); Assert.That(popup.Position, Is.EqualTo(new Vector2(0, 0))); Assert.That(popup.Size, Is.EqualTo(new Vector2(150, 150))); }
public void Test() { var container = new PopupContainer { MinSize = (100, 100) }; container.Arrange(new UIBox2(0, 0, 100, 100)); var popup = new Control { MinSize = (50, 50) }; container.AddChild(popup); PopupContainer.SetPopupOrigin(popup, (25, 25)); container.InvalidateArrange(); container.Arrange(new UIBox2(0, 0, 100, 100)); Assert.That(popup.Position, Is.EqualTo(new Vector2(25, 25))); Assert.That(popup.Size, Is.EqualTo(new Vector2(50, 50))); // Test that pos gets pushed back to the top left if the size + offset is too large to fit. PopupContainer.SetPopupOrigin(popup, (75, 75)); container.InvalidateArrange(); container.Arrange(new UIBox2(0, 0, 100, 100)); Assert.That(popup.Position, Is.EqualTo(new Vector2(50, 50))); Assert.That(popup.Size, Is.EqualTo(new Vector2(50, 50))); // Test that pos = 0 if the popup is too large to fit. popup.MinSize = (150, 150); container.InvalidateArrange(); container.Arrange(new UIBox2(0, 0, 100, 100)); Assert.That(popup.Position, Is.EqualTo(new Vector2(0, 0))); Assert.That(popup.Size, Is.EqualTo(new Vector2(150, 150))); }
private void _initializeCommon() { RootControl = new Control { Name = "UIRoot", MouseFilter = Control.MouseFilterMode.Ignore, IsInsideTree = true }; RootControl.Size = GUIGameComponent.ScreenSize / UIScale; //TODO: GUIGameComponent.Singleton.OnWindowResized += args => _updateRootSize(); StateRoot = new LayoutContainer { Name = "StateRoot", MouseFilter = Control.MouseFilterMode.Ignore }; RootControl.AddChild(StateRoot); WindowRoot = new LayoutContainer { Name = "WindowRoot", MouseFilter = Control.MouseFilterMode.Ignore }; RootControl.AddChild(WindowRoot); PopupRoot = new LayoutContainer { Name = "PopupRoot", MouseFilter = Control.MouseFilterMode.Ignore }; RootControl.AddChild(PopupRoot); ModalRoot = new PopupContainer { Name = "ModalRoot", MouseFilter = Control.MouseFilterMode.Ignore, }; RootControl.AddChild(ModalRoot); }
public void TestAltPos() { var container = new PopupContainer { MinSize = (100, 100) }; container.Arrange(new UIBox2(0, 0, 100, 100)); var popup = new Control { MinSize = (50, 50) }; container.AddChild(popup); PopupContainer.SetPopupOrigin(popup, (75, 75)); PopupContainer.SetAltOrigin(popup, (65, 25)); container.InvalidateArrange(); container.Arrange(new UIBox2(0, 0, 100, 100)); Assert.That(popup.Position, Is.EqualTo(new Vector2(15, 25))); Assert.That(popup.Size, Is.EqualTo(new Vector2(50, 50))); }
public virtual void Close() { PopupContainer.Close(); Destroy(gameObject); }
public void AddPopup(PopupContainer obj) { parms.AddPopup(obj); }
public void PushStacks(PopupContainer container) { mPopupStack.AddRange(container.Stacks); //讲contaimer这个列表放到mPopupStack 的末尾 Show(false, GetCurrentPopup().bShowImmediately); }
public Popup() { popupContainer = new PopupContainer(); }
////////////////////////////////////////////////////////// //for Popup public void AddPopup(PopupContainer obj) //添加 弹出框 { AddParam(keyPopup, obj); }
/// <summary> /// 初期化 /// </summary> /// <param name="container"></param> public void Initialize(PopupContainer container) { this.container = container; }
public ShowPopupTask(PopupContainer popupContainer, String uniqueName, String name, String iconName, String category, int weight) : this(popupContainer, uniqueName, name, iconName, category) { this.Weight = weight; }
public ShowPopupTask(PopupContainer popupContainer, String uniqueName, String name, String iconName, String category) : base(uniqueName, name, iconName, category) { this.popupContainer = popupContainer; popupContainer.Hidden += new EventHandler(popupContainer_Hidden); }
// IEnumerator CoScore () // { // float checkTime = 0; // while (true) // { // yield return new WaitForFixedUpdate(); // checkTime += Time.fixedDeltaTime; // if (checkTime >= 1) // { // checkTime -= 1; // UpdateScore(1); // } // } // } public void OnPauseButtonClick() { PopupContainer.CreatePopup(PopupType.PausePopup).Init(); }
public void OnPlayButtonClick() { PopupContainer.CreatePopup(PopupType.StartPopup).Init(); }
public virtual void Init(int id = -1) { PopupContainer.Pop(this); }