Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @HideInInspector()
- var root : Clickable;
- function Start() {
- if (root == this)
- {
- SpreadToChildren();
- }
- }
- function SpreadToChildren()
- {
- for (Collider c in GetComponentsInChildren(Collider))
- {
- if (c.GetComponent(Clickable) == null)
- {
- c.gameObject.AddComponent(Clickable);
- c.root = this;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment