Пример #1
0
 internal void Initialize(MaterialEditor materialEditor, MaterialProperty[] properties, MaterialUIBlockList parent)
 {
     this.materialEditor = materialEditor;
     this.parent         = parent;
     materials           = materialEditor.targets
                           .Select(target => target as Material)
                           .ToArray();
 }
        public void         Initialize(MaterialEditor materialEditor, MaterialProperty[] properties, MaterialUIBlockList parent)
        {
            this.materialEditor = materialEditor;
            this.parent         = parent;
            materials           = materialEditor.targets.Select(target => target as Material).ToArray();

            // We should always register the key used to keep collapsable state
            materialEditor.InitExpandableState();
        }
Пример #3
0
 public LayersUIBlock()
 {
     for (int i = 0; i < 4; i++)
     {
         layerUIBlocks[i] = new MaterialUIBlockList
         {
             new LayeringOptionsUIBlock(Styles.layeringOptionsExpandableBits[i], i),
             new LitSurfaceInputsUIBlock((Expandable)((uint)Expandable.MainInput + i), kMaxLayerCount, i, features: litInputsFeatures),
             new DetailInputsUIBlock((Expandable)((uint)Expandable.MainDetail + i), kMaxLayerCount, i, features: detailInputsFeatures),
         };
     }
 }
Пример #4
0
        void CreateUIBlockLayers()
        {
            layerUIBlocks = new MaterialUIBlockList[4];

            for (int i = 0; i < 4; i++)
            {
                layerUIBlocks[i] = new MaterialUIBlockList(parent)
                {
                    new LayeringOptionsUIBlock(Styles.layeringOptionsExpandableBits[i], i),
                    new LitSurfaceInputsUIBlock((ExpandableBit)((uint)ExpandableBit.MainInput + i), kMaxLayerCount, i, features: litInputsFeatures),
                    new DetailInputsUIBlock((ExpandableBit)((uint)ExpandableBit.MainDetail + i), kMaxLayerCount, i, features: detailInputsFeatures),
                };
            }
        }
Пример #5
0
        /// <summary>
        /// Constructs a TransparencyUIBlock based on the parameters.
        /// </summary>
        /// <param name="expandableBit">Bit index used to store the foldout state.</param>
        /// <param name="features">Features of the Transparency block.</param>
        public TransparencyUIBlock(ExpandableBit expandableBit, Features features = Features.All)
            : base(expandableBit, Styles.header)
        {
            m_Features = features;

            m_TransparencyBlocks = new MaterialUIBlockList(parent);
            if ((features & Features.Refraction) != 0)
            {
                m_TransparencyBlocks.Add(new RefractionUIBlock(1));  // This block will not be used in by a layered shader so we can safely set the layer count to 1
            }
            if ((features & Features.Distortion) != 0)
            {
                m_TransparencyBlocks.Add(new DistortionUIBlock());
            }
        }
Пример #6
0
 /// <summary>
 /// Construct a sub ui block list by passing the parent ui block list (useful for layered UI where ui blocks are nested)
 /// </summary>
 /// <param name="parent"></param>
 public MaterialUIBlockList(MaterialUIBlockList parent) => this.parent = parent;