public static PacketSend Create(EEvents eventId) { var pk = new PacketSend(); //pk._arrByte64K.arrByte64K[0] = (byte)(15 >> 8); //pk._arrByte64K.arrByte64K[1] = (byte)(15);//第1、2位存储id pk._arrByte64K.arrByte64K[2] = (byte)((ushort)eventId >> 8); pk._arrByte64K.arrByte64K[3] = (byte)((ushort)eventId);//第3、4位存储id return(pk); }
public static void HandleEvent(ServerPacket serverPacket) { EEvents ee = (EEvents)serverPacket.eventId; ActionHandleEvent action; if (_dicActionHandleEvent.TryGetValue(ee, out action)) { action(serverPacket.arrByteReader); } else { Log("Event " + ee.ToString() + "不存在!"); } }
IEnumerator FallC() { isFalling = true; // so you can't swipe on top while (transform.position.y > maxAllowedDistanceToFall) //-5 is out of camera point { yield return(null); transform.position = Vector3.Lerp(transform.position, fallPositionTarget, Time.deltaTime); transform.rotation = Quaternion.Lerp(transform.rotation, Quaternion.Euler(0, 0, 180), 0.1f); } ResetTheCard(); EEvents.OnCardFallingNow(); // this is important to reset the swipe, voice, effects, points etc - DOES NOT KNOW THE CARD THOUGH // card data should be some other class }
protected override void OnNavigatedTo(NavigationEventArgs e) { EventEntry = e.Parameter as EEvents; EventEntry.InitializeViews( ViewGrid, AddGrid, ViewCommand, AddCommand, TitleInput, DateInput, TimeInput, LocationInput, DescriptionInput, AddButton); }
void BroadCastTouchDistance(float x) // TODO: NOT SURE IF THIS IS REALLY NEEDED JUST TAKES LONGER THIS WAY { EEvents.OnXChangeNow(x); }
private static void RegEvent(EEvents eventId, ActionHandleEvent actionHandle) { _dicActionHandleEvent.Add(eventId, actionHandle); }