• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# UISprite类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中UISprite的典型用法代码示例。如果您正苦于以下问题:C# UISprite类的具体用法?C# UISprite怎么用?C# UISprite使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



UISprite类属于命名空间,在下文中一共展示了UISprite类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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");
        
    }
开发者ID:hiyijia,项目名称:CapsUnity,代码行数:25,代码来源:UIGameBottom.cs


示例2: Awake

 void Awake()
 {
     if (!buttonSprite)
     {
         buttonSprite = gameObject.GetComponent<UISprite>();
     }
 }
开发者ID:jcabe4,项目名称:Reignite,代码行数:7,代码来源:CustomButton.cs


示例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;
	}
开发者ID:Burnknee,项目名称:IpadApp,代码行数:11,代码来源:SpriteSelector.cs


示例4: Start

	// Use this for initialization
	void Start () {
	
		addTime = 1.0f;
		timer = 0.0f;

		sprite = this.GetComponent<UISprite>();
	}
开发者ID:KojiMorikawa,项目名称:Test_UnityProject,代码行数:8,代码来源:UISpriteColorAnim.cs


示例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>();
    }    
开发者ID:lbddk,项目名称:ahzs-client,代码行数:27,代码来源:EquipRecommendUIGrid.cs


示例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);
			}
		}
	}
开发者ID:w405229619,项目名称:The-revenge-of-DaNiu,代码行数:25,代码来源:UIImageButtonInspector.cs


示例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();
	}
开发者ID:10people,项目名称:UnityLibrary,代码行数:29,代码来源:UIImageButtonInspector.cs


示例8: Awake

	void Awake()
	{
		if(digitalSprite == null)
			digitalSprite = transform.FindChild("Title").GetComponent<UISprite>();
		if(digitalSpriteBack == null)
			digitalSpriteBack = transform.FindChild("TitleBack").GetComponent<UISprite>();
	}
开发者ID:Blizzardx,项目名称:ClientFrameWork,代码行数:7,代码来源:UITitle.cs


示例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;
		}
		
		
		
	}
开发者ID:aceprojectcorp,项目名称:acerookie_yujimin,代码行数:25,代码来源:DrawBG.cs


示例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;
	}
开发者ID:ziyihu,项目名称:LordOfSinU3D,代码行数:33,代码来源:PlayerStatus.cs


示例11: Init

 public void Init(Transform _trans, UISprite _sprite, float _movementSpeed, float _jumpHeight)
 {
     trans = _trans;
     sprite = _sprite;
     movementSpeed = _movementSpeed;
     jumpHeight = _jumpHeight;
 }
开发者ID:vogles,项目名称:I-See-Robots,代码行数:7,代码来源:AquaticState.cs


示例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");
	}
开发者ID:Blizzardx,项目名称:ClientFrameWork,代码行数:30,代码来源:UIWindowFireworkGuide.cs


示例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;
		}
		
	}
开发者ID:cupsster,项目名称:gtmanager,代码行数:26,代码来源:IndividualPieceOfResearch.cs


示例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);
 }
开发者ID:floatyears,项目名称:Decrypt,代码行数:30,代码来源:GUIPillageResultScene.cs


示例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();
    }  
开发者ID:lbddk,项目名称:ahzs-client,代码行数:29,代码来源:TimeLimitActivityInfo.cs


示例16: Init

 public void Init()
 {
     this.mReward = base.transform.Find("Reward");
     this.mTitle = base.transform.Find("title").GetComponent<UILabel>();
     this.mCurrencyIcon = base.transform.Find("currencyIcon");
     this.mPrice = this.mCurrencyIcon.transform.Find("price").GetComponent<UILabel>();
     this.mCanUsed = this.mCurrencyIcon.transform.Find("canUsed").GetComponent<UILabel>();
     this.mTip = base.transform.Find("tips").GetComponent<UILabel>();
     this.mStep = base.transform.Find("step").GetComponent<UILabel>();
     this.Slider = base.transform.Find("slider").gameObject;
     this.mSF = this.Slider.transform.Find("Fg").GetComponent<UISprite>();
     for (int i = 0; i < 5; i++)
     {
         this.discount[i] = this.Slider.transform.Find(string.Format("p{0}", i)).GetComponent<UILabel>();
         this.buyCount[i] = this.discount[i].transform.Find("num").GetComponent<UILabel>();
         this.discount[i].text = "0";
     }
     this.buyCount[0].text = string.Empty;
     this.mBtnBuy = base.transform.Find("GoBtn").gameObject;
     UIEventListener expr_1A5 = UIEventListener.Get(this.mBtnBuy);
     expr_1A5.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(expr_1A5.onClick, new UIEventListener.VoidDelegate(this.OnBtnBuyClicked));
     this.mBtnOver = base.transform.Find("OverBtn").gameObject;
     ActivitySubSystem expr_1F0 = Globals.Instance.Player.ActivitySystem;
     expr_1F0.GBBuyItemEvent = (ActivitySubSystem.AGBCallBack)Delegate.Combine(expr_1F0.GBBuyItemEvent, new ActivitySubSystem.AGBCallBack(this.OnActivityGroupBuyingBuyEvent));
     ActivitySubSystem expr_220 = Globals.Instance.Player.ActivitySystem;
     expr_220.GetGroupBuyingDataEvent = (ActivitySubSystem.VoidCallback)Delegate.Combine(expr_220.GetGroupBuyingDataEvent, new ActivitySubSystem.VoidCallback(this.OnGetActivityGBEvent));
 }
开发者ID:floatyears,项目名称:Decrypt,代码行数:27,代码来源:GUIGroupBuyingItem.cs


示例17: Awake

    public float ArmorNum = 1;          //护甲的恢复指数

    void Awake()
    {
        GameObject.Find("bgFailorSucceed").GetComponent<Image>().enabled = false;
        playerArmor = GameObject.Find("UIfire/PanelBlood/Armor/Foreground").GetComponent<UISprite>();
        spriteBlood = GameObject.Find("UIfire/PanelBlood/Blood/SpriteBlood").GetComponent<UISprite>();
        print("护甲=" + playerArmor.fillAmount);
    }
开发者ID:xiatianjin,项目名称:Tank,代码行数:9,代码来源:playerBlood.cs


示例18: CreateObjects

 private void CreateObjects()
 {
     this.mIcon = base.transform.Find("icon").GetComponent<UISprite>();
     this.mQualityMask = base.transform.Find("qualityMark").GetComponent<UISprite>();
     this.mNum = base.transform.Find("num").GetComponent<UILabel>();
     this.mName = base.transform.Find("name").GetComponent<UILabel>();
 }
开发者ID:floatyears,项目名称:Decrypt,代码行数:7,代码来源:GUIFirstRechargeItem.cs


示例19: Start

    GameObject Tank;//玩家的坦克(用来获取坦克的位置)

   
	// Use this for initialization
	void Start () {
        Tank = GameObject.Find("First96A").gameObject;

     
        sprCD = transform.FindChild("sprCD").GetComponent<UISprite>();
        sprCD.fillAmount = 0;
	}
开发者ID:xiatianjin,项目名称:Tank,代码行数:11,代码来源:BtnAirShell.cs


示例20: Start

    void Start()
    {
        m_sprite = GetComponent<UISprite>();

        Vector3 size = new Vector3(Screen.width, Screen.height, 1);
        m_sprite.SetDimensions((int)size.x, (int)size.y);
    }
开发者ID:imlovee,项目名称:WatchRemember_Final,代码行数:7,代码来源:ClosePopupAnotherClick.cs



注:本文中的UISprite类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# UISpriteData类代码示例发布时间:2022-05-24
下一篇:
C# UISplitViewController类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap