Skip to content

Commit

Permalink
[fix] Added additional path checking for the stylesheets, should the …
Browse files Browse the repository at this point in the history
…Descant folder be anywhere other than the root of the Packages folder
  • Loading branch information
Owmacohe committed Jan 7, 2024
1 parent 1c5979f commit b846484
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 13 deletions.
7 changes: 0 additions & 7 deletions Descant-1.0.0.unitypackage.meta

This file was deleted.

5 changes: 4 additions & 1 deletion Editor/Window/DescantActorEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,10 @@ void ReloadGUI()
/// </summary>
void AddStyleSheet()
{
StyleSheet styleSheet = AssetDatabase.LoadAssetAtPath<StyleSheet>("Packages/com.owmacohe.descant/Assets/DescantActorEditorStyleSheet.uss");
StyleSheet styleSheet = (StyleSheet)EditorGUIUtility.Load("Packages/com.owmacohe.descant/Assets/DescantActorEditorStyleSheet.uss");
if (styleSheet == null) styleSheet = (StyleSheet)EditorGUIUtility.Load("Assets/com.owmacohe.descant/Assets/DescantActorEditorStyleSheet.uss");
if (styleSheet == null) styleSheet = (StyleSheet)EditorGUIUtility.Load("Assets/Packages/com.owmacohe.descant/Assets/DescantActorEditorStyleSheet.uss");

rootVisualElement.styleSheets.Add(styleSheet);
}

Expand Down
7 changes: 5 additions & 2 deletions Editor/Window/DescantEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,10 @@ void AddGraphView()
/// </summary>
void AddStyleSheet()
{
StyleSheet styleSheet = AssetDatabase.LoadAssetAtPath<StyleSheet>("Packages/com.owmacohe.descant/Assets/DescantGraphEditorStyleSheet.uss");
StyleSheet styleSheet = (StyleSheet)EditorGUIUtility.Load("Packages/com.owmacohe.descant/Assets/DescantGraphEditorStyleSheet.uss");
if (styleSheet == null) styleSheet = (StyleSheet)EditorGUIUtility.Load("Assets/com.owmacohe.descant/Assets/DescantGraphEditorStyleSheet.uss");
if (styleSheet == null) styleSheet = (StyleSheet)EditorGUIUtility.Load("Assets/Packages/com.owmacohe.descant/Assets/DescantGraphEditorStyleSheet.uss");

rootVisualElement.styleSheets.Add(styleSheet);
}

Expand Down Expand Up @@ -190,7 +193,7 @@ void AddToolbar()
}

#endregion

#region Saving and Loading

/// <summary>
Expand Down
5 changes: 4 additions & 1 deletion Editor/Window/DescantGraphView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,10 @@ void AddManipulators()
/// </summary>
void AddStyleSheet()
{
StyleSheet styleSheet = AssetDatabase.LoadAssetAtPath<StyleSheet>("Packages/com.owmacohe.descant/Assets/DescantGraphEditorStyleSheet.uss");
StyleSheet styleSheet = (StyleSheet)EditorGUIUtility.Load("Packages/com.owmacohe.descant/Assets/DescantGraphEditorStyleSheet.uss");
if (styleSheet == null) styleSheet = (StyleSheet)EditorGUIUtility.Load("Assets/com.owmacohe.descant/Assets/DescantGraphEditorStyleSheet.uss");
if (styleSheet == null) styleSheet = (StyleSheet)EditorGUIUtility.Load("Assets/Packages/com.owmacohe.descant/Assets/DescantGraphEditorStyleSheet.uss");

styleSheets.Add(styleSheet);
}

Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "com.owmacohe.descant",
"displayName": "Descant",
"version": "1.0.0",
"version": "1.0.1",
"description": "An enhanced and and user-friendly Unity dialogue system plugin.\n\nDescant aims to hit the sweet spot between quality UI, powerful features, and easy-to-lean functionality, while also addressing many of the game-specific consequences of the standard dialogue manager setup.\n\nPlease view the README before beginning development.",
"unity": "2022.3",
"unityRelease": "7f1",
Expand Down

0 comments on commit b846484

Please sign in to comment.