示例#1
0
		protected override void OnEnable()
		{
			if (_renderer == null)
			{
				_renderer = this.GetComponent<MeshRenderer>();
				if (_renderer == null)
				{
					Debug.LogWarning("[AVProVideo] No MeshRenderer set or found in gameobject");
				}
			}

			_propTexture = new LazyShaderProperty(_texturePropertyName);

			ForceUpdate();
		}
 protected override void SaveProperties()
 {
     if (_material != null)
     {
         if (string.IsNullOrEmpty(_texturePropertyName))
         {
             _originalTexture = _material.mainTexture;
             _originalScale   = _material.mainTextureScale;
             _originalOffset  = _material.mainTextureOffset;
         }
         else
         {
             _originalTexture = _material.GetTexture(_texturePropertyName);
             _originalScale   = _material.GetTextureScale(_texturePropertyName);
             _originalOffset  = _material.GetTextureOffset(_texturePropertyName);
         }
     }
     _propTexture = new LazyShaderProperty(_texturePropertyName);
 }