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>()); }
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"); } }
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"); } }
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"); } }