Exemple #1
0
        public override AbstractShaderProperty Copy()
        {
            var copied = new Texture2DArrayShaderProperty();

            copied.displayName = displayName;
            copied.value       = value;
            return(copied);
        }
        public IShaderProperty AsShaderProperty()
        {
            var prop = new Texture2DArrayShaderProperty {
                value = m_Texture
            };

            if (texture != null)
            {
                prop.displayName = texture.name;
            }
            return(prop);
        }
        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)));
            }

            var prop = new Texture2DArrayShaderProperty();

            prop.overrideReferenceName = matOwner.GetVariableNameForSlot(id);
            prop.modifiable            = false;
            prop.generatePropertyBlock = true;
            prop.value.textureArray    = textureArray;
            properties.AddShaderProperty(prop);
        }