Version: 2021.3

AssetModificationProcessor.OnWillCreateAsset(string)

切换到手册

描述

Unity 在即将创建未导入的资源(例如,.meta 文件)时调用此方法。

using UnityEngine;

public class CustomAssetModificationProcessor : UnityEditor.AssetModificationProcessor { static void OnWillCreateAsset(string assetName) { Debug.Log("OnWillCreateAsset is being called with the following asset: " + assetName + "."); } }