Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #region Reference Support
- private static MyController myController;
- // Reference Support:MyController
- // MyController can be cached on start as private MyController myController;
- // & in Start() myController = MyController.Instance();
- public static MyController Instance () {
- if (!myController) {
- myController = FindObjectOfType(typeof (MyController)) as MyController;
- if (!myController)
- Debug.LogError ("There needs to be one active MyController script on a GameObject in your scene.");
- }
- return myController;
- }
- #endregion
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement