示例#1
0
 public void OnChunkLevelEnter(LevelChunkInteractiveObject nextLevelChunkInteractiveObject)
 {
     if (old == null)
     {
         this.old = nextLevelChunkInteractiveObject.GetTransitionableLevelFXType();
         Debug.Log(MyLog.Format("SAME"));
         this.OnNewChunkLevel(this.old, this.current, forceInstantTransition: true);
     }
     else if (current == null)
     {
         if (this.old != nextLevelChunkInteractiveObject.GetTransitionableLevelFXType())
         {
             this.current = nextLevelChunkInteractiveObject.GetTransitionableLevelFXType();
             this.OnNewChunkLevel(this.old, this.current);
         }
     }
     else
     {
         if (this.current != nextLevelChunkInteractiveObject.GetTransitionableLevelFXType())
         {
             this.old     = this.current;
             this.current = nextLevelChunkInteractiveObject.GetTransitionableLevelFXType();
             this.OnNewChunkLevel(this.old, this.current);
         }
     }
 }
示例#2
0
        public void OnNewChunkLevel(TransitionableLevelFXType old, TransitionableLevelFXType current, ChunkFXTransitionType TransitionType)
        {
            this.old     = old;
            this.current = current;

            this.associatedAnimationManager.OnNewChunkLevel(old, current);

            if (current == null)
            {
                this.isTransitioning = false;
            }
            else
            {
                if (TransitionType == ChunkFXTransitionType.SMOOTH)
                {
                    if (this.isTransitioning)
                    {
                        this.OnTimeElapsingReverse();
                    }
                    else
                    {
                        this.isTransitioning = true;
                        this.ResetState();
                    }
                }
                else
                {
                    this.OnTransitionEnd();
                }
            }
        }
示例#3
0
        public void OnTransitionEnd(TransitionableLevelFXType old, TransitionableLevelFXType current)
        {
            old.MainDirectionalLight.gameObject.SetActive(false);
            old.MainDirectionalLight.enabled = false;

            current.MainDirectionalLight.intensity = 1f;
            old.MainDirectionalLight.intensity     = 0f;
        }
示例#4
0
 public void OnNewChunkLevel(TransitionableLevelFXType old, TransitionableLevelFXType current)
 {
     old.PostProcessVolume.gameObject.SetActive(true);
     if (current != null)
     {
         current.PostProcessVolume.gameObject.SetActive(true);
     }
 }
示例#5
0
 private void OnNewChunkLevel(TransitionableLevelFXType old, TransitionableLevelFXType current, bool forceInstantTransition = false)
 {
     foreach (var AnimationManager in this.AnimationManagers)
     {
         bool isSmooth = !forceInstantTransition && AnimationManager.IsNextDifferent(old, current);
         AnimationManager.OnNewChunkLevel(old, current, isSmooth ? ChunkFXTransitionType.SMOOTH : ChunkFXTransitionType.INSTANT);
     }
 }
示例#6
0
        public void OnNewChunkLevel(TransitionableLevelFXType old, TransitionableLevelFXType current)
        {
            old.MainDirectionalLight.gameObject.SetActive(true);
            old.MainDirectionalLight.enabled = true;

            if (current != null)
            {
                current.MainDirectionalLight.gameObject.SetActive(true);
                current.MainDirectionalLight.enabled = true;
            }
        }
示例#7
0
 public LevelChunkTransitionFXSystem(LevelChunkInteractiveObject associatedPostProcessVolume)
 {
     this.TransitionableLevelFXType = associatedPostProcessVolume.InteractiveGameObject.InteractiveGameObjectParent.GetComponentInChildren <TransitionableLevelFXType>();
     this.TransitionableLevelFXType.Init();
 }
示例#8
0
 public bool IsNextDifferent(TransitionableLevelFXType current, TransitionableLevelFXType next)
 {
     return((current.MainDirectionalLight.intensity != next.MainDirectionalLight.intensity) ||
            (current.MainDirectionalLight.color != next.MainDirectionalLight.color));
 }
示例#9
0
 public void UpdateAnimatedData(float completionPercent, TransitionableLevelFXType old, TransitionableLevelFXType current)
 {
     old.MainDirectionalLight.intensity     = Mathf.SmoothStep(this.oldLightIntensity, 0, completionPercent);
     current.MainDirectionalLight.intensity = Mathf.SmoothStep(this.currentLightIntensity, 1, completionPercent);
 }
示例#10
0
 public void OnTimeElapsingReverse(TransitionableLevelFXType old, TransitionableLevelFXType current)
 {
     this.oldLightIntensity     = old.MainDirectionalLight.intensity;
     this.currentLightIntensity = current.MainDirectionalLight.intensity;
 }
示例#11
0
 public bool IsNextDifferent(TransitionableLevelFXType current, TransitionableLevelFXType next)
 {
     return(current.PostProcessVolume.sharedProfile.name != next.PostProcessVolume.sharedProfile.name);
 }
示例#12
0
 public void OnTransitionEnd(TransitionableLevelFXType old, TransitionableLevelFXType current)
 {
     old.PostProcessVolume.gameObject.SetActive(false);
     current.PostProcessVolume.weight = 1f;
     old.PostProcessVolume.weight     = 0f;
 }
示例#13
0
 public void UpdateAnimatedData(float completionPercent, TransitionableLevelFXType old, TransitionableLevelFXType current)
 {
     //the completionPercent - 0.3f is for delaying the old postprecessing transition -> causing artifacts
     old.PostProcessVolume.weight     = Mathf.SmoothStep(this.oldPostProcessingStartingWeight, 0, completionPercent - 0.3f);
     current.PostProcessVolume.weight = Mathf.SmoothStep(this.currentPostProcessingStartingWeight, 1, completionPercent);
 }
示例#14
0
 public void OnTimeElapsingReverse(TransitionableLevelFXType old, TransitionableLevelFXType current)
 {
     //we reverse PP weight to have continuity in weight
     this.oldPostProcessingStartingWeight     = old.PostProcessVolume.weight;
     this.currentPostProcessingStartingWeight = current.PostProcessVolume.weight;
 }
示例#15
0
 public bool IsNextDifferent(TransitionableLevelFXType current, TransitionableLevelFXType next)
 {
     return(this.associatedAnimationManager.IsNextDifferent(current, next));
 }