Ejemplo n.º 1
0
    private void OnTriggerEnter(Collider other)
    {
        //Debug.Log(other.gameObject.name + " entered me");
        Highlightable hi = other.gameObject.GetComponent <Highlightable>();

        switch (OnEnter)
        {
        case DoWhatOn.AddListener:
            if (!HighlightController.Contains(hi))
            {
                OnPad += hi.ToggleHighlightMaterial;
                //Debug.Log("Adding callback");
            }
            break;

        case DoWhatOn.RemoveListener:
            OnPad -= hi.ToggleHighlightMaterial;
            break;

        case DoWhatOn.DoNothing:
            break;

        default:
            break;
        }
    }
Ejemplo n.º 2
0
 private void OnMouseUp()
 {
     //If I am subscribed and dropped,
     if (HighlightController.Contains(this))
     {
         // do something for everyone who is subscribed
         HighlightController.DoSomething();
     }
 }