当前位置: 首页>>代码示例>>C#>>正文


C# UIButton.Hide方法代码示例

本文整理汇总了C#中UIButton.Hide方法的典型用法代码示例。如果您正苦于以下问题:C# UIButton.Hide方法的具体用法?C# UIButton.Hide怎么用?C# UIButton.Hide使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UIButton的用法示例。


在下文中一共展示了UIButton.Hide方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Start

        public override void Start()
        {
            base.Start ();
            Debug.PrintMessage ("Creating ChallengePanel");
            this.width = WIDTH;
            this.height = HEAD;
            if (m_challenge != null && m_challenge.Goals != null) { //covers case when the panel reassignes hieght to be head even with a challenge being loaded
                this.height = HEAD + GoalProgressPanel.SPACING + m_challenge.Goals.Length * (GoalProgressPanel.HEIGHT+GoalProgressPanel.SPACING);
            }
            this.backgroundSprite = "MenuPanel";
            this.Hide ();
            this.relativePosition = new Vector3 (10,GetUIView().fixedHeight - height - 135);

            m_titleLabel = this.AddUIComponent<UILabel> ();
            m_titleLabel.text = "Challenges";
            m_titleLabel.textScale = 1.25f;
            m_titleLabel.size = new Vector2 (WIDTH,HEAD);
            m_titleLabel.relativePosition = new Vector3(SPACING,SPACING);

            m_drag = this.AddUIComponent<UIDragHandle> ();
            m_drag.width = this.width;
            m_drag.height = HEAD;
            m_drag.relativePosition = new Vector3(0,0,10);
            m_drag.target = this;

            m_closeButton = this.AddUIComponent<UIButton> ();
            m_closeButton.size = new Vector2 (CLOSE_BUTTON_SIZE, CLOSE_BUTTON_SIZE);
            m_closeButton.normalBgSprite = "buttonclose";
            m_closeButton.hoveredBgSprite = "buttonclosehover";
            m_closeButton.pressedBgSprite = "buttonclosepressed";
            m_closeButton.relativePosition = new Vector3 (WIDTH - 3f - m_closeButton.width, 5);
            Debug.PrintMessage(m_closeButton.size);
            m_closeButton.eventClick += (component, eventParam) => {
                this.Hide ();
            };

            m_startButton = this.AddUIComponent<UIButton> ();
            m_startButton.size = new Vector2 (BUTTON_WIDTH,BUTTON_HEIGHT);
            m_startButton.text = "Start";
            m_startButton.textScale = 0.875f;
            m_startButton.normalBgSprite = "ButtonMenu";
            m_startButton.hoveredBgSprite = "ButtonMenuHovered";
            m_startButton.pressedBgSprite = "ButtonMenuPressed";
            m_startButton.disabledBgSprite = "ButtonMenuDisabled";
            m_startButton.color = Color.green;
            m_startButton.focusedColor = m_startButton.color;
            m_startButton.hoveredColor = m_startButton.color;
            m_startButton.pressedColor = m_startButton.color;
            m_startButton.relativePosition = m_closeButton.relativePosition + new Vector3 (-BUTTON_WIDTH -SPACING,6f);

            //m_startButton.eventClick += StartChallenge;
            m_startButton.Disable ();
            m_startButton.Hide ();

            m_endButton = this.AddUIComponent<UIButton> ();
            m_endButton.size = m_startButton.size;
            m_endButton.text = "Forfeit";
            m_endButton.textScale = 0.875f;
            m_endButton.normalBgSprite = "ButtonMenu";
            m_endButton.hoveredBgSprite = "ButtonMenuHovered";
            m_endButton.pressedBgSprite = "ButtonMenuPressed";
            m_endButton.disabledBgSprite = "ButtonMenuDisabled";
            m_endButton.color = new Color32(255,0,0,255);
            m_endButton.focusedColor = m_endButton.color;
            m_endButton.hoveredColor = m_endButton.color;
            m_endButton.pressedColor = m_endButton.color;
            m_endButton.relativePosition = m_startButton.relativePosition;
            m_endButton.eventClick += AskForfeit;
            //m_startButton.disabledColor = Color.gray;
            //m_endButton.Disable ();
            //m_endButton.Hide ();
        }
开发者ID:CWMlolzlz,项目名称:Challenges,代码行数:72,代码来源:ChallengePanel.cs


注:本文中的UIButton.Hide方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。