Created
March 26, 2016 13:35
-
-
Save OlegJakushkin/bd3943b76d2b5aa960a6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using UnityEngine; | |
| using System.Collections; | |
| public class Informer : MonoBehaviour { | |
| // Use this for initialization | |
| void Start () { | |
| var parent = this.transform.parent; | |
| while (parent != null) { | |
| var controller = parent.GetComponent<Controller> (); | |
| if (controller != null) { | |
| controller.RegisterInformer (this); | |
| break; | |
| } | |
| parent = parent.transform.parent; | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment