title: Json Deserialize object error
body: <p>Ok, now I am running into a very weird error. I am trying to deserialize a GameEvent object which is like this:</p>
  
  <pre><code>public class GameEvent {
  
  public Location eventLocation = Location.NoLocation;
  public Location targetLocation = Location.NoLocation;
  public string eventTriggerName = ""; // Who (Piece or tactic) triggers this event
  public string targetTriggerName = ""; // Target name
  public int eventPlayerID = -1;
  public int targetPlayerID = -1;
  public string result = ""; // Piece, Tactic, Trap, Freeze, Move, Kill, Flag
  public int amount = 0;
  
  public GameEvent() { Debug.Log("Fuck"); }
  public static string ClassToJson(GameEvent gameEvent)
  {
      return JsonConvert.SerializeObject(gameEvent);
  }
  }
  </code></pre>
  
  <p>When I deserialize it by doing this, however, it is changed weirdly.</p>
  
  <pre><code>public static GameEvent JsonToClass(string json)
  {
      Debug.Log(json);
      GameEvent gameEvent = JsonConvert.DeserializeObject&lt;GameEvent&gt;(json);
      Debug.Log(ClassToJson(gameEvent));
      return JsonConvert.DeserializeObject&lt;GameEvent&gt;(json);
  }
  </code></pre>
  
  <p>As you can see from the picture below the eventLocation should be (7,2) but after deserialization it becomes (4,2). And the eventLocation is the only thing that's changed.</p>
  
  <pre><code>string json = "{\"eventLocation\": {\"x\": 7, \"y\": 2}, \"targetLocation\": {\"x\": 4, \"y\": 2} }";
  var x = GameEvent.JsonToClass(json);
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/w7m6G.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/w7m6G.jpg" alt="enter image description here"></a></p>
  
  <p>I have no clue why. This is my Location class</p>
  
  <pre><code>public class Location
  {
      public int x = -1;
      public int y = -1;
      public Location(){}
      public Location(int X, int Y)
      {
          x = X;
          y = Y;
      }
      public Location(Location location)
      {
          x = location.x;
          y = location.y;
      }
      public static bool operator !=(Location a, Location b)
      {
          UnityEngine.Debug.Log(a + " " + b);
          return a.x != b.x || a.y != b.y;
      }
      public static Location NoLocation = new Location(-1, -1);
  }
  </code></pre>
  
  <p>I didn't post all the functions of GameEvent and Location class but I posted all the variables they have.</p>
  
  <p>By the way I also met another weird problem with the Location. When I do <code>if(eventLocation != Location.NoLocation)</code>, the != operator that I override is actually not comparing eventLocation with Location.NoLocation but eventLocation(yeah itself). So the a and b will always be the same and != will always return me false. I also have no clue why.</p>
  
  <p>Thanks in advance!!!</p>