public void Init() { _gcSpeechRecognition = GCVision.Instance; _networking = new Networking(); _networking.NetworkResponseEvent += NetworkResponseEventHandler; }
private void OnDestroy() { if (_Instance == this) { _visionManager.AnnotateSuccessEvent -= AnnotateSuccessEventHandler; _visionManager.AnnotateFailedEvent -= AnnotateFailedEventHandler; _Instance = null; ServiceLocator.Instance.Dispose(); } }
private void Awake() { if (_Instance != null) { Destroy(gameObject); return; } if (isDontDestroyOnLoad) { DontDestroyOnLoad(gameObject); } _Instance = this; _serviceLocator = new ServiceLocator(); _serviceLocator.InitServices(); _visionManager = _serviceLocator.Get <IVisionManager>(); _visionManager.AnnotateSuccessEvent += AnnotateSuccessEventHandler; _visionManager.AnnotateFailedEvent += AnnotateFailedEventHandler; }