public override void Enter(SceneTransitionControl entity) { base.Enter(entity); m_Entity = entity; m_Handle = AddressableResMgr.S.LoadAssetAsync <GameObject>("AnimTransition", LoadAnimGo); //m_Overlay.GetComponent<RectTransform>().sizeDelta = new Vector2(Screen.width, Screen.height); }
public override void Enter(SceneTransitionControl entity) { var root = entity.transition.transform.GetChild(0); var image = root.GetComponent <Image>(); entity.transition.StartCoroutine(FadeAnimOut(image, entity)); }
public void StartTransition() { SceneTransitionControl control = new SceneTransitionControl(); control.Init(); control.transition = Transition.StartTransition(); control.SetState(SceneTransitionControl.SceneTransitionFSMStateID.Show); }
public override void Enter(SceneTransitionControl entity) { AddressableResMgr.S.LoadSceneAsync("AddressDemo", (result) => { if (result.Scene != null) { entity.SetState(SceneTransitionControl.SceneTransitionFSMStateID.Hide); } }); }
public override void Enter(SceneTransitionControl entity) { m_Entity = entity; Debug.LogError(entity.transition.transform); var root = entity.transition.transform.GetChild(0); Debug.LogError(root.name); var anim = root.GetComponent <Animator>(); //AddressableResMgr.S.ReleaseRes anim.Play("Hide"); entity.transition.StartCoroutine(WaitAnimOver(anim)); }
private IEnumerator FadeAnimOut(Image image, SceneTransitionControl entity) { float time = 0.0f; while (time < m_FadeTime) { time += Time.deltaTime; image.canvasRenderer.SetAlpha(Mathf.InverseLerp(1, 0, time / m_FadeTime)); yield return(new WaitForEndOfFrame()); } image.canvasRenderer.SetAlpha(1); yield return(new WaitForEndOfFrame()); entity.SetState(SceneTransitionControl.SceneTransitionFSMStateID.Clean); }
//protected GameObject m_Overlay; public override void Enter(SceneTransitionControl entity) { GameObject m_Overlay = new GameObject("EffectGo"); m_Overlay.transform.SetParent(entity.transition.transform, false); var bgTex = new Texture2D(1, 1); bgTex.SetPixel(0, 0, m_StartColor); bgTex.Apply(); var image = m_Overlay.AddComponent <Image>(); var rect = new Rect(0, 0, bgTex.width, bgTex.height); var sprite = Sprite.Create(bgTex, rect, new Vector2(0.5f, 0.5f), 1); image.sprite = sprite; image.canvasRenderer.SetAlpha(0); m_Overlay.GetComponent <RectTransform>().sizeDelta = new Vector2(Screen.width, Screen.height); entity.transition.StartCoroutine(FadeAnimIn(image, entity)); }
public override void Enter(SceneTransitionControl entity) { entity.transition.EndTransition(); }
public override void Enter(SceneTransitionControl entity) { }
public override void Exit(SceneTransitionControl entity) { //TODO 资源未卸载干净 //AddressableResMgr.S.ReleaseRes(m_Handle); }