Closed sekkit closed 5 years ago
PS: I wanna do: UnityEngine::Debug::Log("helloworld") instead of System::String msg = System::String("hellworld"); UnityEngine::Debug::Log(msg)
All basic types shall be automatically casted to Managed types.
I can't speak for the Python part, but I can talk about the C++ side. Passing C++ string literals to functions that take an Object
isn't currently possible because a string literal is const
and, since C# functions have no concept of const
, the parameter is not const
in C++. So the compiler rightly complains that a const
value is being passed as a non-const
parameter.
Successfully embedded Python to UnityNativeScripting, but when executing code below:
import UnityEngine
UnityEngine.Debug.Log('hello')
TypeError: Log(): incompatible function arguments. The following argument types are supported:
Invoked with: 'helloworld'
At: