public static UITargetFollow GetInstance() { if (instance == null) { instance = new UITargetFollow(); } return(instance); }
void OnWillRenderObject() { if (rendering) { return; } if (Camera.current.name == "AimCamera") { Debug.Log("Rendering Object"); rendering = true; UITargetFollow.GetInstance().AddToTargets(transform.root.gameObject); } }
void Awake() { instance = this; }
void OnBecameInvisible() { rendering = false; UITargetFollow.GetInstance().RemoveTargets(transform.root.gameObject); }