Example #1
0
 protected override void OnReverse()
 {
     if (activeCameraTrack == this)
     {
         activeCameraTrack = null;
         DirectorCamera.Disable();
     }
 }
Example #2
0
 protected override void OnReverseEnter()
 {
     if (activeCameraTrack == null)
     {
         activeCameraTrack = this;
         DirectorCamera.Enable();
     }
 }
Example #3
0
        protected override void OnUpdate(float time, float previousTime)
        {
            if (steadyCamEffect > 0 && time != previousTime)
            {
                DirectorCamera.ApplyNoise(steadyCamEffect, GetClipWeight(time, 1f));
            }


            if (blendInEffect == BlendInEffectType.FadeIn)
            {
                if (time <= blendIn)
                {
                    var color = Color.black;
                    color.a = Easing.Ease(EaseType.QuadraticInOut, 1, 0, GetClipWeight(time));
                    DirectorGUI.UpdateFade(color);
                }
                else if (time < length - blendOut)
                {
                    DirectorGUI.UpdateFade(Color.clear);
                }
            }

            if (blendOutEffect == BlendOutEffectType.FadeOut)
            {
                if (time >= length - blendOut)
                {
                    var color = Color.black;
                    color.a = Easing.Ease(EaseType.QuadraticInOut, 1, 0, GetClipWeight(time));
                    DirectorGUI.UpdateFade(color);
                }
                else if (time > blendIn)
                {
                    DirectorGUI.UpdateFade(Color.clear);
                }
            }

            if (blendInEffect == BlendInEffectType.CrossDissolve && previousShot != null && previousShot.targetShot != null)
            {
                if (time <= blendIn)
                {
                    var res = new Vector2(Screen.width, Screen.height);
                                        #if UNITY_EDITOR
                    res = EditorTools.GetGameViewSize();
                                        #endif

                    var dissolver = previousShot.targetShot.GetRenderTexture((int)res.x, (int)res.y);
                    var ease      = Easing.Ease(EaseType.QuadraticInOut, 0, 1, GetClipWeight(time));
                    DirectorGUI.UpdateDissolve(dissolver, ease);
                }
                else
                {
                    DirectorGUI.UpdateDissolve(null, 0);
                }
            }
        }
Example #4
0
        protected override void OnUpdate(float time, float previousTime)
        {
            if (activeCameraTrack != this)
            {
                return;
            }

            if (cineBoxFadeTime > 0)
            {
                //use cinebox time as blendInOut override parameter for GetTrackWeight.
                DirectorGUI.UpdateLetterbox(GetTrackWeight(time, cineBoxFadeTime));
            }

            if (exitCameraOverride != null)
            {
                if (time > blendIn && entryCamera == null)
                {
                    entryCamera = DirectorCamera.gameCamera;
                    DirectorCamera.gameCamera = exitCameraOverride.GetAddComponent <GameCamera>();;
                }

                if (time <= blendIn && entryCamera != null)
                {
                    DirectorCamera.gameCamera = entryCamera;
                    entryCamera = null;
                }
            }


            var weight = GetTrackWeight(time);

            IDirectableCamera source = null;
            IDirectableCamera target = null;

            if (currentShot != null && currentShot.targetShot != null)
            {
                target = currentShot.targetShot;
                if (currentShot.blendInEffect == CameraShot.BlendInEffectType.EaseIn)
                {
                    if (currentShot != firstShot && currentShot.RootTimeWithinRange())
                    {
                        source  = currentShot.previousShot.targetShot;
                        weight *= currentShot.GetClipWeight((time + this.startTime) - currentShot.startTime);
                    }
                }
            }

            //passing null source = game camera, null target = the director camera itself.
            DirectorCamera.Update(source, target, interpolation, weight, appliedSmoothing);
        }
Example #5
0
        void Awake()
        {
            if (_current != null && _current != this)
            {
                DestroyImmediate(this.gameObject);
                return;
            }

            _current = this;
            if (dontDestroyOnLoad)
            {
                DontDestroyOnLoad(this.gameObject);
            }
            Disable();
        }
Example #6
0
        protected override void OnEnter()
        {
            if (activeCameraTrack != null)
            {
                return;
            }

            activeCameraTrack = this;

            firstShot   = (CameraShot)actions.FirstOrDefault(s => s.startTime >= this.startTime);
            lastShot    = (CameraShot)actions.LastOrDefault(s => s.endTime <= this.endTime);
            currentShot = firstShot;

            if (exitCameraOverride != null)
            {
                exitCameraOverride.gameObject.SetActive(false);
            }

            DirectorCamera.Enable();
        }