protected void ApplyNewStates() { foreach (var newState in _newStates) { var existingNum = GetStateIndex(_touchStates, newState.id); if (existingNum >= 0) { _touchStates[existingNum] = newState; } else { _touchStates.Add(newState); _touchBegan.Dispatch(newState); } } if (_touchStates.Count == _newStates.Count) { return; } for (int i = _touchStates.Count - 1; i >= 0; i--) { var curState = _touchStates[i]; var existingNum = GetStateIndex(_newStates, curState.id); if (existingNum < 0) { _touchStates.RemoveAt(i); _touchEnded.Dispatch(curState); } } }
void Update() { isDrawPhase = false; if (FlashResources.isPlatformReloadingEnabled) { FlashResources.reloadPendingResources(); } if (_shaderDirty) { sceneBatch.shader = shader; debugBatch.shader = shader; _shaderDirty = false; } if (_resourceDirty) { UpdateContent(); _resourceDirty = false; } isDrawPhase = true; debugBatch.Begin(GetGlobalMatrix()); root.Draw(); drawEvent.Dispatch(); debugBatch.renderQueue = sceneBatch.renderQueue + 1; debugBatch.End(); isDrawPhase = false; }
public void OnGUI() { eventName = EditorGUILayout.TextField("Event Name", eventName); EditorGUILayout.BeginHorizontal(); GUILayout.Label("Event Type", GUILayout.Width(145)); eventTypeIndex = EditorGUILayout.Popup(eventTypeIndex, MyEventType.typeList.ToArray()); EditorGUILayout.EndHorizontal(); DrawValueProperty(typeIndex); if (GUILayout.Button("Send Event")) { var eventData = TypeUtils.ChangeType(value, MyPreferredType.Find(typeIndex)); string eventKey = MyEventType.typeList[eventTypeIndex]; string eventType = MyEventType.typeDict[eventKey]; if (string.Equals("Default", eventType)) { EventSender.SendGlobalEvent(eventName, eventData); } else { EventSender.Dispatch(eventType, eventName, eventData); } } }
void FixedUpdate() { isDrawPhase = false; if (Application.isPlaying) { input.DoUpdate(); touchController.DoUpdate(); updateEvent.Dispatch(); } }
private void HandleUpdate() { if (_enterFrameEvent != null) { _enterFrameEvent.Dispatch(this); } if (_animation != null && _animation.isActive) { _animation.DoStep(); } }