internal void RemoveCameraNuisanceController(CameraNuisanceController cameraNuisanceController) { if (_cameraNuisanceControllers.Contains(cameraNuisanceController)) { _cameraNuisanceControllers.Remove(cameraNuisanceController); } }
internal void AddCameraNuisanceController(CameraNuisanceController cameraNuisanceController) { if (!_cameraNuisanceControllers.Contains(cameraNuisanceController)) { _cameraNuisanceControllers.Add(cameraNuisanceController); } }
internal virtual void Clean() { if (Cameras != null) { foreach (Camera cam in Cameras) { if (cam == null) { continue; } CameraNuisanceController cnc = cam.gameObject.GetComponent <CameraNuisanceController>(); if (cnc != null) { UnityEngine.Object.Destroy(cnc); } } } }
private void OnCameraRefreshDone() { foreach (Camera cam in Cameras) { if (cam.name.EndsWith(".cfg")) { continue; } CameraNuisanceController cnc = cam.gameObject.GetComponent <CameraNuisanceController>(); if (cnc == null) { Logger.log.Debug($"Adding {nameof(CameraNuisanceController)} onto camera \"{cam.name}\""); cnc = cam.gameObject.AddComponent <CameraNuisanceController>(); _container.Inject(cnc); } else { cnc.Refresh(); } } }