鸟语天空
Handles.DrawSolidArc()
post by:追风剑情 2015-5-10 18:27

HandlesTest.cs一定要放在Editor目录下。


using UnityEngine;
using UnityEditor;
using System.Collections;

[CustomEditor(typeof(SolidArcExample))]
public class HandlesTest : Editor {

	private SolidArcExample mTarget;
	private float viewDistance = 10f;

	void OnSceneGUI () {

		SolidArcExample mTarget = (SolidArcExample)target;

		Handles.color = new Color(0f, 1f, 1f, 0.2f); //颜色
		Handles.DrawSolidArc (mTarget.transform.position, //中心点
		                      mTarget.transform.up, //法线
		                      -mTarget.transform.right, //起始位置
		                      180, //弧度
		                      viewDistance);//半径
		Handles.color = Color.white;
	}
}



using UnityEngine;
using System.Collections;

public class SolidArcExample : MonoBehaviour {

}





Handles.png

评论:
发表评论:
昵称

邮件地址 (选填)

个人主页 (选填)

内容