public void CreateEvent(Foot f, SimpleEventType eT) { point2D = new Point2D(transform.position, eT, f); if (point2D.eventType == SimpleEventType.takeOff) { footEventTypeImg.sprite = sprites.Find(x => x.name == "Despegue"); arrows[0].gameObject.SetActive(false); arrows[1].gameObject.SetActive(true); } else if (point2D.eventType == SimpleEventType.contact) { footEventTypeImg.sprite = sprites.Find(x => x.name == "ContactoInicial"); arrows[0].gameObject.SetActive(true); arrows[1].gameObject.SetActive(false); } if (point2D.foot == Foot.left) { arrows[0].color = leftColor; arrows[1].color = leftColor; } else { arrows[0].color = rightColor; arrows[1].color = rightColor; } }
public static void TriggerEvent(SimpleEventType eventType) { UnityEvent thisEvent = null; if (instance.eventDictionary.TryGetValue(eventType, out thisEvent)) { thisEvent.Invoke(); } }
public static void StopListening(SimpleEventType eventType, UnityAction listener) { if (eventManager == null) { return; } UnityEvent thisEvent = null; if (instance.eventDictionary.TryGetValue(eventType, out thisEvent)) { thisEvent.RemoveListener(listener); } }
public static void StartListening(SimpleEventType eventType, UnityAction listener) { UnityEvent thisEvent = null; if (instance.eventDictionary.TryGetValue(eventType, out thisEvent)) { thisEvent.AddListener(listener); } else { thisEvent = new UnityEvent(); thisEvent.AddListener(listener); instance.eventDictionary.Add(eventType, thisEvent); } }
public Point2D(Vector2 screenP, SimpleEventType eType, Foot f) { screenPoint = screenP; eventType = eType; foot = f; }