本文整理汇总了C#中UIWidget类的典型用法代码示例。如果您正苦于以下问题:C# UIWidget类的具体用法?C# UIWidget怎么用?C# UIWidget使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
UIWidget类属于命名空间,在下文中一共展示了UIWidget类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: OnInit
public override void OnInit()
{
base.OnInit();
m_SpriteMyIcon = FindChildComponent<UISprite>("Sprite_Icon1");
m_SpriteOtherIcon = FindChildComponent<UISprite>("Sprite_Icon0");
m_ObjButtonRoot = FindChild("ButtonRoot");
m_ObjButtonOk = FindChild("Button_Ok");
m_ObjButtonCancle = FindChild("Button_Cancle");
m_LabelMyName = FindChildComponent<UILabel>("Label_Name1");
m_LabelOtherName = FindChildComponent<UILabel>("Label_Name2");
var obj = FindChild("Button_Talk");
UIEventListener.Get(obj).onPress = OnPressButton;
AddChildElementClickEvent(OnClickBack, "Sprite_Exit");
m_DropPanel = FindChildComponent<UIWidget>("DrapPanel");
m_FireworkPlanList = new List<FireworkPlanElement>();
for (int i = 0; i < 7; ++i)
{
var objRoot = FindChild("Type_" + i);
FireworkPlanElement elem = new FireworkPlanElement(objRoot);
elem.SetStatus(true,ItemManager.Instance.IsExistItem(i));
m_FireworkPlanList.Add(elem);
MyUIDragDropItem drag = objRoot.GetComponent<MyUIDragDropItem>();
drag.RegisterDragEndAction(OnDragEnd);
//UIEventListener.Get(objRoot).onClick = OnClickItem;;
}
m_ObjButtonRoot.SetActive(false);
m_SpriteMyIcon.gameObject.SetActive(false);
m_SpriteOtherIcon.gameObject.SetActive(false);
m_LabelOtherName.text = string.Empty;
m_LabelMyName.text = PlayerManager.Instance.GetCharBaseData().CharName;
}
开发者ID:Blizzardx,项目名称:ClientFrameWork,代码行数:35,代码来源:UIWindowMsgTreeBuy.cs
示例2: SetRank
IEnumerator SetRank(){
//StartCoroutine("Wait", 5f);
//yield return new WaitForSeconds (2f);
GameObject.Find("Panel").transform.FindChild("Rank").gameObject.SetActive(true);
GameObject.Find("Panel").transform.FindChild("RankText").gameObject.SetActive(true);
wg2 = GameObject.Find("Panel").transform.FindChild("RankText").GetComponent<UIWidget>();
trueRankText = true;
//StartCoroutine("Wait", 2f);
yield return new WaitForSeconds(3f);
if (num >= 60) {
GameObject.Find ("Rank").transform.FindChild("DRank").gameObject.SetActive (true);
wg = GameObject.Find ("Rank").transform.FindChild("DRank").GetComponent<UIWidget>();
} else if (num >= 40) {
GameObject.Find ("Rank").transform.FindChild("CRank").gameObject.SetActive (true);
wg = GameObject.Find ("Rank").transform.FindChild("CRank").GetComponent<UIWidget>();
} else if (num >= 20) {
GameObject.Find ("Rank").transform.FindChild("BRank").gameObject.SetActive (true);
wg = GameObject.Find ("Rank").transform.FindChild("BRank").GetComponent<UIWidget>();
}else if (num > 10) {
GameObject.Find ("Rank").transform.FindChild("ARank").gameObject.SetActive (true);
wg = GameObject.Find ("Rank").transform.FindChild("ARank").GetComponent<UIWidget>();
} else if (num > 0) {
GameObject.Find ("Rank").transform.FindChild("SRank").gameObject.SetActive (true);
wg = GameObject.Find ("Rank").transform.FindChild("SRank").GetComponent<UIWidget>();
}
trueRank = true;
}
开发者ID:hTanizaki,项目名称:Hikouki-LG,代码行数:28,代码来源:EndMain.cs
示例3: FadeAlphaRank
public void FadeAlphaRank(UIWidget w){
Debug.Log ("wid"+fAlpha+"aa"+w.alpha);
if(w.alpha < 255f){
w.alpha += fAlpha;
Debug.Log ("wid"+fAlpha+"aa"+w.alpha);
}
}
开发者ID:hTanizaki,项目名称:Hikouki-LG,代码行数:7,代码来源:EndMain.cs
示例4: Update
// Update is called once per frame
void Update () {
#if UNITY_EDITOR
if (host == null)
{
host = GetComponent<UIWidget>();
}
if (processBar == null)
{
processBar = NGUITools.FindInParents<UIProgressBar>(gameObject);
}
#endif
if(host == null)
return;
if (uiCamera == null) uiCamera = NGUITools.FindCameraForLayer(gameObject.layer);
Rect mRect = uiCamera.pixelRect;
Vector3 v = new Vector3(mRect.xMax, 0f, 0f);
v = uiCamera.ScreenToWorldPoint(v);
Vector3 lp = this.transform.InverseTransformPoint(v);
int newWidth = (int)lp.x;
if (newWidth != oldWidth)
{
oldWidth = newWidth;
host.width = (int)lp.x;
if (processBar != null)
processBar.ForceUpdate();
}
}
开发者ID:fengqk,项目名称:Art,代码行数:32,代码来源:ZLRightAlign.cs
示例5: CompareFunc
public static int CompareFunc(UIWidget left, UIWidget right)
{
int num = UIPanel.CompareFunc(left.mPanel, right.mPanel);
if (num != 0)
{
return num;
}
if (left.mDepth < right.mDepth)
{
return -1;
}
if (left.mDepth > right.mDepth)
{
return 1;
}
Material material = left.material;
Material material2 = right.material;
if (material == material2)
{
return 0;
}
if (material != null)
{
return -1;
}
if (material2 != null)
{
return 1;
}
return ((material.GetInstanceID() >= material2.GetInstanceID()) ? 1 : -1);
}
开发者ID:Lessica,项目名称:Something-of-SHIPWAR-GAMES,代码行数:31,代码来源:UIWidget.cs
示例6: Start
void Start () {
btnClose = transform.FindInChildren("btnBack").GetComponent<UIButton>();
scrEvents = transform.FindInChildren("scrEvent").GetComponent<UIScrollView>();
tplEvent = transform.FindInChildren("itemEvent").GetComponent<UIWidget>();
tplEvent.gameObject.SetActive(false);
tplEvent.transform.parent = null;
}
开发者ID:Henry-T,项目名称:TianShen,代码行数:7,代码来源:WidgetEventLog.cs
示例7: Start
void Start()
{
m_widget = GetComponent<UIWidget>();
m_size = m_widget.localSize;
SetAlignWidgets();
}
开发者ID:imlovee,项目名称:WatchRemember_Final,代码行数:7,代码来源:WidgetAlign.cs
示例8: initializeUI
void initializeUI()
{
arrowUI = GameObject.Find ("Arrow").gameObject;
speedUI = GameObject.Find ("speed").GetComponent<UILabel>();
gearstUI = GameObject.Find ("peredacha").GetComponent<UILabel> ();
nitroUI = GameObject.Find ("indikator").GetComponent<UIWidget> ();
}
开发者ID:FaGame,项目名称:Dockyard-Construction-Site-Motorbike,代码行数:7,代码来源:BikeGUI.cs
示例9: SetAlign
void SetAlign(UIWidget widget, float posY)
{
Vector2 pos = widget.transform.localPosition;
switch (m_align)
{
case Align.NONE:
break;
case Align.CENTER:
pos.y = 0;
break;
case Align.TOP:
pos.y = m_size.y / 2;
break;
case Align.BOTTOM:
pos.y = m_size.y / 2 * -1;
break;
default:
break;
}
pos.y -= posY;
widget.transform.localPosition = pos;
}
开发者ID:imlovee,项目名称:WatchRemember_Final,代码行数:27,代码来源:VerticalAlign.cs
示例10: CalculateWidgetLocalBounds
public static Bounds CalculateWidgetLocalBounds( UIWidget w, Transform relativeTo ) {
float width = w.cachedTransform.localScale.x;
float height = w.cachedTransform.localScale.y;
Vector2 pivotOffset = w.pivotOffset;
return new Bounds( GetLocalOffset( w.transform, relativeTo ) + new Vector3( 0.5f*pivotOffset.x*width, 0.5f*pivotOffset.y*height, 0f ), new Vector3( width, height, 0f ) );
}
开发者ID:unit9,项目名称:swip3,代码行数:7,代码来源:U9NGUIUtils.cs
示例11: fromXML
public static XmlNodeList fromXML(XmlNode node, out UIWidget ui, UIWidget p)
{
string text = "";
float width = 128;
int rows = 1;
int fontSz = 10;
uint color = 0xffffffff;
EStyle style = EStyle.normal;
var ret = node.Attributes.GetNamedItem("text");
if (ret != null) text = ret.Value;
bool br = false;
text = getProp<string>(node, "text", "template", out br);
width = getProp(node, "width", 128, out br);
rows = getProp(node, "rows", rows, out br);
color = (uint)getProp<EColorUtil>(node, "color", (EColorUtil)schemes.textColor, out br);
if (!br)
{
color = getProp(node, "color", (uint)(schemes.textColor), out br);
}
style = UILabel.getStyle(node);
fontSz = getProp(node, "size", fontSz, out br);
ui = new UIEdit(text, fontSz, (int)width, rows, color, style);
ui.fromXML(node);
ui.paresent = p;
return node.ChildNodes;
}
开发者ID:TheWindX,项目名称:YAUI,代码行数:30,代码来源:UIEdit.cs
示例12: SetSpriteBySelection
public void SetSpriteBySelection()
{
if (UIPopupList.current != null)
{
if (this.mWidget == null)
{
this.mWidget = base.GetComponent<UIWidget>();
}
string key = UIPopupList.current.value;
if (key != null)
{
int num;
if (<>f__switch$map1 == null)
{
Dictionary<string, int> dictionary = new Dictionary<string, int>(7);
dictionary.Add("White", 0);
dictionary.Add("Red", 1);
dictionary.Add("Green", 2);
dictionary.Add("Blue", 3);
dictionary.Add("Yellow", 4);
dictionary.Add("Cyan", 5);
dictionary.Add("Magenta", 6);
<>f__switch$map1 = dictionary;
}
if (<>f__switch$map1.TryGetValue(key, out num))
{
switch (num)
{
case 0:
this.mWidget.color = Color.white;
break;
case 1:
this.mWidget.color = Color.red;
break;
case 2:
this.mWidget.color = Color.green;
break;
case 3:
this.mWidget.color = Color.blue;
break;
case 4:
this.mWidget.color = Color.yellow;
break;
case 5:
this.mWidget.color = Color.cyan;
break;
case 6:
this.mWidget.color = Color.magenta;
break;
}
}
}
}
}
开发者ID:Lessica,项目名称:Something-of-SHIPWAR-GAMES,代码行数:60,代码来源:SetColorOnSelection.cs
示例13: Awake
private void Awake()
{
if (this.Widget == null)
{
this.Widget = this.GetComponent<UIWidget>();
}
}
开发者ID:jixiang111,项目名称:slash-framework,代码行数:7,代码来源:UIFloatingWidget.cs
示例14: Awake
/// <summary>
/// Find all needed components.
/// </summary>
void Awake ()
{
mWidget = GetComponentInChildren<UIWidget>();
Renderer ren = renderer;
if (ren != null) mMat = ren.material;
mLight = light;
}
开发者ID:huw12313212,项目名称:Virtual-Piano,代码行数:11,代码来源:TweenColor.cs
示例15: fromXML
public static XmlNodeList fromXML(XmlNode nd, out UIWidget ui, UIWidget p)
{
ui = new UIStub();
ui.fromXML(nd);
ui.paresent = p;
return nd.ChildNodes;
}
开发者ID:TheWindX,项目名称:YAUI,代码行数:7,代码来源:UIStub.cs
示例16: fromXML
public static XmlNodeList fromXML(XmlNode node, out UIWidget ui, UIWidget p)
{
uint color = (uint)schemes.strokeColor;
bool br = true;
float lineWidth = (uint)getProp<float>(node, "lineWidth", 1, out br);
color = (uint)getProp<EColorUtil>(node, "color", (EColorUtil)schemes.strokeColor, out br);
string strBegin = tryGetProp("begin", node);
PointF ptBegin = parsePt(strBegin);
string strEnd = tryGetProp("end", node);
PointF ptEnd = parsePt(strEnd);
var uiLine = new UILine();
uiLine.setLineWidth(lineWidth);//must be under color
uiLine.setBegin(ptBegin.X, ptBegin.Y);
uiLine.setEnd(ptEnd.X, ptEnd.Y);
uiLine.color = color;
uiLine.fromXML(node);
ui = uiLine;
return node.ChildNodes;
}
开发者ID:TheWindX,项目名称:YAUI,代码行数:25,代码来源:UILine.cs
示例17: Cache
void Cache ()
{
mCached = true;
mWidget = GetComponent<UIWidget>();
if (mWidget != null) return;
mSr = GetComponent<SpriteRenderer>();
if (mSr != null) return;
#if UNITY_4_3 || UNITY_4_5 || UNITY_4_6 || UNITY_4_7
Renderer ren = renderer;
#else
Renderer ren = GetComponent<Renderer>();
#endif
if (ren != null)
{
mMat = ren.material;
return;
}
#if UNITY_4_3 || UNITY_4_5 || UNITY_4_6 || UNITY_4_7
mLight = light;
#else
mLight = GetComponent<Light>();
#endif
if (mLight == null) mWidget = GetComponentInChildren<UIWidget>();
}
开发者ID:Reiie,项目名称:Creature_Race,代码行数:27,代码来源:TweenColor.cs
示例18: AnimatePosition
private void AnimatePosition(UIWidget widget, bool placeAbove, float bottom)
{
Vector3 localPosition = widget.cachedTransform.localPosition;
Vector3 vector2 = !placeAbove ? new Vector3(localPosition.x, 0f, localPosition.z) : new Vector3(localPosition.x, bottom, localPosition.z);
widget.cachedTransform.localPosition = vector2;
TweenPosition.Begin(widget.gameObject, 0.15f, localPosition).method = UITweener.Method.EaseOut;
}
开发者ID:Lessica,项目名称:Something-of-SHIPWAR-GAMES,代码行数:7,代码来源:UIPopupList.cs
示例19: Cache
void Cache ()
{
mCached = true;
mWidget = GetComponentInChildren<UIWidget>();
Renderer ren = GetComponent<Renderer>();
if (ren != null) mMat = ren.material;
mLight = GetComponent<Light>();
}
开发者ID:hoangwin,项目名称:2-ca-rs-tim-berman,代码行数:8,代码来源:TweenColor.cs
示例20: Awake
void Awake()
{
instance = this;
turretSelectWidget = turretSelectMenu.GetComponent<UIWidget>();
destroyTurretTab = turretSelectMenu.GetComponentInChildren<AllyDestroyTurret>();
HideTurretSelectTab();
}
开发者ID:elcastcze,项目名称:TowerDefense,代码行数:8,代码来源:AllySpawnerController.cs
注:本文中的UIWidget类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论