Event GetEvent() { // check for network packets Net.Packet packet = Net.Instance.GetPacket(); if (packet != null) { return CreateEvent(0f, EventType.PACKET, 0, 0, packet.Buffer.LengthBytes, packet); } // create an empty event to return Event evt = new Event(); evt.evTime = Milliseconds(); return evt; }
Event CreateEvent(float time, EventType type, int value, int value2, int dataSize, object data) { Event evt = new Event(); if (time == 0f) time = Milliseconds(); evt.evTime = time; evt.evType = type; evt.evValue = value; evt.evValue2 = value2; evt.dataSize = dataSize; evt.data = data; return evt; }