예제 #1
0
 internal void RemoveCameraNuisanceController(CameraNuisanceController cameraNuisanceController)
 {
     if (_cameraNuisanceControllers.Contains(cameraNuisanceController))
     {
         _cameraNuisanceControllers.Remove(cameraNuisanceController);
     }
 }
예제 #2
0
 internal void AddCameraNuisanceController(CameraNuisanceController cameraNuisanceController)
 {
     if (!_cameraNuisanceControllers.Contains(cameraNuisanceController))
     {
         _cameraNuisanceControllers.Add(cameraNuisanceController);
     }
 }
예제 #3
0
 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);
             }
         }
     }
 }
예제 #4
0
        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();
                }
            }
        }