Version: 5.3 (switch to 5.4b)
言語English
  • C#
  • JS

スクリプト言語

好きな言語を選択してください。選択した言語でスクリプトコードが表示されます。

Undo.RegisterCompleteObjectUndo

フィードバック

ありがとうございます

この度はドキュメントの品質向上のためにご意見・ご要望をお寄せいただき、誠にありがとうございます。頂いた内容をドキュメントチームで確認し、必要に応じて修正を致します。

閉じる

送信に失敗しました

なんらかのエラーが発生したため送信が出来ませんでした。しばらく経ってから<a>もう一度送信</a>してください。ドキュメントの品質向上のために時間を割いて頂き誠にありがとうございます。

閉じる

キャンセル

マニュアルに切り替える
public static function RegisterCompleteObjectUndo(objectToUndo: Object, name: string): void;
public static void RegisterCompleteObjectUndo(Object objectToUndo, string name);

パラメーター

objectToUndo Undo される必要のある状態が変わっているオブジェクトの配列
name Undo 名

説明

Undo スタック上のオブジェクトの状態の複製を保存します。

If the undo is performed, any changes made to the object after this function is called will be undone, and the object will be restored to the recorded state.

Transform parent change, AddComponent, and object destruction can not be restored with this function, for that you should use the dedicated functions. See Undo.SetTransformParent, Undo.AddComponent, Undo.DestroyObjectImmediate.

If the object is part of the current scene (e.g. a game object in the Hierarchy or a component attached to such game object), calling this function will immediately mark the scene as modified, even if you don't actually change the states of the object afterwards.


        
using UnityEngine;
using UnityEditor;

public class UndoExamples { [MenuItem("Undo Examples/RegisterCompleteObjectUndo")] static void Example () { GameObject player = new GameObject("Player");

// Store the states of the player object. Undo.RegisterCompleteObjectUndo(player, "Player name change");

player.name = "New Player";

// If you choose "Edit->Undo Player name change" from the main menu now, the name of the object will be restored to "Player". } }

public static function RegisterCompleteObjectUndo(objectsToUndo: Object[], name: string): void;
public static void RegisterCompleteObjectUndo(Object[] objectsToUndo, string name);

パラメーター

objectsToUndo Undo される必要のある状態が変わっているオブジェクトの配列
name Undo 名

説明

これは最初のオーバーロードを複数回呼び出すのと同義で、Undo 操作が1つだけこの関数のために生成されるという事実を省きます。