public void UpdateColliderTransition(Classic_Container cs) { playAnimEvent.value = false; StopAllCoroutines(); fetchedCS = cs; updateScene.value = true; }
public void SetCHolder(RawImage ri, Classic_Container cs, GameObject cH) { // For Static and Animated BUT Non-Transition Animation. if (cs.containsTransitionScene == false) { cH.transform.localPosition = cs.CameraPosition; cH.transform.eulerAngles = cs.CameraRotation; } }
public override void UpdateClassicScene(Camera c, RawImage ri, Classic_Container cs, ScrollRect sr, Camera oc, GameObject cH) { if (cs.isAnimatedContainer == true) { playAnimationEvent.value = true; } else { playAnimationEvent.value = false; } }
// Implement an OnEnable Variable for the new Set Container System. IEnumerator PlayPrerenderedAnimation_Coroutine(Camera c, RawImage ri, Classic_Container cs, GameObject cH, float time) { //ri.rectTransform.sizeDelta = new Vector2(c.scaledPixelWidth, c.scaledPixelHeight); // This is Logic for a Static Animation : Good for backgrounds while (playAnimEvent.value == true && cs.containsTransitionScene == false) { for (int i = 0; i < cs.DepthTextureBoiSequence.Count; i++) { ri.material.SetTexture("_RenderedTex", cs.DepthTextureBoiSequence[i]); ri.material.SetTexture("_DepthTex", cs.DepthTextureBoiSequence[i]); //Debug.Log(i + "Count is <="); if (i == cs.RenderedTextureBoiSequence.Count - 1 && cs.isLoopableAnimation == false) { playAnimEvent.value = false; yield return(new WaitForSeconds(time)); } yield return(new WaitForSeconds(time)); } } // This is Logic for a Transition Animation while (playAnimEvent.value == true && cs.containsTransitionScene == true) { // This is Logic for a Transition Animation : Good for dynamic cutscenes for (int i = 0; i < cs.RenderedTextureBoiSequence.Count; i++) { c.fieldOfView = cs.FOVValueForTransitionSequence[i]; c.nearClipPlane = cs.NearClipForTransitionSequence[i]; c.farClipPlane = cs.FarClipForTransitionSequence[i]; ri.material.SetFloat("_Near", cs.NearClipForTransitionSequence[i]); ri.material.SetFloat("_Far", cs.FarClipForTransitionSequence[i]); ri.material.SetTexture("_RenderedTex", cs.RenderedTextureBoiSequence[i]); ri.material.SetTexture("_DepthTex", cs.DepthTextureBoiSequence[i]); cH.transform.localPosition = cs.cameraPositionsForTransitionSequence[i]; cH.transform.eulerAngles = cs.cameraRotationsForTransitionSequence[i]; if (i == cs.RenderedTextureBoiSequence.Count - 1 && cs.isLoopableAnimation == false) { playAnimEvent.value = false; yield return(new WaitForSeconds(time)); } yield return(new WaitForSeconds(time)); } } //yield return new WaitForFixedUpdate(); }
public void SetC(Camera c, RawImage ri, Classic_Container cs) { // For All. c.transform.localPosition = new Vector3(0, 0, 0); c.transform.localEulerAngles = new Vector3(0, 0, 0); c.orthographic = false; // For Static and Animated BUT Non-Transition Animation. if (cs.containsTransitionScene == false) { c.nearClipPlane = cs.FloatForNearClip; c.farClipPlane = cs.FloatForFarClip; c.fieldOfView = cs.FOVValue; } }
// Update is called once per frame void Update() { rawImageProjection.material.SetMatrix("_Perspective", perspectiveCamera.projectionMatrix); /* * // Temporary solution * if (switchScene.value == true) * { * //SceneManager.LoadScene(sceneStringClassical); * updateScene.value = true; * switchScene.value = false; * }*/ if (updateScene.value == true) { fetchedCS = privateCSVariable.value; StopAllCoroutines(); //StopCoroutine(PlayPrerenderedAnimation_Coroutine); for (int i = classicPrerenderActions.Count - 1; i >= 0; i--) { classicPrerenderActions[i].UpdateClassicScene(perspectiveCamera, rawImageProjection, fetchedCS, scrollR, orthographicCamera, cameraHolder); if (playAnimEvent.value == true) { //StopAllCoroutines(); StartCoroutine(PlayPrerenderedAnimation_Coroutine(perspectiveCamera, rawImageProjection, fetchedCS, cameraHolder, fetchedCS.floatForCoroutineAnimation)); Debug.Log("Initializing Coroutine for Animated Container"); updateScene.value = false; } else { updateScene.value = false; } } } for (int i = classicActions.Count - 1; i >= 0; i--) { classicActions[i].ExecuteClassic(perspectiveCamera, rawImageProjection, fetchedCS, cameraHolder); } }
public void SetRI(Camera c, RawImage ri, Classic_Container cs, ScrollRect sr) { // For All. ri.rectTransform.sizeDelta = new Vector2(c.scaledPixelWidth, c.scaledPixelHeight); // For Static Image. if (cs.isAnimatedContainer == false) { ri.material.SetFloat("_Near", cs.FloatForNearClip); ri.material.SetFloat("_Far", cs.FloatForFarClip); ri.material.SetTexture("_RenderedTex", cs.RenderedTextureBoi); ri.material.SetTexture("_DepthTex", cs.DepthTextureBoi); } // For Animated and Non-Transition Animation. if (cs.isAnimatedContainer == true && cs.containsTransitionScene == false) { ri.material.SetFloat("_Near", cs.FloatForNearClip); ri.material.SetFloat("_Far", cs.FloatForFarClip); } sr.viewport.sizeDelta = new Vector2(Screen.width, Screen.height); }
public abstract void ExecuteClassic(Camera c, RawImage ri, Classic_Container cs, GameObject cH);
public override void ExecuteClassic(Camera c, RawImage ri, Classic_Container cs, GameObject cH) { }
public abstract void UpdateClassicScene(Camera c, RawImage ri, Classic_Container cs, ScrollRect sr, Camera oc, GameObject cH);
public override void UpdateClassicScene(Camera c, RawImage ri, Classic_Container cs, ScrollRect sr, Camera oc, GameObject cH) { SetRI(c, ri, cs, sr); SetC(c, ri, cs); SetCHolder(ri, cs, cH); }