mirror of
https://github.com/bdunderscore/modular-avatar.git
synced 2025-01-17 11:50:11 +08:00
chore: fix warnings
This commit is contained in:
parent
21373e13bc
commit
5231b75055
@ -140,6 +140,20 @@ namespace nadena.dev.modular_avatar.core.editor
|
|||||||
SessionState.GetBool("MAIconsDisabled", true);
|
SessionState.GetBool("MAIconsDisabled", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
internal static T GetOrAddComponent<T>(this Component self) where T : Component
|
||||||
|
{
|
||||||
|
var component = self.GetComponent<T>();
|
||||||
|
if (component == null) component = self.gameObject.AddComponent<T>();
|
||||||
|
return component;
|
||||||
|
}
|
||||||
|
|
||||||
|
internal static T GetOrAddComponent<T>(this GameObject self) where T : Component
|
||||||
|
{
|
||||||
|
var component = self.GetComponent<T>();
|
||||||
|
if (component == null) component = self.AddComponent<T>();
|
||||||
|
return component;
|
||||||
|
}
|
||||||
|
|
||||||
public static string GenerateAssetPath()
|
public static string GenerateAssetPath()
|
||||||
{
|
{
|
||||||
return GetGeneratedAssetsFolder() + "/" + GUID.Generate() + ".asset";
|
return GetGeneratedAssetsFolder() + "/" + GUID.Generate() + ".asset";
|
||||||
|
Loading…
Reference in New Issue
Block a user