Skip to content

Commit

Permalink
Remove TweenEditorSetting from Resources folder
Browse files Browse the repository at this point in the history
  • Loading branch information
ls9512 committed Mar 17, 2021
1 parent 068e794 commit 33f1784
Show file tree
Hide file tree
Showing 18 changed files with 23 additions and 8 deletions.

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

File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
8 changes: 8 additions & 0 deletions Core/Script/Editor/Setting.meta

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

Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@
// E-mail : [email protected]
//
/////////////////////////////////////////////////////////////////////////////
#if UNITY_EDITOR
using UnityEditor;
using UnityEngine;

namespace Aya.Tween
{
[CreateAssetMenu(menuName = "UTween/Tween Setting", fileName = "TweenEditorSetting")]
[CreateAssetMenu(menuName = "UTween/Tween Editor Setting", fileName = "TweenEditorSetting")]
public class TweenEditorSetting : ScriptableObject
{
#region Instance
Expand All @@ -21,7 +23,7 @@ public static TweenEditorSetting Ins
{
if (Instance == null)
{
Instance = Load(nameof(TweenEditorSetting));
Instance = FindAsset<TweenEditorSetting>();
}

return Instance;
Expand All @@ -30,12 +32,16 @@ public static TweenEditorSetting Ins

protected static TweenEditorSetting Instance;

internal static TweenEditorSetting Load(string fileName)
internal static T FindAsset<T>() where T : Object
{
var ins = Resources.Load<TweenEditorSetting>(fileName);
return ins;
}

var guidList = AssetDatabase.FindAssets("t:" + typeof(T).FullName);
if (guidList != null && guidList.Length > 0)
{
return AssetDatabase.LoadAssetAtPath<T>(AssetDatabase.GUIDToAssetPath(guidList[0]));
}

return null;
}
#endregion

[Header("Icon")]
Expand All @@ -45,3 +51,4 @@ internal static TweenEditorSetting Load(string fileName)
public Texture2D IconRefresh;
}
}
#endif

0 comments on commit 33f1784

Please sign in to comment.