当前位置: 首页>>代码示例>>C#>>正文


C# Renderer.GetPropertyBlock方法代码示例

本文整理汇总了C#中UnityEngine.Renderer.GetPropertyBlock方法的典型用法代码示例。如果您正苦于以下问题:C# Renderer.GetPropertyBlock方法的具体用法?C# Renderer.GetPropertyBlock怎么用?C# Renderer.GetPropertyBlock使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UnityEngine.Renderer的用法示例。


在下文中一共展示了Renderer.GetPropertyBlock方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SetupMaterialPropertyBlock

 public static void SetupMaterialPropertyBlock(MaterialProperty materialProp, int changedMask, Renderer target)
 {
   MaterialPropertyBlock materialPropertyBlock = new MaterialPropertyBlock();
   target.GetPropertyBlock(materialPropertyBlock);
   materialProp.WriteToMaterialPropertyBlock(materialPropertyBlock, changedMask);
   target.SetPropertyBlock(materialPropertyBlock);
 }
开发者ID:BlakeTriana,项目名称:unity-decompiled,代码行数:7,代码来源:MaterialAnimationUtility.cs

示例2: Awake

  protected virtual void Awake() {
    _handModel = GetComponent<HandModel>();
    _renderer = GetComponentInChildren<Renderer>();

    _fadePropertyBlock = new MaterialPropertyBlock();
    _renderer.GetPropertyBlock(_fadePropertyBlock);
    _fadePropertyBlock.SetFloat("_Fade", 0);
    _renderer.SetPropertyBlock(_fadePropertyBlock);
  }
开发者ID:CMPUT302-W2016,项目名称:HCI-Gestures,代码行数:9,代码来源:HandFader.cs

示例3: Start

    void Start()
    {
        _rnd = GetComponent<Renderer>();
        _rnd.GetPropertyBlock(_block = new MaterialPropertyBlock());

        _inputs = input.GetPixels();

        _width = input.width;
        _height = input.height;
        _pixelCount = _inputs.Length;
        _texSize = new Vector2(_width, _height);

        output = new Texture2D(_width, _height, TextureFormat.ARGB32, false);
        _outputs = input.GetPixels();
        output.SetPixels(_outputs);
        output.Apply();

        _block.SetTexture(PROP_MAIN_TEX, output);
        _rnd.SetPropertyBlock(_block);
        _mcmc = new MCMC(output, stdDev);

        StartCoroutine (Pinning (0.01f, 200));
    }
开发者ID:nobnak,项目名称:MCMC,代码行数:23,代码来源:TextureModifier.cs

示例4: SetBlendWeight

		//renderer
		public static void SetBlendWeight(Renderer target, float weight) {
			#if USE_PROPERTY_BLOCKS
			if( propBlock == null ) propBlock = new MaterialPropertyBlock();
			else propBlock.Clear();
			//NOTE: this expects the property block to be cleared prior to being called or the weight property will accumulate every frame!
			//MaterialPropertyBlock block = new MaterialPropertyBlock();
			target.GetPropertyBlock(propBlock);
			propBlock.AddFloat("_BlendWeightIBL", weight);
			target.SetPropertyBlock(propBlock);
			#else
			Material[] mats = getTargetMaterials(target);
			foreach(Material mat in mats) {
				mat.SetFloat("_BlendWeightIBL", weight);
			}
			#endif
		}
开发者ID:elephantatwork,项目名称:Secret-Game,代码行数:17,代码来源:Sky.cs

示例5: ApplyFast

		public void ApplyFast(Renderer target, int blendIndex) {
			// Binds IBL data, exposure, and a skybox texture globally or to a specific game object
			#if USE_PROPERTY_BLOCKS
				if(propBlock == null) propBlock = new MaterialPropertyBlock();
				if(blendIndex == 0) {
					propBlock.Clear();
				} else {
					target.GetPropertyBlock(propBlock);						
				}
				ApplyToBlock(ref propBlock, this.blendIDs[blendIndex]);
				target.SetPropertyBlock(propBlock);
			#else
				//SharedMaterials are now used everywhere except through SkyAnchor
				foreach(Material mat in target.sharedMaterials) {
					Apply(mat, blendIndex);
				}				
			#endif
		}
开发者ID:elephantatwork,项目名称:Secret-Game,代码行数:18,代码来源:Sky.cs


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