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


C# UIComponent.Find方法代码示例

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


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

示例1: Start

        public void Start()
        {
            m_view = UIView.GetAView();

            m_selectAIPanel = m_view.FindUIComponent<SelectAIPanel>("SelectAIPanel");
            m_uiContainer = m_view.FindUIComponent("FullScreenContainer");
            m_propPanel = m_uiContainer.Find<UIPanel>("DecorationProperties");

            m_toolController = ToolsModifierControl.toolController;
            m_selectAIPanel.eventValueChanged += OnAIFieldChanged;
            m_toolController.eventEditPrefabChanged += OnEditPrefabChanged;
        }
开发者ID:dluechoy,项目名称:BuildingAIChanger,代码行数:12,代码来源:EditorController.cs

示例2: onPanelEnter

 /// <summary>
 /// If the mouse enters the slider, this method shows percentage and hides total value.
 /// Displays the slider in slim mode.
 /// </summary>
 /// <param name="panel">The slider object the player hovers over</param>
 private void onPanelEnter(UIComponent panel)
 {
     UILabel total = panel.Find<UILabel>("Total");
     total.isVisible = false;
     UILabel percentage = panel.Find<UILabel>("Percentage");
     percentage.isVisible = true;
     UISlider slider = panel.Find<UISlider>("Slider");
     percentage.text = "" + slider.value;
     if (Parent.mode == Mode.Slim)
     {
         panel.width = 355;
         slider.isVisible = true;
         slider.size = new Vector2(210, slider.height); // fixes a bug (slider too long otherwise)
         if (Parent.isLeft)
         {
             UISprite icon = panel.Find<UISprite>("Icon");
             icon.relativePosition = new Vector3(315, icon.relativePosition.y);
             percentage.relativePosition = new Vector3(10, cs.percentageY);
             total.relativePosition = new Vector3(10, cs.totalY);
         }
         else
         {
             percentage.relativePosition = new Vector3(265, cs.percentageY);
             total.relativePosition = new Vector3(265, cs.totalY);
         }
     }
     else if (Parent.mode == Mode.noSlider)
     {
         UIButton buttonPlus = panel.Find<UIButton>("Budget Plus One Button");
         UIButton buttonMinus = panel.Find<UIButton>("Budget Minus One Button");
         buttonPlus.isVisible = true;
         buttonMinus.isVisible = true;
     }
 }
开发者ID:LazyFiL,项目名称:BetterBudget,代码行数:39,代码来源:BBSliderContainer.cs


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