示例#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();
                }
            }
        }