本文整理汇总了C#中UISprite.BringToFront方法的典型用法代码示例。如果您正苦于以下问题:C# UISprite.BringToFront方法的具体用法?C# UISprite.BringToFront怎么用?C# UISprite.BringToFront使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UISprite
的用法示例。
在下文中一共展示了UISprite.BringToFront方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: start
/// <summary>
/// Creates all objects based on the given settings. Call this first.
/// </summary>
/// <param name="settings">The settings (only uses x and y position).</param>
public void start(BBPanelSettings settings)
{
relativePosition = new Vector3(settings.x, settings.y);
canFocus = true;
isInteractive = true;
isVisible = true;
backgroundSprite = "MenuPanel2";
color = new Color32(255, 255, 255, 255);
size = new Vector2(400,344);
name = "Better Budget - Custom Panel Creator";
UILabel label = AddUIComponent<UILabel>();
label.text = "Custom Panel Creator";
label.transform.parent = this.transform;
label.relativePosition = new Vector3((width/2) - ((label.text.Length/2)*8), 12);
label.name = "Title Label";
UIDragHandle draghandler = AddUIComponent<UIDragHandle>();
draghandler.relativePosition = new Vector3(0,0);
draghandler.transform.parent = this.transform;
draghandler.target = this;
draghandler.name = "Drag Handler";
// icon
_icon = AddUIComponent<UISprite>();
_icon.relativePosition = new Vector3(2, 2);
_icon.spriteName = "MoneyThumb";
_icon.size = new Vector2(40, 40);
_icon.eventClick += togglePanel;
_icon.BringToFront();
// container Unselected
_containerUnselected = AddUIComponent<UIPanel>();
_containerUnselected.name = "Slider Container Unselected";
_containerUnselected.backgroundSprite = "GenericPanel";
_containerUnselected.relativePosition = new Vector3(30, 60);
_containerUnselected.size = new Vector2(145, 145);
_containerUnselected.autoLayout = true;
_containerUnselected.autoSize = false;
_containerUnselected.autoLayoutStart = LayoutStart.TopLeft;
_containerUnselected.autoLayoutDirection = LayoutDirection.Horizontal;
_containerUnselected.autoLayoutPadding = new RectOffset(5, 0, 5, 0);
_containerUnselected.wrapLayout = true;
// Arrow
_spriteArrow = AddUIComponent<UISprite>();
_spriteArrow.name = "Arrow Sprite";
_spriteArrow.spriteName = "ArrowRight";
_spriteArrow.relativePosition = new Vector3(163, 100);
_spriteArrow.size = new Vector3(64, 64);
// container Selected
_containerSelected = AddUIComponent<UIPanel>();
_containerSelected.name = "Slider Container Selected";
_containerSelected.backgroundSprite = "GenericPanel";
_containerSelected.relativePosition = new Vector3(225, 60);
_containerSelected.size = new Vector2(145, 145);
_containerSelected.autoLayout = true;
_containerSelected.autoSize = false;
_containerSelected.autoLayoutStart = LayoutStart.TopLeft;
_containerSelected.autoLayoutDirection = LayoutDirection.Horizontal;
_containerSelected.autoLayoutPadding = new RectOffset(5, 0, 5, 0);
_containerSelected.wrapLayout = true;
// budget icons
for(int i = 0; i < spriteIcon.Length; i++)
{
UISprite sprite = _containerUnselected.AddUIComponent<UISprite>();
sprite.name = serviceSlider[i];
sprite.spriteName = spriteIcon[i];
sprite.size = new Vector2(30, 30);
sprite.eventClick += toggleSprite;
sprite.isInteractive = true;
}
// text field
_textfield = AddUIComponent<UITextField>();
_textfield.name = "Text Field Name";
_textfield.size = new Vector2(340,25);
_textfield.relativePosition = new Vector3(30, 225);
_textfield.text = "Budget";
_textfield.enabled = true;
_textfield.builtinKeyNavigation = true;
_textfield.isInteractive = true;
_textfield.readOnly = false;
_textfield.submitOnFocusLost = true;
_textfield.horizontalAlignment = UIHorizontalAlignment.Left;
_textfield.selectionSprite = "EmptySprite";
_textfield.selectionBackgroundColor = new Color32(0, 171, 234, 255);
_textfield.normalBgSprite = "TextFieldPanel";
_textfield.textColor = new Color32(174, 197, 211, 255);
_textfield.disabledTextColor = new Color32(254, 254, 254, 255);
_textfield.textScale = 1.3f;
_textfield.opacity = 1f;
_textfield.color = new Color32(58, 88, 104, 255);
_textfield.disabledColor = new Color32(254, 254, 254, 255);
// is Left toggle button and label
//.........这里部分代码省略.........