📜  unity mousetoterrainposition - C# 代码示例

📅  最后修改于: 2022-03-11 14:48:54.786000             🧑  作者: Mango

代码示例1
public static Vector3 MouseToTerrainPosition()
    {
        Vector3 position = Vector3.zero;
        if (Physics.Raycast(Camera.main.ScreenPointToRay(Input.mousePosition), out RaycastHit info, 100, LayerMask.GetMask("Level")))
            position = info.point;
        return position;
    }