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

C# UITexture类代码示例

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

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



UITexture类属于命名空间,在下文中一共展示了UITexture类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: StartLoadingTexture

    private void StartLoadingTexture()
    {
        if (!string.IsNullOrEmpty(textureUrl))
        {
            _uiTexture = gameObject.GetComponent<UITexture>();

            if (!_uiTexture) {
             	_uiTexture = gameObject.AddComponent<UITexture>();
                //Material mat = new Material(Shader.Find("Unlit/Transparent Colored (AlphaClip)"));
                Material mat = new Material(Shader.Find("Unlit/Transparent Colored"));
                _uiTexture.material = mat;
            }

            _uiTexture.MakePixelPerfect();

            this.LoadTexture(textureUrl, (texture) => {
                _uiTexture.mainTexture = texture;
                _uiTexture.MakePixelPerfect();

                if ((hack_x>0) && (hack_y>0))
                {
                    gameObject.transform.localScale = new Vector3 (hack_x, hack_y, gameObject.transform.localScale.z);
                }

                    /* Scale images if not retina */
                    /*
                    if (!AppGUISettings.IS_RETINA)
                        gameObject.transform.localScale = new Vector3 (gameObject.transform.localScale.x/2, gameObject.transform.localScale.y/2, gameObject.transform.localScale.z);
                        */
            });
        }
    }
开发者ID:quangpham,项目名称:ndata_custom_binding,代码行数:32,代码来源:NguiTextureBindingFromUrl.cs


示例2: Awake

	void Awake()
	{
		myLabel = GetComponent<UILabel>();
		
		daddy = transform.parent.gameObject;
		myBackground = transform.parent.Find("Background").GetComponent<UITexture>();
	}
开发者ID:JulyMars,项目名称:frozen_free_fall,代码行数:7,代码来源:ItemDescriptionLabel.cs


示例3: Start

	private void Start() { 
		texture = gameObject.GetComponent<UITexture>(); 
		speedEnd = texture.gc.speedControl; 
		texture.gc.speedControl = 0; 
		revive = PlayerPrefs.GetInt("Revive"); 
		_start = true;
	}
开发者ID:MizzKii,项目名称:PuruDash2D,代码行数:7,代码来源:UIRevive.cs


示例4: Awake

    void Awake()
    {
        m_instance = gameObject.GetComponent<DiamondToGoldUIViewManager>();
        m_myTransform = transform;
        FillFullNameData(m_myTransform);

        m_lblDiamondToGoldUIFromDiamondText2 = m_myTransform.FindChild(m_widgetToFullName["DiamondToGoldUIFromDiamondText2"]).GetComponent<UILabel>();
        m_lblDiamondToGoldUIToGoldText2 = m_myTransform.FindChild(m_widgetToFullName["DiamondToGoldUIToGoldText2"]).GetComponent<UILabel>();
        m_lblDiamondToGoldUILastTimesText2 = m_myTransform.FindChild(m_widgetToFullName["DiamondToGoldUILastTimesText2"]).GetComponent<UILabel>();
        m_tranGODiamondToGoldChoose = m_myTransform.FindChild(m_widgetToFullName["GODiamondToGoldChoose"]);
        m_lblDiamondToGoldUIUseAllText1 = m_myTransform.FindChild(m_widgetToFullName["DiamondToGoldUIUseAllText1"]).GetComponent<UILabel>();
        m_texDiamondToGoldUIBtnTurnBG = m_myTransform.FindChild(m_widgetToFullName["DiamondToGoldUIBtnTurnBG"]).GetComponent<UITexture>();

        m_goDiamondToGoldUIUseOKCancel = m_myTransform.FindChild(m_widgetToFullName["GODiamondToGoldUIUseOKCancel"]).gameObject;
        m_lblDiamondToGoldUIUseInfoDiamondText2 = m_myTransform.FindChild(m_widgetToFullName["DiamondToGoldUIUseInfoDiamondText2"]).GetComponent<UILabel>();
        m_lblDiamondToGoldUIUseInfoGoldText2 = m_myTransform.FindChild(m_widgetToFullName["DiamondToGoldUIUseInfoGoldText2"]).GetComponent<UILabel>();
        m_goDiamondToGoldUIUseTipEnable = m_myTransform.FindChild(m_widgetToFullName["DiamondToGoldUIUseTipEnable"]).gameObject;
        m_goGODiamondToGoldUIUseTipEnable = m_myTransform.FindChild(m_widgetToFullName["GODiamondToGoldUIUseTipEnable"]).gameObject;
        m_goDiamondToGoldUIUseTipEnableBGDown = m_myTransform.FindChild(m_widgetToFullName["DiamondToGoldUIUseTipEnableBGDown"]).gameObject;
               
        m_goDiamondToGoldUIUseAllCheckDown = m_myTransform.FindChild(m_widgetToFullName["DiamondToGoldUIUseAllCheckDown"]).gameObject;
        m_goDiamondToGoldUIUseOneCheckDown = m_myTransform.FindChild(m_widgetToFullName["DiamondToGoldUIUseOneCheckDown"]).gameObject;

        m_lblDiamondToGoldUIDiamondNum = m_myTransform.FindChild(m_widgetToFullName["DiamondToGoldUIDiamondNum"]).GetComponentsInChildren<UILabel>(true)[0];
        m_lblDiamondToGoldUIGoldNum = m_myTransform.FindChild(m_widgetToFullName["DiamondToGoldUIGoldNum"]).GetComponentsInChildren<UILabel>(true)[0];

        IsShowGoldMetallurgyTipDialog = SystemConfig.Instance.IsShowGoldMetallurgyTipDialog;
        Initialize();
    }
开发者ID:lbddk,项目名称:ahzs-client,代码行数:29,代码来源:DiamondToGoldUIViewManager.cs


示例5: Init

 public void Init(bool shouldScroll = false, bool shouldGrey = false)
 {
     GameObject gameObject = base.transform.Find("activeSkill").gameObject;
     this.mActiveSkill = gameObject.transform.Find("skill").GetComponent<UITexture>();
     UIEventListener expr_41 = UIEventListener.Get(this.mActiveSkill.gameObject);
     expr_41.onPress = (UIEventListener.BoolDelegate)Delegate.Combine(expr_41.onPress, new UIEventListener.BoolDelegate(this.OnSkillIconPress));
     for (int i = 0; i < 3; i++)
     {
         this.mPassiveSkills[i] = base.transform.Find(string.Format("passiveSkill{0}", i)).gameObject;
         this.mPassiveSkillIcons[i] = this.mPassiveSkills[i].transform.Find("skill").GetComponent<UISprite>();
         UIEventListener expr_C7 = UIEventListener.Get(this.mPassiveSkillIcons[i].gameObject);
         expr_C7.onPress = (UIEventListener.BoolDelegate)Delegate.Combine(expr_C7.onPress, new UIEventListener.BoolDelegate(this.OnPassiveSkillIconPress));
         this.mPassiveSkillIconGreys[i] = this.mPassiveSkills[i].transform.Find("skillGrey").GetComponent<UISprite>();
         UIEventListener expr_11E = UIEventListener.Get(this.mPassiveSkillIconGreys[i].gameObject);
         expr_11E.onPress = (UIEventListener.BoolDelegate)Delegate.Combine(expr_11E.onPress, new UIEventListener.BoolDelegate(this.OnPassiveSkillIconPress));
     }
     if (shouldScroll)
     {
         this.mActiveSkill.gameObject.AddComponent<UIDragScrollView>();
         for (int j = 0; j < 3; j++)
         {
             this.mPassiveSkillIcons[j].gameObject.AddComponent<UIDragScrollView>();
             this.mPassiveSkillIconGreys[j].gameObject.AddComponent<UIDragScrollView>();
         }
     }
     if (shouldGrey)
     {
         for (int k = 0; k < 3; k++)
         {
             this.mPassiveSkillIconGreys[k].color = Color.black;
         }
     }
 }
开发者ID:floatyears,项目名称:Decrypt,代码行数:33,代码来源:GUIPetInfoSkillLayer.cs


示例6: SetComponents

    /// <summary>
    /// Sets the components.
    /// </summary>
    /// <param name='_sprite'>
    /// _sprite.
    /// </param>
    /// <param name='_stretch'>
    /// _stretch.
    /// </param>
    public void SetComponents(UITexture _texture, UIStretch _stretch)
    {
        texture = _texture;
        transform = texture.transform;

        stretch = _stretch;
    }
开发者ID:dany1532,项目名称:Social_Clues,代码行数:16,代码来源:UIScaledTexture.cs


示例7: Start

	void Start ()
	{
		mTrans = transform;
		mUITex = GetComponent<UITexture>();
		mCam = UICamera.FindCameraForLayer(gameObject.layer);

		mWidth = mUITex.width;
		mHeight = mUITex.height;
		Color[] cols = new Color[mWidth * mHeight];

		for (int y = 0; y < mHeight; ++y)
		{
			float fy = (y - 1f) / mHeight;

			for (int x = 0; x < mWidth; ++x)
			{
				float fx = (x - 1f) / mWidth;
				int index = x + y * mWidth;
				cols[index] = Sample(fx, fy);
			}
		}

		mTex = new Texture2D(mWidth, mHeight, TextureFormat.RGB24, false);
		mTex.SetPixels(cols);
		mTex.filterMode = FilterMode.Trilinear;
		mTex.wrapMode = TextureWrapMode.Clamp;
		mTex.Apply();
		mUITex.mainTexture = mTex;

		Select(value);
	}
开发者ID:ChungH,项目名称:BNG,代码行数:31,代码来源:UIColorPicker.cs


示例8: Start

 public void Start()
 {
     name = gameObject.name;
     if(GetComponentInChildren<Transform>())
         backGroundChildren = GetComponentInChildren<UITexture>();
     //Buttons.Instance.AddButton(this);
 }
开发者ID:Rinal,项目名称:Niam-Niam,代码行数:7,代码来源:Button.cs


示例9: Awake

    void Awake()
    {
        tex = transform.GetComponentsInChildren<UITexture>(true)[0];
        ta = transform.GetComponentsInChildren<TweenAlpha>(true)[0];

        GetComponentsInChildren<UIFXUnit>(true)[0].UIFXPlayFuncWithFloat = Play;
        GetComponentsInChildren<UIFXUnit>(true)[0].UIFXStopFuncWithFloat = Stop;
    }
开发者ID:lbddk,项目名称:ahzs-client,代码行数:8,代码来源:SandFX.cs


示例10: InitWithBaseScene

 public void InitWithBaseScene(GameObject go)
 {
     this.mModelTexture = base.transform.GetComponent<UITexture>();
     this.CreateRenderTexture();
     this.CreateRenderCamera(go);
     this.mModelTexture.shader = Shader.Find("Unlit/Transparent Colored");
     this.mModelTexture.mainTexture = this.mRenderTexture;
 }
开发者ID:floatyears,项目名称:Decrypt,代码行数:8,代码来源:GUIRender3DModel.cs


示例11: Start

	// Use this for initialization
	void Start () {
		TextureSize = MoveTexture.Length;
		
		MoveMaxTick = TextureSize;
		UT = GetComponent<UITexture>();
//		BaseShader = UT.shader;

	}
开发者ID:changj41,项目名称:grid,代码行数:9,代码来源:NGUIChangeTexture.cs


示例12: Awake

    public override void Awake()
    {
        base.Awake();

        _uiTexture = gameObject.GetComponent<UITexture>();
        width = transform.localScale.x;
        height = transform.localScale.y;
    }
开发者ID:NateFromSpace,项目名称:Sandbox,代码行数:8,代码来源:NguiTextureBinding.cs


示例13: Init

 public void Init()
 {
     GameObject parent = GameUITools.FindGameObject("skills", base.gameObject);
     this.mActive = GameUITools.FindGameObject("active", parent);
     this.mActiveSkill = GameUITools.FindGameObject("skill", this.mActive).GetComponent<UITexture>();
     UIEventListener expr_4D = UIEventListener.Get(this.mActiveSkill.gameObject);
     expr_4D.onPress = (UIEventListener.BoolDelegate)Delegate.Combine(expr_4D.onPress, new UIEventListener.BoolDelegate(this.OnSkillIconPress));
 }
开发者ID:floatyears,项目名称:Decrypt,代码行数:8,代码来源:LopetInfoSkillLayer.cs


示例14: FindObjects

	public void FindObjects () {
		mStageManager = GetComponentInParent<StageManager> ();
		mIdolStageStatusManager = GetComponentInChildren<IdolStageStatusManager> ();
		mBackgroundTexture = GetComponentInChildren<UITexture> ();
		mSkipConstructionButtonObject = transform.FindChild ("SkipConstructionButton").gameObject;
		mSleepObject = transform.FindChild ("Sleep").gameObject;
		mIdolStageStatusManager.FindObjects ();
	}
开发者ID:hanahanaside,项目名称:JPN,代码行数:8,代码来源:IdolStageContainer.cs


示例15: Start

	void Start ()
	{
		if (this.uiTexture != null)
			this.uiTexture = this.GetComponent<UITexture> ();
		
		if (this.textureList.Count == 0)
			Debug.Log(this.gameObject.name+"のTextureAnimation-textureListに画像が設定されていません。");
	}
开发者ID:msworks,项目名称:theOceanHandy,代码行数:8,代码来源:TextureAnimation.cs


示例16: Start

 void Start()
 {
     //movSpeed = startMovSpeed;
     myTexture = GetComponent<UITexture>();
     initalTextureY = myTexture.uvRect.y;
     manager = GameObject.FindGameObjectWithTag("Manager").GetComponent<Selfish_Sam_Manager>();
     //movSpeed -= movSpeed * manager.verticalSpeedIncrease;
 }
开发者ID:dany1532,项目名称:Social_Clues,代码行数:8,代码来源:TiledTextureMovement.cs


示例17: OnEnableLate

 protected override void OnEnableLate()
 {
     uiTexture = GetComponent<UITexture>();
     if (uiTexture == null)
     {
         Debug.LogError("Can not find UITexture.");
         Destroy(this);
     }
 }
开发者ID:juliancruz87,项目名称:transpp,代码行数:9,代码来源:OnlineMapsNGUITextureControl.cs


示例18: Start

    void Start()
    {
        MuzzleyAppController.OnReady += OnMuzzleyAppReady;
        loadingbar = GameObject.Find("foreground").GetComponent<UISprite>();
        loadingbar.transform.localScale = new Vector3(0, loadingbar.transform.localScale.y, loadingbar.transform.localScale.z);

        qrcode = GameObject.Find("QrCode").GetComponent<UITexture>();
        qrcode.enabled = false;
    }
开发者ID:vitormartins1,项目名称:batebatemuzzley,代码行数:9,代码来源:QrCodeController.cs


示例19: Awake

 // Use this for initialization
 void Awake()
 {
     if ( m_Texture == null ){
         m_Texture = gameObject.GetComponent<UITexture>();
     }
     if (m_Texture == null ){
         Debug.LogError("No Texture Found!!");
     }
 }
开发者ID:aminebenali,项目名称:dancing-cell-code,代码行数:10,代码来源:CommonUITexture.cs


示例20: Awake

	// Use this for initialization
    void Awake()
    {
        uiTexture = transform.GetComponent<UITexture>();
        PurpleSandClock = (MovieTexture)Resources.Load("shalou");
        GreenSandClock = (MovieTexture)Resources.Load("shalougreen");
        SandClockTurning = (MovieTexture)Resources.Load("shalouxuan");
        EnergyManager.Instance.StartTurn += this.StartTurn;
        EnergyManager.Instance.TurnsEnd += this.TurnsEnd;
        uiTexture.mainTexture = null;
    }
开发者ID:wHo2,项目名称:TMC,代码行数:11,代码来源:Sand.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# UIToolbar类代码示例发布时间:2022-05-24
下一篇:
C# UITextView类代码示例发布时间: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