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); } } }
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(); } } }
public void OnTransitionEnd(TransitionableLevelFXType old, TransitionableLevelFXType current) { old.MainDirectionalLight.gameObject.SetActive(false); old.MainDirectionalLight.enabled = false; current.MainDirectionalLight.intensity = 1f; old.MainDirectionalLight.intensity = 0f; }
public void OnNewChunkLevel(TransitionableLevelFXType old, TransitionableLevelFXType current) { old.PostProcessVolume.gameObject.SetActive(true); if (current != null) { current.PostProcessVolume.gameObject.SetActive(true); } }
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); } }
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; } }
public LevelChunkTransitionFXSystem(LevelChunkInteractiveObject associatedPostProcessVolume) { this.TransitionableLevelFXType = associatedPostProcessVolume.InteractiveGameObject.InteractiveGameObjectParent.GetComponentInChildren <TransitionableLevelFXType>(); this.TransitionableLevelFXType.Init(); }
public bool IsNextDifferent(TransitionableLevelFXType current, TransitionableLevelFXType next) { return((current.MainDirectionalLight.intensity != next.MainDirectionalLight.intensity) || (current.MainDirectionalLight.color != next.MainDirectionalLight.color)); }
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); }
public void OnTimeElapsingReverse(TransitionableLevelFXType old, TransitionableLevelFXType current) { this.oldLightIntensity = old.MainDirectionalLight.intensity; this.currentLightIntensity = current.MainDirectionalLight.intensity; }
public bool IsNextDifferent(TransitionableLevelFXType current, TransitionableLevelFXType next) { return(current.PostProcessVolume.sharedProfile.name != next.PostProcessVolume.sharedProfile.name); }
public void OnTransitionEnd(TransitionableLevelFXType old, TransitionableLevelFXType current) { old.PostProcessVolume.gameObject.SetActive(false); current.PostProcessVolume.weight = 1f; old.PostProcessVolume.weight = 0f; }
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); }
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; }
public bool IsNextDifferent(TransitionableLevelFXType current, TransitionableLevelFXType next) { return(this.associatedAnimationManager.IsNextDifferent(current, next)); }