Beispiel #1
0
 void OnCameraPreactivate(FSCamera camera)
 {
     foreach (FSCamera c in GetAvailableCameras())
     {
         if (c != camera && c.IsActivated)
         {
             c.Desactivate();
         }
     }
 }
Beispiel #2
0
        public override void UpdateCamera(FSCamera camera)
        {
            base.UpdateCamera(camera);

            if (camera != null)
            {
                GetComponent <Camera>().cullingMask   = 0;
                GetComponent <Camera>().clearFlags    = CameraClearFlags.Nothing;
                GetComponent <Camera>().renderingPath = RenderingPath.VertexLit;
            }
        }
Beispiel #3
0
        public FSCamera ActivateCamera(string id)
        {
            FSCamera camera = Manager.GetInstance <FSCamera>(id);

            if (camera != null)
            {
                camera.Activate();
            }

            return(camera);
        }
Beispiel #4
0
        void OnCameraActivated(FSCamera camera)
        {
            Active = camera;

            if (OutputsManager.Active != null)
            {
                OutputsManager.Active.UpdateCamera(camera);
            }

            if (CameraChanged != null)
            {
                CameraChanged(camera);
            }
        }
Beispiel #5
0
        void OnCameraDesactivated(FSCamera camera)
        {
            if (OutputsManager == null)
            {
                return;
            }

            if (Active == camera)
            {
                if (OutputsManager.Active != null)
                {
                    OutputsManager.Active.DetachFromCamera();
                }
                Active = null;
            }
        }
Beispiel #6
0
        public void Start()
        {
            List <FSCamera> cameras = GetAvailableCameras();

            for (int i = 0; i < cameras.Count; i++)
            {
                FSCamera c = cameras[i];

                c.OnPreactivate += OnCameraPreactivate;
                c.OnActivated   += OnCameraActivated;

                if (c.IsActivated)
                {
                    c.Desactivate();
                }

                if (i == 0)
                {
                    c.Activate();
                }

                c.OnDesactivated += OnCameraDesactivated;
            }
        }
Beispiel #7
0
 public virtual void UpdateCamera(FSCamera camera)
 {
 }
 public override void UpdateCamera(FSCamera camera)
 {
     base.UpdateCamera(camera);
 }