Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


RevertPrefabInstance

Reverts all overrides on a Prefab instance.
Read time 1 minuteLast updated 12 days ago

Definition

  • Type: Method
  • Namespace: UnityEditor
  • Assembly: UnityEditor

RevertPrefabInstance(GameObject)

Reverts all overrides on a Prefab instance.
Warning
Deprecated. Use the overload that takes an InteractionMode parameter.
public static bool RevertPrefabInstance(GameObject go)

Parameters

Returns

Type

Description

bool

Remarks

This reverts all property overrides, added and removed components, and added child GameObjects (including added child Prefab instances).
The Transform position and rotation of a root GameObject in a Prefab instance is not cleared, nor are other default override properties.

RevertPrefabInstance(GameObject, InteractionMode)

Reverts all overrides on a Prefab instance.
public static void RevertPrefabInstance(GameObject instanceRoot, InteractionMode action)

Parameters

instanceRoot

The root of the Prefab instance.

The interaction mode for this action.

Remarks

This reverts all property overrides, added and removed components, and added child GameObjects (including added child Prefab instances).
The Transform position and rotation of a root GameObject in a Prefab instance is not cleared, nor are other default override properties.