-
Notifications
You must be signed in to change notification settings - Fork 190
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #55 from kimsama/merge/templatepath
Merge/templatepath
- Loading branch information
Showing
14 changed files
with
197 additions
and
444 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
Assets/QuickSheet/Editor/Util/SingletonScriptableObject.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
using System.Linq; | ||
using UnityEngine; | ||
|
||
namespace UnityQuickSheet | ||
{ | ||
/// <summary> | ||
/// Abstract class for making reload-proof singletons out of ScriptableObjects | ||
/// Returns the asset created on editor, null if there is none | ||
/// Based on https://www.youtube.com/watch?v=VBA1QCoEAX4 | ||
/// | ||
/// See Also: | ||
/// blog page: http://baraujo.net/unity3d-making-singletons-from-scriptableobjects-automatically/ | ||
/// gist page: https://gist.github.com/baraujo/07bb162a1f916595cad1a2d1fee5e72d | ||
/// </summary> | ||
/// <typeparam name="T">Type of the singleton</typeparam> | ||
|
||
public abstract class SingletonScriptableObject<T> : ScriptableObject where T : ScriptableObject | ||
{ | ||
static T _instance = null; | ||
public static T Instance | ||
{ | ||
get | ||
{ | ||
if (!_instance) | ||
_instance = Resources.FindObjectsOfTypeAll<T>().FirstOrDefault(); | ||
return _instance; | ||
} | ||
} | ||
} | ||
} |
Binary file not shown.
4 changes: 2 additions & 2 deletions
4
...celPlugin/Editor/ExcelSettings.asset.meta → ...elPlugin/Editor/Excel Settings.asset.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
4 changes: 2 additions & 2 deletions
4
...ugin/Editor/GoogleDataSettings.asset.meta → ...in/Editor/Google Data Settings.asset.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
27 changes: 0 additions & 27 deletions
27
Assets/QuickSheet/GDataPlugin/Editor/GoogleDataSettings.asset
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.