Handles.color 颜色

static var color : Color

Description描述

Colors of the handles

控制柄的颜色。

Handles.color 颜色

Magenta slider that points to 0,0,0.
洋红滑动柄指向0,0,0。

// Simple script that creates a Magenta Slide Handle that
// points to (0,0,0) nomatter where the target GameObject is located.
//创建一个洋红滑动控制柄指向(0,0,0),target物体的位置。
@CustomEditor (Slide)
class SliderHandleJS extends Editor {
	function OnSceneGUI () {
		Handles.color = Color.magenta;
		target.vectorPoint = Handles.Slider (target.vectorPoint,
		Vector3.zero - target.transform.position);
		if (GUI.changed)
			EditorUtility.SetDirty (target);
	}
}

And the script attached to this Handle:

该脚本附加到这个控制柄物体:

// Usage: Place this script on the Game Object you want to use the
// editor-created slide handle.
//放置这个脚本到游戏物体

@script ExecuteInEditMode()

var vectorPoint : Vector3 = Vector3(0,0,0);

function Update() {
	Debug.Log("Looking at: " + vectorPoint);
}
Page last updated: 2011-7-7