Пример #1
0
        ///

        protected override void OnEnter()
        {
            previousShot      = track.currentShot;
            track.currentShot = this;

            lastFadeColor = DirectorGUI.fadeColor;
            DirectorGUI.UpdateFade(Color.clear);
        }
Пример #2
0
 //...
 void Awake()
 {
     if (_current != null && _current != this)
     {
         DestroyImmediate(this);
         return;
     }
     _current = this;
 }
Пример #3
0
        ///

        protected override void OnEnter()
        {
            targetShot.cam.cullingMask = DirectorCamera.renderCamera.cullingMask;
            previousShot      = track.currentShot;
            track.currentShot = this;

            lastFadeColor = DirectorGUI.fadeColor;
            DirectorGUI.UpdateFade(Color.clear);
        }
Пример #4
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);
                }
            }
        }
Пример #5
0
        protected override void OnEnter()
        {
            //we do this again OnEnter for in case the same shot is used by multiple clips
            TryUpdateShotTargetOverride();

            targetShot.cam.cullingMask = DirectorCamera.renderCamera.cullingMask;
            previousShot      = track.currentShot;
            track.currentShot = this;

            lastFadeColor = DirectorGUI.lastFadeColor;
            DirectorGUI.UpdateFade(Color.clear);
        }
Пример #6
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);
        }
Пример #7
0
 protected override void OnReverse()
 {
     DirectorGUI.UpdateFade(lastFadeColor);
     DirectorGUI.UpdateDissolve(null, 0);
     track.currentShot = previousShot;
 }