unity-android-native icon indicating copy to clipboard operation
unity-android-native copied to clipboard

Caching fields on C# side

Open Suvitruf opened this issue 7 years ago • 0 comments

Do we need to cache fields on C# side?

Caching ref fields like PackageInfo https://github.com/Suvitruf/unity-android-native/blob/master/Assets/UnityAndroidNative/Android/Content/Pm/PackageManager.cs#L11 in PackageManager is not the bad idea, 'cause this ref will not be changed.

But what's about primitive types, like mAction field of Intent? It would be a nice to reduce jni calls. But if something changes this field in native object, it will not be automatically changed on C# side.

Suvitruf avatar Jul 22 '18 15:07 Suvitruf