Ejemplo n.º 1
0
    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;
        }
    }
Ejemplo n.º 2
0
    public static void TriggerEvent(SimpleEventType eventType)
    {
        UnityEvent thisEvent = null;

        if (instance.eventDictionary.TryGetValue(eventType, out thisEvent))
        {
            thisEvent.Invoke();
        }
    }
Ejemplo n.º 3
0
    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);
        }
    }
Ejemplo n.º 4
0
    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);
        }
    }
Ejemplo n.º 5
0
 public Point2D(Vector2 screenP, SimpleEventType eType, Foot f)
 {
     screenPoint = screenP;
     eventType   = eType;
     foot        = f;
 }