Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hdrp/add volume component blue book link #2362

Merged
Merged
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
8426ea9
Initial addition of documentation URL button to Volume editor framework
johnpars Oct 8, 2020
e979134
Integrate the help button icon for volume component documentation.
johnpars Oct 8, 2020
4d4d710
Correct the alignment of documentation icon so it lines up with addit…
johnpars Oct 8, 2020
a65dfbb
Add also a volume component documentation attribute. This adds suppor…
johnpars Oct 8, 2020
6a95dda
Initial addition of documentation URL for custom volume editors
johnpars Oct 8, 2020
9d7e26b
Initial commit of documentation URL for default volume editors (using…
johnpars Oct 8, 2020
fed6d64
Swap the place of documentation icon with additional options icon
johnpars Oct 8, 2020
aa760b0
update changelog
johnpars Oct 8, 2020
cf85dd8
Revert choosing between two different documentations for raytracing. …
johnpars Oct 8, 2020
a4b605d
Merge latest master
johnpars Oct 19, 2020
3d072f9
Remove the VolumeComponentDocumentation attribute. Same thing can be …
johnpars Oct 19, 2020
4d758aa
Use the HelpURL for all volume components, remove the editor override
johnpars Oct 19, 2020
dc2bdc4
Fix typos to broken URL
johnpars Oct 19, 2020
e004fc8
Fix core util function signature to not break other packages or user …
johnpars Oct 20, 2020
c463e03
Preprocess the help URL attributes
johnpars Oct 20, 2020
5d69120
Do the documentation loading in static construction
johnpars Oct 20, 2020
5611cea
Organize placement of static function
johnpars Oct 20, 2020
449c2e2
Merge branch 'master' into HDRP/add-volume-component-blue-book-link
sebastienlagarde Oct 22, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Organize placement of static function
  • Loading branch information
johnpars committed Oct 20, 2020
commit 5611cea36b3ca17ac152192587bc0eb1536adf60
Original file line number Diff line number Diff line change
Expand Up @@ -67,34 +67,6 @@ static VolumeComponentListEditor()
ReloadDocumentation();
}

static void ReloadDocumentation()
{
if (m_EditorDocumentationURLs == null)
m_EditorDocumentationURLs = new Dictionary<Type, string>();
m_EditorDocumentationURLs.Clear();

string GetVolumeComponentDocumentation(Type component)
{
var attrs = component.GetCustomAttributes(false);
foreach (var attr in attrs)
{
if (attr is HelpURLAttribute attrDocumentation)
return attrDocumentation.URL;
}

// There is no documentation for this volume component.
return null;
}

// Gets the list of all available component editors
var componentTypes = CoreUtils.GetAllTypesDerivedFrom<VolumeComponent>();
foreach (var componentType in componentTypes)
{
if (!m_EditorDocumentationURLs.ContainsKey(componentType))
m_EditorDocumentationURLs.Add(componentType, GetVolumeComponentDocumentation(componentType));
}
}

/// <summary>
/// Creates a new instance of <see cref="VolumeComponentListEditor"/> to use in an
/// existing editor.
Expand Down Expand Up @@ -539,5 +511,32 @@ static void PasteSettings(VolumeComponent targetComponent)
Undo.RecordObject(targetComponent, "Paste Settings");
JsonUtility.FromJsonOverwrite(typeData, targetComponent);
}

static void ReloadDocumentation()
{
if (m_EditorDocumentationURLs == null)
m_EditorDocumentationURLs = new Dictionary<Type, string>();
m_EditorDocumentationURLs.Clear();

string GetVolumeComponentDocumentation(Type component)
{
var attrs = component.GetCustomAttributes(false);
foreach (var attr in attrs)
{
if (attr is HelpURLAttribute attrDocumentation)
return attrDocumentation.URL;
}

// There is no documentation for this volume component.
return null;
}

var componentTypes = CoreUtils.GetAllTypesDerivedFrom<VolumeComponent>();
foreach (var componentType in componentTypes)
{
if (!m_EditorDocumentationURLs.ContainsKey(componentType))
m_EditorDocumentationURLs.Add(componentType, GetVolumeComponentDocumentation(componentType));
}
}
}
}