Storyline+Dialog初步
This commit is contained in:
25
Packages/io.continis.subassets/Editor/SubAssetsToolbox.cs
Normal file
25
Packages/io.continis.subassets/Editor/SubAssetsToolbox.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using SubAssetsToolbox.Editor.SubAssetAware;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace SubAssetsToolbox.Editor
|
||||
{
|
||||
static class SubAssetsToolbox
|
||||
{
|
||||
public static void AddSubAsset(string destinationPath, Object objectToClone, out Object newClone)
|
||||
{
|
||||
newClone = Object.Instantiate(objectToClone);
|
||||
newClone.name = objectToClone.name;
|
||||
AssetDatabase.AddObjectToAsset(newClone, destinationPath);
|
||||
|
||||
SubAssetAwareMethods.NotifyAwareObjectOfAddition(destinationPath, newClone);
|
||||
}
|
||||
|
||||
public static void RemoveSubAsset(string oldParentPath, Object objectToRemove)
|
||||
{
|
||||
SubAssetAwareMethods.NotifyAwareObjectOfRemoval(oldParentPath, objectToRemove);
|
||||
|
||||
AssetDatabase.RemoveObjectFromAsset(objectToRemove);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user