本文整理汇总了C#中UIPanel.Find方法的典型用法代码示例。如果您正苦于以下问题:C# UIPanel.Find方法的具体用法?C# UIPanel.Find怎么用?C# UIPanel.Find使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UIPanel
的用法示例。
在下文中一共展示了UIPanel.Find方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateGraphics
internal void CreateGraphics()
{
try {
var uiView = UIView.GetAView();
TextureDB.LoadFavCimsTextures();
Atlas.LoadAtlasIcons();
////////////////////////////////////////////////
///////////Favorite Button Manu Panel/////////
///////////////////////////////////////////////
//MainMenuPos = UIView.GetAView().FindUIComponent<UITabstrip> ("MainToolstrip");
MainMenuPos = UIView.Find<UITabstrip> ("MainToolstrip");
if(MainMenuPos.Find<FavoritesCimsButton>("FavCimsMenuPanel") != null) {
FavCimsMenuPanel = MainMenuPos.Find<FavoritesCimsButton>("FavCimsMenuPanel");
}else{
FavCimsMenuPanel = MainMenuPos.AddUIComponent(typeof(FavoritesCimsButton)) as FavoritesCimsButton;
}
////////////////////////////////////////////////
////////////////Favorite Panel////////////////
///////////////////////////////////////////////
FullScreenContainer = UIView.Find<UIPanel> ("FullScreenContainer");
FavCimsPanel = FullScreenContainer.AddUIComponent<FavoriteCimsMainPanel> ();
FavCimsPanel.Hide ();
FullScreenContainer.eventMouseDown += delegate {
if (!FavCimsPanel.containsMouse) {
FavCimsPanel.SendToBack ();
} else {
FavCimsPanel.BringToFront ();
}
};
////////////////////////////////////////////////
////////////Humans Button & Subscribe///////////
///////////////////////////////////////////////
FavCimsHumanPanel = FullScreenContainer.Find<UIPanel> ("(Library) CitizenWorldInfoPanel");
if (FavCimsHumanPanel != null) {
if(FavCimsHumanPanel.GetComponentInChildren<AddToFavButton>() != null) {
FavStarButton = FavCimsHumanPanel.GetComponentInChildren<AddToFavButton>();
}else{
FavStarButton = FavCimsHumanPanel.AddUIComponent(typeof(AddToFavButton)) as AddToFavButton;
}
}
GenerateFamilyDetailsTpl();
} catch (Exception e) {
Debug.Error ("OnLoad List Error : " + e.ToString ());
}
}
示例2: Initialize
protected override void Initialize()
{
panel = UIUtil.CreateSlider(this, _description, 0, 100, 1, 50, Slider_onValueChanged);
label = panel.Find<UILabel>("Label");
Slider = panel.Find<UISlider>("Slider");
}
示例3: InitializeModSortDropDown
private static void InitializeModSortDropDown()
{
if (GameObject.Find("ModsSortBy") != null)
{
return;
}
var shadows = GameObject.Find("Shadows").GetComponent<UIPanel>();
if (shadows == null)
{
return;
}
var moarGroup = GameObject.Find("MoarGroup").GetComponent<UIPanel>();
if (moarGroup == null)
{
return;
}
var moarLabel = moarGroup.Find<UILabel>("Moar");
var moarButton = moarGroup.Find<UIButton>("Button");
moarGroup.position = new Vector3(moarGroup.position.x, -6.0f, moarGroup.position.z);
moarLabel.isVisible = false;
moarButton.isVisible = false;
sortDropDown = GameObject.Instantiate(shadows);
sortDropDown.gameObject.name = "ModsSortBy";
sortDropDown.transform.parent = moarGroup.transform;
sortDropDown.name = "ModsSortBy";
sortDropDown.Find<UILabel>("Label").isVisible = false;
var dropdown = sortDropDown.Find<UIDropDown>("ShadowsQuality");
dropdown.name = "SortByDropDown";
dropdown.size = new Vector2(200.0f, 24.0f);
dropdown.textScale = 0.8f;
dropdown.eventSelectedIndexChanged += (component, value) =>
{
sortMode = (SortMode)value;
RefreshPlugins();
};
var sprite = dropdown.Find<UIButton>("Sprite");
sprite.foregroundSpriteMode = UIForegroundSpriteMode.Scale;
var enumValues = Enum.GetValues(typeof(SortMode));
dropdown.items = new string[enumValues.Length];
int i = 0;
foreach (var value in enumValues)
{
dropdown.items[i] = String.Format("Sort by: {0}", EnumToString((SortMode)value));
i++;
}
}
示例4: closePanel
/// <summary>
/// If the mouse leaves the slider, this method shows total and hides percentage value.
/// </summary>
/// <param name="panel">The slider object the player hovers over</param>
private void closePanel(UIPanel panel)
{
UILabel total = panel.Find<UILabel>("Total");
total.isVisible = true;
UILabel percentage = panel.Find<UILabel>("Percentage");
percentage.isVisible = false;
if (Parent.mode == Mode.Slim)
{
panel.width = 130;
UIComponent slider = panel.Find("Slider");
slider.isVisible = false;
slider.size = new Vector2(210, slider.height);
if (Parent.isLeft)
{
UISprite icon = panel.Find<UISprite>("Icon");
icon.relativePosition = new Vector3(cs.iconX, icon.relativePosition.y);
percentage.relativePosition = new Vector3(cs.percentageX, cs.percentageY);
total.relativePosition = new Vector3(cs.totalX, cs.totalY);
}
else
{
percentage.relativePosition = new Vector3(45, cs.percentageY);
total.relativePosition = new Vector3(45, 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 = false;
buttonMinus.isVisible = false;
}
}