JSONObject.Clear C# (CSharp) Method

Clear() public method

public Clear ( ) : void
return void
	public void Clear()
	{
		type = Type.NULL;
		if (list != null)
			list.Clear();
		if (keys != null)
			keys.Clear();
		str = "";
		n = 0;
		b = false;
	}
	/// <summary>

Usage Example

Example #1
0
        public void EmitData(Transform transform, bool is_jump, bool move_left, bool is_clouch, float emit_time)
        {
            Vector3    position = transform.position;
            Quaternion rotate   = transform.rotation;
            Vector3    scale    = transform.localScale;

            jsonObject.Clear();
            jsonObject.AddField(POSITION_X, position.x);
            jsonObject.AddField(POSITION_Y, position.y);
            jsonObject.AddField(POSITION_Z, position.z);
            jsonObject.AddField(ROTATE_X, rotate.x);
            jsonObject.AddField(ROTATE_Y, rotate.y);
            jsonObject.AddField(ROTATE_Z, rotate.z);
            jsonObject.AddField(SCALE_X, scale.x);
            jsonObject.AddField(SCALE_Y, scale.y);
            jsonObject.AddField(SCALE_Z, scale.z);
            jsonObject.AddField(MOVE_DIR, move_left);
            jsonObject.AddField(IS_JUMP, is_jump);
            jsonObject.AddField(IS_CLOUCH, is_clouch);
            jsonObject.AddField(EMIT_TIME, emit_time);
            jsonObject.AddField(OWNER_ID, socket.sid);

            socket.Emit("CharactorUpdate", jsonObject);
            lock (emit_mutex)
            {
                emit_wait = false;
                Monitor.Pulse(emit_mutex);
            }
        }
All Usage Examples Of JSONObject::Clear