文档

Unity Engine

Unity Engine

CreateEmptyPrefab(string)

Creates an empty Prefab at given path.
阅读时间1 分钟最后更新于 1 个月前

Definition

  • Type: Method
  • Namespace: UnityEditor
  • Assembly: UnityEditor.CoreModule
警告
Deprecated. The concept of creating a completely empty Prefab has been discontinued. You can however use SaveAsPrefabAsset with an empty GameObject.
public static Object CreateEmptyPrefab(string path)

Parameters

path

The asset path to use for the new empty Prefab.

Returns

Type

Description

ObjectA reference to the new Prefab Asset.

Remarks

If a Prefab at the path already exists it will be deleted and replaced with an empty Prefab. Returns a reference to the Prefab.