Exemplo n.º 1
0
        public void Unsubscribe(string topic)
        {
            AttachableReference aref = this.attachables[topic];

            this.attachables.Remove(topic);
            // TODO: destroy game object
            Destroy(aref.attachable);
            Destroy(aref.parent.GetComponent <PressableButton>());
            Destroy(aref.parent.GetComponent <BoxCollider>());
            Destroy(aref.parent.GetComponent <NearInteractionTouchable>());
        }
Exemplo n.º 2
0
 public void Hide(string topic)
 {
     if (this.attachables.ContainsKey(topic))
     {
         AttachableReference aref = this.attachables[topic];
         aref.parent.GetComponent <Renderer>().material = inactiveMaterial;
         aref.attachable.SetActive(false);
         aref.active = false;
         aref.attachable.GetComponent <Renderer>().enabled = false;
         this.attachables[topic] = aref;
     }
     else
     {
         Debug.LogWarning($"Topic {topic} not found");
     }
 }
Exemplo n.º 3
0
 public void Toggle(string topic)
 {
     if (this.attachables.ContainsKey(topic))
     {
         Debug.Log($"Toggling tooltip of topic {topic}");
         AttachableReference aref = this.attachables[topic];
         if (aref.active)
         {
             this.Hide(topic);
         }
         else
         {
             this.Show(topic);
         }
     }
     else
     {
         Debug.LogWarning($"Topic {topic} not found");
     }
 }
Exemplo n.º 4
0
        public void Follow(string topic)
        {
            if (this.attachables.ContainsKey(topic))
            {
                AttachableReference aref = this.attachables[topic];
                if (aref.following)
                {
                    aref.attachable.GetComponent <RadialView>().enabled = false;
                }
                else
                {
                    aref.attachable.GetComponent <RadialView>().enabled = true;
                }

                aref.following          = !aref.following;
                this.attachables[topic] = aref;
            }
            else
            {
                Debug.LogWarning($"Topic {topic} not found");
            }
        }