示例#1
0
 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);
 }
示例#2
0
            public override void Enter(SceneTransitionControl entity)
            {
                var root  = entity.transition.transform.GetChild(0);
                var image = root.GetComponent <Image>();

                entity.transition.StartCoroutine(FadeAnimOut(image, entity));
            }
示例#3
0
        public void StartTransition()
        {
            SceneTransitionControl control = new SceneTransitionControl();

            control.Init();
            control.transition = Transition.StartTransition();
            control.SetState(SceneTransitionControl.SceneTransitionFSMStateID.Show);
        }
示例#4
0
 public override void Enter(SceneTransitionControl entity)
 {
     AddressableResMgr.S.LoadSceneAsync("AddressDemo", (result) =>
     {
         if (result.Scene != null)
         {
             entity.SetState(SceneTransitionControl.SceneTransitionFSMStateID.Hide);
         }
     });
 }
示例#5
0
            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));
            }
示例#6
0
            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);
            }
示例#7
0
            //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));
            }
示例#8
0
 public override void Enter(SceneTransitionControl entity)
 {
     entity.transition.EndTransition();
 }
示例#9
0
 public override void Enter(SceneTransitionControl entity)
 {
 }
示例#10
0
 public override void Exit(SceneTransitionControl entity)
 {
     //TODO 资源未卸载干净
     //AddressableResMgr.S.ReleaseRes(m_Handle);
 }