void FixedUpdate() { UnityEngine.Profiling.Profiler.BeginSample("Events"); for (int i = 0; i < RunsPerUpdate; i++) { BasicColorEvent.Raise(new ColorEventData(Color.red)); } UnityEngine.Profiling.Profiler.EndSample(); }
private void OnGUI() { GUI.Label(new Rect(180, 5, 200, 20), "Red"); GUI.Label(new Rect(180, 20, 200, 20), "Green"); GUI.Label(new Rect(180, 35, 200, 20), "Blue"); red = GUI.HorizontalSlider(new Rect(10, 10, 150, 8), red, 0f, 1f); green = GUI.HorizontalSlider(new Rect(10, 25, 150, 8), green, 0f, 1f); blue = GUI.HorizontalSlider(new Rect(10, 40, 150, 8), blue, 0f, 1f); if (GUI.Button(new Rect(10, 75, 100, 22), "Send")) { BasicColorEvent.Raise(new ColorEventData(new Color(red,green,blue,1f))); } }
private void OnDisable() { BasicColorEvent.RemoveListener(SetColor, Bone.Events.DefaultEventPriority.High); }
// Start is called before the first frame update void OnEnable() { BasicColorEvent.AddListener(SetColor, Bone.Events.DefaultEventPriority.High); }