Пример #1
0
        internal static void AttributeModeLabel(string Label, VFXAttributeMode mode, GUIStyle style, params GUILayoutOption[] options)
        {
            Color backup = GUI.color;

            GUI.color = attributeModeColors[mode];
            EditorGUILayout.LabelField(Label, style, options);
            GUI.color = backup;
        }
Пример #2
0
        private static string GetInputModifier(VFXAttributeMode mode)
        {
            if ((mode & VFXAttributeMode.Write) != 0)
            {
                return("inout ");
            }

            return(string.Empty);
        }
Пример #3
0
        public static IEnumerable <VFXAttributeInfo> GetAttributes(Mode mode, VFXAttributeMode attrMode)
        {
            yield return(new VFXAttributeInfo(VFXAttribute.SizeX, attrMode));

            if ((int)mode > (int)Mode.X)
            {
                yield return(new VFXAttributeInfo(VFXAttribute.SizeY, attrMode));
            }

            if ((int)mode > (int)Mode.XY)
            {
                yield return(new VFXAttributeInfo(VFXAttribute.SizeZ, attrMode));
            }
        }
Пример #4
0
        public VFXAttributeMode GetAttributeMode(VFXAttribute attrib)
        {
            VFXAttributeMode mode = VFXAttributeMode.None;
            Dictionary <VFXContext, VFXAttributeMode> contexts;

            if (m_AttributesToContexts.TryGetValue(attrib, out contexts))
            {
                foreach (var context in contexts)
                {
                    mode |= context.Value;
                }
            }

            return(mode);
        }
Пример #5
0
 public override string GetAttributeDataDeclaration(VFXAttributeMode mode)
 {
     if (m_StoredCurrentAttributes.Count == 0)
     {
         return(string.Empty);
     }
     else if ((mode & VFXAttributeMode.Write) != 0)
     {
         return("RWByteAddressBuffer attributeData;");
     }
     else
     {
         return("ByteAddressBuffer attributeData;");
     }
 }
Пример #6
0
        internal static void AttributeModeLabel(string Label, VFXAttributeMode mode, GUIStyle style, params GUILayoutOption[] options)
        {
            Color backup = GUI.color;

            var c = new Color32(160, 160, 160, 255);

            if ((mode & VFXAttributeMode.Read) != 0)
            {
                c.b = 255;
            }
            if ((mode & VFXAttributeMode.Write) != 0)
            {
                c.r = 255;
            }
            if ((mode & VFXAttributeMode.ReadSource) != 0)
            {
                c.g = 255;
            }

            GUI.color = c;
            GUILayout.Label(Label, style, options);
            GUI.color = backup;
        }
Пример #7
0
 public abstract string GetAttributeDataDeclaration(VFXAttributeMode mode);
Пример #8
0
 public override string GetAttributeDataDeclaration(VFXAttributeMode mode)
 {
     throw new NotImplementedException();
 }
 public VFXAttributeInfo(VFXAttribute attrib, VFXAttributeMode mode)
 {
     this.attrib = attrib;
     this.mode   = mode;
 }
Пример #10
0
 //constructor to suppress "field is never assigned" warning
 public AttributeDeclarationInfo(string x, VFXAttributeMode y)
 {
     name = x;
     mode = y;
 }