How to new GameObject(constructor not correct)
sekkit opened this issue · comments
sekkit commented
new GameObject()
But no gameobject is created in scene.
Based on Blog articles, there is a GameObjectNew func can do that?
so the question is, how to create GameObject(or any other Plugin generated object) correctly?
Jackson Dunstan commented
You'll need to expose that constructor to C++ in order to use it. Here's how the JSON looks:
{
"Name": "UnityEngine.GameObject",
"Constructors": [
{
"ParamTypes": []
}
]
}
After generating the bindings, you can create the GameObject
in C++ like so:
GameObject go;
sekkit commented
Can't I just GameObject *go = new GameObject()?
why create it in stack? I noticed there is no pointer in your cpp plugin bindings