InjectFix icon indicating copy to clipboard operation
InjectFix copied to clipboard

casting intger JToken always return 1

Open ammariqais opened this issue 2 years ago • 0 comments

I am using Newtonsoft.Json and when i patched the method and casting JToken object to integer its always return 1

code

[Patch] void ConvertToInt(){ JToken num = 500; Debug.Log((int)num) // always logging 1 }

without patch its working fine

so I fix this issue by parsing variable

like

JToken num = 500; Debug.Log(int.Parse(num.ToString())) // its print 500

I am using Newton.Json v13

ammariqais avatar Dec 15 '22 09:12 ammariqais