Handles.DrawSolidArc()

作者:追风剑情 发布于:2015-5-10 18:27 分类:Unity3d

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

标签: Unity3d

Powered by emlog  蜀ICP备18021003号-1   sitemap

川公网安备 51019002001593号