本文整理汇总了C#中UISprite类的典型用法代码示例。如果您正苦于以下问题:C# UISprite类的具体用法?C# UISprite怎么用?C# UISprite使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
UISprite类属于命名空间,在下文中一共展示了UISprite类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnCreate
public override void OnCreate()
{
base.OnCreate();
for (int i = 0; i < 3; ++i )
{
m_starsSprites[i] = GetChildComponent<UISprite>("Star" + (i + 1)); //查找sprite
}
m_progressSprite = GetChildComponent<UISprite>("Progress"); //查找sprite
stageBoard = GetChildComponent<UISprite>("StageBoard");
m_speedSlider = GetChildComponent<UISlider>("SpeedSlider");
m_speedLabel = GetChildComponent<UILabel>("SpeedLabel");
m_timeBar = GetChildComponent<UISprite>("TimeBar");
m_scoreDrawer = GetChildComponent<NumberDrawer>("ScoreDrawer");
m_stepDrawer = GetChildComponent<NumberDrawer>("StepDrawer");
m_timeNumber = UIToolkits.FindChild(mUIObject.transform, "TimeNumber").gameObject;
m_minNumber = GetChildComponent<NumberDrawer>("MinNumber");
m_secNumber = GetChildComponent<NumberDrawer>("SecNumber");
}
示例2: Awake
void Awake()
{
if (!buttonSprite)
{
buttonSprite = gameObject.GetComponent<UISprite>();
}
}
示例3: Show
/// <summary>
/// Show the selection wizard.
/// </summary>
public static void Show (UIAtlas atlas, UISprite selectedSprite)
{
SpriteSelector comp = ScriptableWizard.DisplayWizard<SpriteSelector>("Select a Sprite");
comp.mAtlas = atlas;
comp.mSprite = selectedSprite;
comp.mCallback = null;
}
示例4: Start
// Use this for initialization
void Start () {
addTime = 1.0f;
timer = 0.0f;
sprite = this.GetComponent<UISprite>();
}
示例5: LoadResourceInsteadOfAwake
public void LoadResourceInsteadOfAwake()
{
if (m_bLoadResourceInsteadOfAwake)
return;
m_bLoadResourceInsteadOfAwake = true;
m_myTransform = transform;
FillFullNameData(m_myTransform);
m_spCurrentEquipImg = m_myTransform.FindChild(m_widgetToFullName["CurrentEquipImg"]).GetComponentsInChildren<UISprite>(true)[0];
m_spCurrentEquipImgBG = m_myTransform.FindChild(m_widgetToFullName["CurrentEquipImgBG"]).GetComponentsInChildren<UISprite>(true)[0];
m_lblCurrentEquipText = m_myTransform.FindChild(m_widgetToFullName["CurrentEquipText"]).GetComponentsInChildren<UILabel>(true)[0];
m_lblCurrentEquipScoreText = FindTransform("CurrentEquipScoreText").GetComponentsInChildren<UILabel>(true)[0];
m_goCurrentEquipButton = FindTransform("CurrentEquipButton").gameObject;
m_spRecommendEquipImg = m_myTransform.FindChild(m_widgetToFullName["RecommendEquipImg"]).GetComponentsInChildren<UISprite>(true)[0];
m_spRecommendEquipImgBG = m_myTransform.FindChild(m_widgetToFullName["RecommendEquipImgBG"]).GetComponentsInChildren<UISprite>(true)[0];
m_lblRecommendEquipText = m_myTransform.FindChild(m_widgetToFullName["RecommendEquipText"]).GetComponentsInChildren<UILabel>(true)[0];
m_lblRecommendEquipScoreText = FindTransform("RecommendEquipScoreText").GetComponentsInChildren<UILabel>(true)[0];
m_goRecommendEquipButton = FindTransform("RecommendEquipButton").gameObject;
m_lblScoreUpgradeNum = m_myTransform.FindChild(m_widgetToFullName["ScoreUpgradeNum"]).GetComponentsInChildren<UILabel>(true)[0];
m_goLinkBtn = m_myTransform.FindChild(m_widgetToFullName["LinkBtn"]).gameObject;
m_lblLinkBtnText = m_myTransform.FindChild(m_widgetToFullName["LinkBtnText"]).GetComponentsInChildren<UILabel>(true)[0];
linkButton = m_myTransform.FindChild(m_widgetToFullName["LinkBtn"]).gameObject.AddComponent<EquipRecommendUIGridButton>();
}
示例6: OnInspectorGUI
public override void OnInspectorGUI ()
{
EditorGUIUtility.LookLikeControls(80f);
mButton = target as UIImageButton;
mSprite = EditorGUILayout.ObjectField("Sprite", mButton.target, typeof(UISprite), true) as UISprite;
if (mButton.target != mSprite)
{
NGUIEditorTools.RegisterUndo("Image Button Change", mButton);
mButton.target = mSprite;
if (mSprite != null) mSprite.spriteName = mButton.normalSprite;
}
if (mSprite != null)
{
ComponentSelector.Draw<UIAtlas>(mSprite.atlas, OnSelectAtlas);
if (mSprite.atlas != null)
{
NGUIEditorTools.SpriteField("Normal", mSprite.atlas, mButton.normalSprite, OnNormal);
NGUIEditorTools.SpriteField("Hover", mSprite.atlas, mButton.hoverSprite, OnHover);
NGUIEditorTools.SpriteField("Pressed", mSprite.atlas, mButton.pressedSprite, OnPressed);
}
}
}
示例7: OnInspectorGUI
public override void OnInspectorGUI ()
{
serializedObject.Update();
NGUIEditorTools.SetLabelWidth(80f);
mButton = target as UIImageButton;
mSprite = EditorGUILayout.ObjectField("Sprite", mButton.target, typeof(UISprite), true) as UISprite;
if (mButton.target != mSprite)
{
NGUIEditorTools.RegisterUndo("Image Button Change", mButton);
mButton.target = mSprite;
if (mSprite != null) mSprite.spriteName = mButton.normalSprite;
}
if (mSprite != null)
{
ComponentSelector.Draw<UIAtlas>(mSprite.atlas, OnSelectAtlas, true);
if (mSprite.atlas != null)
{
NGUIEditorTools.DrawSpriteField("Normal", mSprite.atlas, mButton.normalSprite, OnNormal);
NGUIEditorTools.DrawSpriteField("Hover", mSprite.atlas, mButton.hoverSprite, OnHover);
NGUIEditorTools.DrawSpriteField("Pressed", mSprite.atlas, mButton.pressedSprite, OnPressed);
NGUIEditorTools.DrawSpriteField("Disabled", mSprite.atlas, mButton.disabledSprite, OnDisabled);
NGUIEditorTools.DrawProperty("Pixel Snap", serializedObject, "pixelSnap");
}
}
serializedObject.ApplyModifiedProperties();
}
示例8: Awake
void Awake()
{
if(digitalSprite == null)
digitalSprite = transform.FindChild("Title").GetComponent<UISprite>();
if(digitalSpriteBack == null)
digitalSpriteBack = transform.FindChild("TitleBack").GetComponent<UISprite>();
}
示例9: bgMove
void bgMove( UISprite bg )
{
// Debug.Log ( "bg.pixelSize " + bg.pixelSize );
// Debug.Log ( "bg.transform.localScale : " + bg.transform.localScale );
// Debug.Log ( "bg.transform.lossyScale : " + bg.transform.lossyScale );
// Debug.Log ( "bg.localSize" + bg.localSize );
// Debug.Log ( "bg.transform.position" + bg.transform.position );
// Debug.Log ( "bg.transform.localPosition : " + bg.transform.localPosition );
if ( -(bg.localSize.y) >= bg.transform.localPosition.y )
{
bgPos.y = bg.localSize.y - ( GameData.bgSpeed * 1000f);
bg.transform.localPosition = bgPos ;
}
else
{
bgPos = bg.transform.position;
bgPos.y -= GameData.bgSpeed;
bg.transform.position = bgPos;
}
}
示例10: Awake
void Awake(){
_instance = this;
headSprite = transform.Find ("HeadSprite").GetComponent<UISprite> ();
levelLabel = transform.Find ("LevelLabel").GetComponent<UILabel> ();
nameLabel = transform.Find ("NameLabel").GetComponent<UILabel> ();
diamondLabel = transform.Find ("DiamondLabel/DiamondNumLabel").GetComponent<UILabel> ();
coinLabel = transform.Find ("CoinLabel/CoinNumLabel").GetComponent<UILabel> ();
tween = this.GetComponent<TweenPosition> ();
closeButton = transform.Find ("CancelButton").GetComponent<UIButton> ();
changeNameButton = transform.Find ("ChangeNameButton").GetComponent<UIButton> ();
changeNameGo = transform.Find ("ChangeNameBg").gameObject;
nameInput = transform.Find ("ChangeNameBg/NameInput").GetComponent<UIInput> ();
sureButton = transform.Find ("ChangeNameBg/SureButton").GetComponent<UIButton> ();
cancelButton = transform.Find ("ChangeNameBg/CancelButton").GetComponent<UIButton> ();
changeNameGo.SetActive (false);
EventDelegate ed = new EventDelegate(this,"OnButtonCloseClick");
closeButton.onClick.Add (ed);
EventDelegate ed2 = new EventDelegate (this, "OnButtonChangeNameClick");
changeNameButton.onClick.Add (ed2);
EventDelegate ed3 = new EventDelegate (this, "OnButtonSureClick");
sureButton.onClick.Add (ed3);
EventDelegate ed4 = new EventDelegate (this, "OnButtonCancelClick");
cancelButton.onClick.Add (ed4);
PlayerInfo._instance.OnPlayerInfoChanged += this.OnPlayerInfoChanged;
}
示例11: Init
public void Init(Transform _trans, UISprite _sprite, float _movementSpeed, float _jumpHeight)
{
trans = _trans;
sprite = _sprite;
movementSpeed = _movementSpeed;
jumpHeight = _jumpHeight;
}
示例12: OnInit
public override void OnInit()
{
base.OnInit();
m_ColorList = new List<ColorItem>();
for (int i = 0; i < 5; ++i)
{
ColorItem elem = new ColorItem();
elem.obj = FindChild("Sprite_Color"+(i));
UIEventListener.Get(elem.obj).onClick = OnDropEnd;
var texture = ComponentTool.FindChildComponent<UITexture>("Sprite_Color", elem.obj);
elem.color = texture.color;
m_ColorList.Add(elem);
}
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, i<3);
m_FireworkPlanList.Add(elem);
UIEventListener.Get(objRoot).onClick = OnClickFire; ;
}
m_ColorPanel = FindChildComponent<UISprite>("Sprite_ColorPanel");
m_BlockBg = FindChild("BlockBg");
AddChildElementClickEvent(OnClickExit,"Button_Exit");
}
示例13: initResearch
public void initResearch(RnDRow aRow,GTCar aCar,UISprite aSprite) {
this.gameObject.SetActive(true);
researchRow = aRow;
carRef = aCar;
GTEquippedResearch r = carRef.hasPart(aRow);
if(r==null) {
partNameTitle.text = aRow._partname+" (0/"+aRow._maxlevelstounlock+")";
} else {
partNameTitle.text = aRow._partname+" ("+r.activeLevel+"/"+aRow._maxlevelstounlock+")";
}
partDescription.text = aRow._partdescription;
// divisionRequired.text = "Division Required: "+aRow._partprerequisitedivision;
if(aRow._partprerequisites.Length==0) {
prerequisiteParts.text = "Prerequisite Parts: None";
} else {
prerequisiteParts.text = "Prerequisite Parts: "+aRow._partprerequisites;
}
lblCost.text = "Cost to Research: "+aRow._costtoresearch.ToString("C0");
this.lblDaysToResearch.text = "Days to Research: "+aRow._daystoresearch;
partGraphic.spriteName = aSprite.spriteName;
if(this.carRef.partBeingResearched!=null) {
startResearchBtn.isEnabled = false;
}
}
示例14: CreateObjects
private void CreateObjects()
{
this.backMenu = base.RegisterClickEvent("backMenu", new UIEventListener.VoidDelegate(this.OnReturnClick), base.gameObject);
this.backMenu.gameObject.SetActive(false);
this.result = base.transform.Find("result").GetComponent<UISprite>();
this.result.gameObject.SetActive(true);
this.result.spriteName = ((!GUIPillageResultScene.PillageResultWin) ? "Failure" : "Victory_Txt");
GameObject gameObject = GameUITools.FindGameObject("infoBg", base.gameObject);
this.time = gameObject.transform.FindChild("time").gameObject;
this.time.SetActive(false);
this.gold = gameObject.transform.FindChild("gold").gameObject;
this.gold.SetActive(false);
this.exp = gameObject.transform.FindChild("exp").gameObject;
this.exp.SetActive(false);
this.timeLabel = this.time.transform.Find("num").GetComponent<UILabel>();
this.goldLabel = this.gold.transform.Find("num").GetComponent<UILabel>();
this.expLabel = this.exp.transform.Find("num").GetComponent<UILabel>();
GameObject gameObject2 = gameObject.transform.FindChild("Level").gameObject;
this.levelAnimation = gameObject2.AddComponent<GUILevelExpUpAnimation>();
gameObject2.SetActive(false);
this.levelAnimation.Init();
this.Failure = GameUITools.FindGameObject("Failure", base.gameObject);
this.Failure.AddComponent<GUIFailureTipsGroup>();
this.Failure.SetActive(false);
this.Victory = GameUITools.FindGameObject("Victory", base.gameObject);
this.Victory.SetActive(false);
this.VictoryTips = this.Victory.transform.Find("Tips").GetComponent<UILabel>();
this.RewardItem = GameUITools.FindGameObject("Reward", base.gameObject);
this.RewardItem.SetActive(false);
}
示例15: LoadResourceInsteadOfAwake
public void LoadResourceInsteadOfAwake()
{
if(m_bLoadResourceInsteadOfAwake)
return;
m_bLoadResourceInsteadOfAwake = true;
m_myTransform = transform;
FillFullNameData(transform);
m_lblCDText = FindTransform("TimeLimitActivityUIActivityInfoCDText").GetComponentsInChildren<UILabel>(true)[0];
m_lblInfoDesc = FindTransform("TimeLimitActivityUIActivityInfoDesc").GetComponentsInChildren<UILabel>(true)[0];
m_spInfoImg = FindTransform("TimeLimitActivityUIActivityInfoImg").GetComponentsInChildren<UISprite>(true)[0];
m_lblRule = FindTransform("TimeLimitActivityUIActivityInfoRule").GetComponentsInChildren<UILabel>(true)[0];
m_lblInfoTitle = FindTransform("TimeLimitActivityUIActivityInfoTitle").GetComponentsInChildren<UILabel>(true)[0];
m_goHasReward = FindTransform("TimeLimitActivityUIActivityInfoHasReward").gameObject;
for (int i = 0; i < 4; ++i)
{
m_arrItem[i] = FindTransform("TimeLimitActivityUIItem" + i).gameObject;
m_arrItemGrid.Add(m_arrItem[i].AddComponent<InventoryGrid>());
}
m_goGetBtn = FindTransform("TimeLimitActivityUIGetBtn").gameObject;
m_spGetBtnBGUp = FindTransform("TimeLimitActivityUIGetBtnBGUp").GetComponentsInChildren<UISprite>(true)[0];
m_goShareBtn = FindTransform("TimeLimitActivityUIShareBtn").gameObject;
m_goTimeLimitActivityUIItemListBG = FindTransform("TimeLimitActivityUIItemListBG").gameObject;
Initialize();
}