示例#1
0
 // 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;
         }
     }
 }
示例#2
0
    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)));
        }
示例#4
0
 protected void Page_Init()
 {
     if (_popupTemplate != null)
     {
         var container = new PopupContainer();
         _popupTemplate.InstantiateIn(container);
         popupContent.Controls.Add(container);
     }
 }
示例#5
0
    public override void onRightClick()
    {
        PopupContainer popup = Main.instance.findPopup <PopupContainer>();

        if (popup != null)
        {
            popup.open();
            popup.setInventory(this.inventory);
        }
    }
示例#6
0
文件: Popup.cs 项目: tapenjoyGame/cry
    public PopupContainer PopStacks()     //讲栈中元素全部弹出
    {
        var container = new PopupContainer(mPopupStack);

        GetCurrentPopup().SetActive(false);
        gameObject.SetActive(false);

        mPopupStack.Clear();

        return(container);
    }
示例#7
0
 protected override void Dispose(bool disposing)
 {
     if (disposing)
     {
         if (Grid != null)
         {
             Grid.Dispose();
         }
         if (PopupContainer != null)
         {
             PopupContainer.Dispose();
         }
     }
     base.Dispose(disposing);
 }
示例#8
0
    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)));
        }
示例#11
0
        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);
        }
示例#13
0
        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)));
        }
示例#14
0
 public virtual void Close()
 {
     PopupContainer.Close();
     Destroy(gameObject);
 }
示例#15
0
 public void AddPopup(PopupContainer obj)
 {
     parms.AddPopup(obj);
 }
示例#16
0
文件: Popup.cs 项目: tapenjoyGame/cry
    public void PushStacks(PopupContainer container)
    {
        mPopupStack.AddRange(container.Stacks);         //讲contaimer这个列表放到mPopupStack 的末尾

        Show(false, GetCurrentPopup().bShowImmediately);
    }
示例#17
0
 public Popup()
 {
     popupContainer = new PopupContainer();
 }
示例#18
0
 //////////////////////////////////////////////////////////
 //for Popup
 public void AddPopup(PopupContainer obj) //添加 弹出框
 {
     AddParam(keyPopup, obj);
 }
示例#19
0
 /// <summary>
 /// 初期化
 /// </summary>
 /// <param name="container"></param>
 public void Initialize(PopupContainer container)
 {
     this.container = container;
 }
示例#20
0
文件: Popup.cs 项目: Ref12/Grazor
 public Popup()
 {
     popupContainer = new PopupContainer();
 }
示例#21
0
 public ShowPopupTask(PopupContainer popupContainer, String uniqueName, String name, String iconName, String category, int weight)
     : this(popupContainer, uniqueName, name, iconName, category)
 {
     this.Weight = weight;
 }
示例#22
0
 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);
 }
示例#23
0
    // 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();
    }
示例#24
0
 public void OnPlayButtonClick()
 {
     PopupContainer.CreatePopup(PopupType.StartPopup).Init();
 }
示例#25
0
 public virtual void Init(int id = -1)
 {
     PopupContainer.Pop(this);
 }