예제 #1
0
        static DebugUI.HistoryEnumField GenerateHistoryEnumField(HDRenderPipelineAsset hdrpAsset, ref FrameSettingsHistory frameSettings, FrameSettingsField field, FrameSettingsFieldAttribute attribute, Type autoEnum)
        {
            Camera camera        = frameSettings.camera;
            var    renderType    = frameSettings.defaultType;
            string displayIndent = "";

            for (int indent = 0; indent < attribute.indentLevel; ++indent)
            {
                displayIndent += "  ";
            }
            return(new DebugUI.HistoryEnumField
            {
                displayName = displayIndent + attribute.displayedName,
                getter = () => frameSettingsHistory[camera].debug.IsEnabled(field) ? 1 : 0,
                setter = value =>
                {
                    var tmp = frameSettingsHistory[camera]; //indexer with struct will create a copy
                    tmp.debug.SetEnabled(field, value == 1);
                    frameSettingsHistory[camera] = tmp;
                },
                autoEnum = autoEnum,

                // Contrarily to other enum of DebugMenu, we do not need to stock index as
                // it can be computed again with data in the dedicated debug section of history
                getIndex = () => frameSettingsHistory[camera].debug.IsEnabled(field) ? 1 : 0,
                setIndex = (int a) => { },

                historyIndexGetter = new Func <int>[]
                {
                    () => frameSettingsHistory[camera].sanitazed.IsEnabled(field) ? 1 : 0,
                    () => frameSettingsHistory[camera].overridden.IsEnabled(field) ? 1 : 0,
                    () => hdrpAsset.GetDefaultFrameSettings(renderType).IsEnabled(field) ? 1 : 0
                }
            });
        }
예제 #2
0
        static DebugUI.HistoryBoolField GenerateHistoryBoolField(HDRenderPipelineAsset hdrpAsset, ref FrameSettingsHistory frameSettings, FrameSettingsField field, FrameSettingsFieldAttribute attribute)
        {
            Camera camera        = frameSettings.camera;
            var    renderType    = frameSettings.defaultType;
            string displayIndent = "";

            for (int indent = 0; indent < attribute.indentLevel; ++indent)
            {
                displayIndent += "  ";
            }
            return(new DebugUI.HistoryBoolField
            {
                displayName = displayIndent + attribute.displayedName,
                getter = () => frameSettingsHistory[camera].debug.IsEnabled(field),
                setter = value =>
                {
                    var tmp = frameSettingsHistory[camera]; //indexer with struct will create a copy
                    tmp.debug.SetEnabled(field, value);
                    frameSettingsHistory[camera] = tmp;
                },
                historyGetter = new Func <bool>[]
                {
                    () => frameSettingsHistory[camera].sanitazed.IsEnabled(field),
                    () => frameSettingsHistory[camera].overridden.IsEnabled(field),
                    () => hdrpAsset.GetDefaultFrameSettings(renderType).IsEnabled(field)
                }
            });
        }