void ParseJSON(string rawJSON) { StringReader sr = new StringReader(rawJSON); var reader = new JsonTextReader(sr); // assume raw JSON is a single figure //Debug.Log("Deserializing figure"); MFigure fig = serializer.Deserialize <MFigure>(reader); fig.init(); //Debug.LogFormat("Deserialized to: {0}", fig); }
public MFigure GetMemento() { var figure = new MFigure(); figure.x = Location.X; figure.y = Location.Y; figure.w = Width; figure.h = Height; figure.xData.color = _color; figure.xData.lineWidth = _lineWidth; figure.xData.type = _type; return(figure); }