本文整理汇总了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;
}
示例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;
}
}