예제 #1
0
        private ThryPropertyType GetPropertyType(MaterialProperty p, PropertyOptions options)
        {
            string name = p.name;

            MaterialProperty.PropFlags flags = p.flags;

            if (DrawingData.lastPropertyDrawerType == DrawerType.Header)
            {
                return((DrawingData.lastPropertyDrawer as ThryHeaderDrawer).GetEndProperty() != null ? ThryPropertyType.headerWithEnd : ThryPropertyType.header);
            }

            if (name == PROPERTY_NAME_MASTER_LABEL)
            {
                return(ThryPropertyType.master_label);
            }
            if (name == PROPERTY_NAME_ON_SWAP_TO_ACTIONS)
            {
                return(ThryPropertyType.on_swap_to);
            }
            if (name == "_ShaderOptimizerEnabled")
            {
                return(ThryPropertyType.shader_optimizer);
            }

            if (flags == MaterialProperty.PropFlags.HideInInspector)
            {
                if (name.StartsWith("m_start"))
                {
                    return(ThryPropertyType.legacy_header_start);
                }
                if (name.StartsWith("m_end"))
                {
                    return(ThryPropertyType.legacy_header_end);
                }
                if (name.StartsWith("m_"))
                {
                    return(ThryPropertyType.legacy_header);
                }
                if (name.StartsWith("g_start"))
                {
                    return(ThryPropertyType.group_start);
                }
                if (name.StartsWith("g_end"))
                {
                    return(ThryPropertyType.group_end);
                }
                if (name.StartsWith("footer_"))
                {
                    return(ThryPropertyType.footer);
                }
                string noWhiteSpaces = name.Replace(" ", "");
                if (noWhiteSpaces == "Instancing")
                {
                    return(ThryPropertyType.instancing);
                }
                if (noWhiteSpaces == "DSGI")
                {
                    return(ThryPropertyType.dsgi);
                }
                if (noWhiteSpaces == "LightmapFlags")
                {
                    return(ThryPropertyType.lightmap_flags);
                }
                if (noWhiteSpaces == PROPERTY_NAME_LOCALE)
                {
                    return(ThryPropertyType.locale);
                }
                if (Regex.Match(name.ToLower(), @"^space\d*$").Success)
                {
                    return(ThryPropertyType.space);
                }
            }
            else if (flags.HasFlag(MaterialProperty.PropFlags.HideInInspector) == false)
            {
                if (!options.hide_in_inspector)
                {
                    return(ThryPropertyType.property);
                }
            }
            return(ThryPropertyType.none);
        }
예제 #2
0
        private ThryPropertyType GetPropertyType(MaterialProperty p, PropertyOptions options)
        {
            string name = p.name;

            MaterialProperty.PropFlags flags = p.flags;

            if (DrawingData.LastPropertyDrawerType == DrawerType.Header)
            {
                return((DrawingData.LastPropertyDrawer as ThryHeaderDrawer).GetEndProperty() != null ? ThryPropertyType.headerWithEnd : ThryPropertyType.header);
            }

            if (flags == MaterialProperty.PropFlags.HideInInspector)
            {
                if (name == PROPERTY_NAME_MASTER_LABEL)
                {
                    return(ThryPropertyType.master_label);
                }
                if (name == PROPERTY_NAME_ON_SWAP_TO_ACTIONS)
                {
                    return(ThryPropertyType.on_swap_to);
                }
                if (name == PROPERTY_NAME_SHADER_VERSION)
                {
                    return(ThryPropertyType.shader_version);
                }

                if (name.StartsWith("m_start", StringComparison.Ordinal))
                {
                    return(ThryPropertyType.legacy_header_start);
                }
                if (name.StartsWith("m_end", StringComparison.Ordinal))
                {
                    return(ThryPropertyType.legacy_header_end);
                }
                if (name.StartsWith("m_", StringComparison.Ordinal))
                {
                    return(ThryPropertyType.legacy_header);
                }
                if (name.StartsWith("g_start", StringComparison.Ordinal))
                {
                    return(ThryPropertyType.group_start);
                }
                if (name.StartsWith("g_end", StringComparison.Ordinal))
                {
                    return(ThryPropertyType.group_end);
                }
                if (name.StartsWith("footer_", StringComparison.Ordinal))
                {
                    return(ThryPropertyType.footer);
                }
                if (name == "Instancing")
                {
                    return(ThryPropertyType.instancing);
                }
                if (name == "DSGI")
                {
                    return(ThryPropertyType.dsgi);
                }
                if (name == "LightmapFlags")
                {
                    return(ThryPropertyType.lightmap_flags);
                }
                if (name == PROPERTY_NAME_LOCALE)
                {
                    return(ThryPropertyType.locale);
                }
                if (name.StartsWith("space"))
                {
                    return(ThryPropertyType.space);
                }
            }
            else if (flags.HasFlag(MaterialProperty.PropFlags.HideInInspector) == false)
            {
                if (!options.hide_in_inspector)
                {
                    return(ThryPropertyType.property);
                }
            }
            return(ThryPropertyType.none);
        }