コード例 #1
0
        public override void CollectShaderProperties(PropertyCollector properties, GenerationMode generationMode)
        {
            if (!generationMode.IsPreview())
            {
                return;
            }

            base.CollectShaderProperties(properties, generationMode);

            GradientUtils.GetGradientPropertiesForPreview(properties, GetVariableNameForNode(), gradient);
        }
コード例 #2
0
ファイル: GraphData.cs プロジェクト: markpony100/OceanShader
        public void CollectShaderProperties(PropertyCollector collector, GenerationMode generationMode)
        {
            foreach (var prop in properties)
            {
                if (generationMode == GenerationMode.Preview && prop.propertyType == PropertyType.Gradient)
                {
                    GradientShaderProperty gradientProperty = prop as GradientShaderProperty;
                    GradientUtils.GetGradientPropertiesForPreview(collector, gradientProperty.referenceName, gradientProperty.value);
                    continue;
                }

                collector.AddShaderProperty(prop);
            }
        }
コード例 #3
0
        public override void AddDefaultProperty(PropertyCollector properties, GenerationMode generationMode)
        {
            var matOwner = owner as AbstractMaterialNode;

            if (matOwner == null)
            {
                throw new Exception(string.Format("Slot {0} either has no owner, or the owner is not a {1}", this, typeof(AbstractMaterialNode)));
            }

            if (generationMode != GenerationMode.Preview)
            {
                return;
            }

            GradientUtils.GetGradientPropertiesForPreview(properties, matOwner.GetVariableNameForSlot(id), value);
        }