Example #1
0
        //クロスフェード用のイメージを作成
        protected bool TryCreateCrossFadeImage(float time, AdvGraphicInfo graphic)
        {
            if (LastResource == null)
            {
                return(false);
            }

            if (EnableCrossFade(graphic))
            {
                ReleaseCrossFadeReference();
                crossFadeReference = this.gameObject.AddComponent <AssetFileReference>();
                crossFadeReference.Init(LastResource.File);
                UguiCrossFadeDicing crossFade = this.gameObject.GetComponentCreateIfMissing <UguiCrossFadeDicing>();
                crossFade.CrossFade(
                    Dicing.PatternData,
                    Dicing.mainTexture,
                    time,
                    () =>
                {
                    Destroy(crossFade);
                }
                    );
                return(true);
            }
            else
            {
                return(false);
            }
        }
Example #2
0
        //クロスフェード用のイメージを作成
        protected virtual bool TryCreateCrossFadeImage(float time, AdvGraphicInfo graphic)
        {
            if (LastResource == null)
            {
                return(false);
            }

            if (EnableCrossFade(graphic))
            {
                ReleaseCrossFadeReference();
                crossFadeReference = this.gameObject.AddComponent <AssetFileReference>();
                crossFadeReference.Init(LastResource.File);
                crossFade = this.gameObject.AddComponent <UguiCrossFadeDicing>();
                crossFade.Timer.Unscaled = Engine.Time.Unscaled;
                crossFade.CrossFade(
                    Dicing.PatternData,
                    Dicing.mainTexture,
                    time,
                    () =>
                {
                    ReleaseCrossFadeReference();
                }
                    );
                return(true);
            }
            else
            {
                return(false);
            }
        }
Example #3
0
 protected virtual void ReleaseCrossFadeReference()
 {
     if (crossFadeReference != null)
     {
         crossFadeReference.RemoveComponentMySelf();
         crossFadeReference = null;
     }
     if (crossFade != null)
     {
         crossFade.RemoveComponentMySelf();
         crossFade = null;
     }
 }