Undo.PerformRedo 执行重做

static function PerformRedo () : void

Description描述

Perform an Redo operation.

执行一个重做操作。

This is similar to the user selecting Redo from the Edit menu.

这是类似于用户从编辑菜单选择重做(Redo...)。

参见:PerformUndo.

PerformRedo

Simple Scriptable Wizard that lets you perform an undo several times.
简单的脚本向导,让您执行撤消几次。

using UnityEngine;
using UnityEditor;

//Performs a Redo the number of times specified.
//执行指定的重做次数
public class PerformVariousRedo : ScriptableWizard {
	public int numberOfSteps = 5;


	[MenuItem ("Example/Perform Various Redo %#r")]
	static void ExecuteMenu() {
		ScriptableWizard.DisplayWizard(
		"Perform various Redo at the same time",
		typeof(PerformVariousUndo),
		"Redo!");
	}

	void OnWizardCreate() {
		int savedNumberOfSteps = numberOfSteps;
		for(int i = 0; i < savedNumberOfSteps; i++) {
			Undo.PerformRedo();
		}
	}
}
最后修改:2011年5月18日 Wednesday 15:37

本脚本参考基于Unity 3.4.1f5

英文部分版权属©Unity公司所有,中文部分© Unity圣典 版权所有,未经许可,严禁转载 。