void OnDrawGizmosSelected()
{
Gizmos.color = new Color(0.0f, 1.0f, 1.0f, 1.0f);
Gizmos.DrawWireCube(gameObject.GetComponent<Renderer>().bounds.center, gameObject.GetComponent<Renderer>().bounds.size);
}
unity OnDrawGizmosSelected只在scene起作用,在game视图不起作用。下图是画出模型外框,青色
查了下官网说明,确实如此。。。
原文地址:http://blog.csdn.net/xu20082100226/article/details/50333201