Version: 2022.3
言語: 日本語
public static VersionControl.Task Delete (string assetProjectPath);
public static VersionControl.Task Delete (VersionControl.AssetList assets);
public static VersionControl.Task Delete (VersionControl.Asset asset);

パラメーター

assetProjectPath The path to the asset that is to be deleted.
assets 削除するアセットのリスト
asset 削除するアセット

説明

Starts a task to delete an Asset or a list of Assets from the disk and from the version control system.

アセットが正常に削除された場合、タスクが完了した後、タスクの resultCode が通知します。

Note that after this operation is completed, Asset Database is not refreshed automatically. It can be updated by calling AssetDatabase.Refresh.

using System.Collections.Generic;
using UnityEditor;
using UnityEditor.VersionControl;
using UnityEngine;

public class EditorScript : MonoBehaviour { [MenuItem("Version Control/Delete")] public static void ExampleDelete() { AssetList assets = new AssetList(); assets.Add(Provider.GetAssetByPath("Assets/ExampleAsset.cs")); assets.Add(Provider.GetAssetByPath("Assets/ExampleAsset.cs.meta")); Task t = Provider.Delete(assets); t.Wait(); } }
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961