🔒 Closed Unity C# Json Deserialization problem

Status
Not open for further replies.

H20_Waterr

Honorary Poster
My Custom Class
C#:
[Serializable]
public class settings
{
    public int ST_PLYR_ID { get; set; }
    public float ST_DISPLAY_BRIGHTNESS { get; set; }
    public float ST_SOUND_VOLUME { get; set; }
    public float ST_MUSIC_VOLUME { get; set; }
}

Json String na gusto kong eDeserialize sa gawa kong custom class object
JSON:
{"ST_PLYR_ID":"10000","ST_SOUND_VOL":"1","ST_MUSIC_VOL":"1","ST_DISPLAY_BRIGHTNESS":"0.98"}

Code sa pag deserialize ko sa json string
C#:
settings st = JsonConvert.DeserializedObject<settings>(jsonString);

Ang problema po kase pag katapos ko pong e deserialize ang json string ang nagiging value po ng ST_SOUND_VOLUME at ST_MUSIC_VOLUME ay nagiging 0. Patuong naman po sa kung sinong may alam paano to.
 
Status
Not open for further replies.

Similar threads

About this Thread

  • 0
    Replies
  • 553
    Views
  • 1
    Participants
Last reply from:
H20_Waterr

Trending Topics

Online now

Members online
1,100
Guests online
3,806
Total visitors
4,906

Forum statistics

Threads
2,338,364
Posts
29,303,524
Members
1,124,247
Latest member
CvCv12345
Back
Top