📜  您正在尝试使用“新”关键字创建 MonoBehaviour. - C# 代码示例

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

代码示例1
DetectPlayer dp;

private void Awake()
{
    GameObject gameObject = new GameObject("DetectPlayer");
    dp = gameObject.AddComponent();
}