Exemple #1
0
        public ShaderPart(MaterialProperty prop, int xOffset, string displayName, PropertyOptions options)
        {
            this.materialProperty           = prop;
            this.xOffset                    = xOffset;
            this.options                    = options;
            this.content                    = new GUIContent(displayName, options.tooltip);
            this.reference_properties_exist = options.reference_properties != null && options.reference_properties.Length > 0;
            this.reference_property_exists  = options.reference_property != null;

            if (prop == null)
            {
                return;
            }
            this.kaj_isAnimatedProperty = ShaderEditor.FindProperty(ShaderEditor.currentlyDrawing.properties, prop.name + "Animated");
            this.is_animatable          = kaj_isAnimatedProperty != null;
            this.is_animated            = is_animatable && kaj_isAnimatedProperty.floatValue > 0;
            this.is_renaming            = is_animatable && kaj_isAnimatedProperty.floatValue == 2;
        }