我有一個包含此代碼的 MonoBehaviour; private void OnTriggerEnter(Collider other) { Debug.Log(other.name); }當我編譯此代碼時,我收到此錯誤:Script error: OnTriggerEnterThis message parameter has to be of type: ColliderThe message will be ignored.即使 MonoBehaviour 沒有在任何地方使用,情況也是如此。(通過代碼添加)添加它的代碼: private void SpawnItem(Vector3Int pos) { new GameObject().AddComponent<ItemGameobject>().Initialize(pos, new Item(GetBlockTypeAt(pos), 1)); }
- 1 回答
- 0 關注
- 250 瀏覽
添加回答
舉報
0/150
提交
取消