言語: 日本語
  • C#
  • JS
  • Boo

スクリプト言語

お好みのスクリプト言語を選択すると、サンプルコードがその言語で表示されます。

Undo

Namespace: UnityEditor

Description

特定のオブジェクトに対する変更点をUndoクラスによってもとに戻すことが出来ます。

UndoシステムはUndoスタック内の差分を保持しています。Undo操作はイベント(マウスダウンなど)をベースとして自動的に分割され追加されていきます。 Udno操作はプロパティやオブジェクトの状態ごとに保持されます。この方法はあらゆるシーンサイズにスケールされます。 重要なUndo操作の方法は以下の通りです。 1つのプロパティを修正:

        Undo.RecordObject (myGameObject.light, "Set Light Range");
myGameObject.light.range = 5;

コンポーネントを追加 :

Undo.AddComponent<RigidBody> (myGameObject);

新しくゲームオブジェクトを生成:

var go = new GameObject ();
Undo.RegisterCreatedObjectUndo (go, "Created go");

ゲームオブジェクトまたはコンポーネントを破棄:

        Undo.DestroyObjectImmediate (myGameObject);

Transformの親を変更:

        Undo.SetTransformParent (myGameObject.transform, newTransformParent);

Static Variables

willFlushUndoRecord Invoked before the Undo system performs a flush.

Static Functions

ClearUndo Removes aall Undo operation for the identifier object registered using Undo.RegisterCompleteObjectUndo from the undo stack.
CollapseUndoOperations 全てのUndo操作を1つのステップにまとめます。
DestroyObjectImmediate オブジェクトを破棄し、Undo操作によって復元できるように記録します。
FlushUndoRecordObjects Ensure objects recorded using RecordObject or ::ref:RecordObjects are registered as an undoable action. In most cases there is no reason to invoke FlushUndoRecordObjects since it's automatically done right after mouse-up and certain other events that conventionally marks the end of an action.
GetCurrentGroup Unityが自動的にUndo操作をグループ化したもので現在のグループインデックスを取得します
IncrementCurrentGroup Unityが自動的にUndo操作をグループ化したもので現在のグループインデックスを取得します
PerformRedo Redo操作を行います。
PerformUndo Redo操作を行います。
RecordObject RecordObjectが呼び出された後の変更点を記録します
RecordObjects 1回の呼び出しで複数のオブジェクトを記録します。これは複数回にわけてUndo.RecordObjectを呼び出した時と同じです。
RegisterCreatedObjectUndo 新しくオブジェクトを生成する時のUndo操作を登録します
RevertAllDownToGroup グループインデックスの全てのUndo操作が行われますがRedo操作は保持されません
RevertAllInCurrentGroup Undo操作は実行されますがRedo操作は行うことは出来ません
SetTransformParent 新しくTransformの親を設定しUndo操作を記録します