Esempio n. 1
0
        /// <summary>
        /// Initializes the attached component extension.
        /// </summary>
        public void InitializeComponentExtension()
        {
            var forceCreateMaterial = false;

            if (!componentExtension || !componentExtension.IsValidFor(gameObject))
            {
                componentExtension  = ComponentExtension.CreateForObject(gameObject);
                forceCreateMaterial = true;
            }
            if (!componentExtension)
            {
                return;                      // No supported component types found on the extended object.
            }
            componentExtension.OnEffectEnabled();
            if (string.IsNullOrEmpty(ShaderFamily))
            {
                ShaderFamily = componentExtension.DefaultShaderFamily;
            }
            SetMaterialProperties(forceCreateMaterial);
        }
 public ShaderPropertiesList(SerializedObject serializedObject, SerializedProperty serializedProperty, ComponentExtension componentExtension)
 {
     this.serializedObject   = serializedObject;
     this.serializedProperty = serializedProperty;
     this.componentExtension = componentExtension;
 }