Unity3d 如何在doxygen中使用更直观的代码块?
我正在尝试将代码块用于Doxygen;然而,我使用的这个方法似乎并不直观,我想知道是否有更好的方法,包括内联代码Unity3d 如何在doxygen中使用更直观的代码块?,unity3d,doxygen,documentation-generation,Unity3d,Doxygen,Documentation Generation,我正在尝试将代码块用于Doxygen;然而,我使用的这个方法似乎并不直观,我想知道是否有更好的方法,包括内联代码 public class DropZone : MonoBehaviour { private void OnCollisionEnter(Collision collision)//! resets an object that collides with the dropzone. { ///\code //!collision.g
public class DropZone : MonoBehaviour
{
private void OnCollisionEnter(Collision collision)//! resets an object that collides with the dropzone.
{
///\code
//!collision.gameObject.GetComponent<StorePos>().ResetPos();
///\endcode
collision.gameObject.GetComponent<StorePos>().ResetPos();//! if anything drops bellow the counter it will reset the pos to initial
}
}
公共类DropZone:MonoBehavior
{
private void OnCollisionCenter(碰撞)/!重置与dropzone碰撞的对象。
{
///\代码
//!collision.gameObject.GetComponent().ResetPos();
///\端码
collision.gameObject.GetComponent().ResetPos();/!如果计数器下面有任何下降,它会将pos重置为初始状态
}
}
我将给出一个我想要的语法示例:
public class DropZone : MonoBehaviour
{
private void OnCollisionEnter(Collision collision)//! resets an object that collides with the dropzone.
{
///\code
collision.gameObject.GetComponent<StorePos>().ResetPos();//! if anything drops bellow the counter it will reset the pos to initial
///\endcode
}
}
公共类DropZone:MonoBehavior
{
private void OnCollisionCenter(碰撞)/!重置与dropzone碰撞的对象。
{
///\代码
collision.gameObject.GetComponent().ResetPos();/!如果计数器下面有任何下降,它会将pos重置为初始状态
///\端码
}
}
有很多可能,比如设置内联源代码或\snippet
命令或一组命令,比如\dontinclude
,\line`等@albert我明白了,所以我必须使用示例文件,语法是\snippet…您不需要示例文件(仅需设置示例路径,历史原因),但代码段指令和代码段命令可以来自同一个文件。通常:注释位于相应代码行的顶部..而不是后面it@derHugo幸运的是你写了“一般”,当您有一个变量列表时,这会破坏代码的可读性,最好将其放在变量后面。有许多可能的情况,如设置内联源
或\snippet
命令或一组命令,如\dontinclude
,\line`等@albert我明白了,我会这样做的要使用示例文件且语法为\snippet…您不需要示例文件(仅需设置示例路径,历史原因),但snippet指令和snippet命令可以来自同一个文件。通常:注释位于相应代码行的顶部..而不是后面it@derHugo幸运的是你写了“一般”,当您有一个变量列表时,这会破坏代码的可读性,最好将其放在变量后面。