/// <summary> /// 设置并淡入立绘 /// </summary> /// <param name="depth">图像层数</param> /// <param name="sprite">图像名</param> /// <param name="time">淡入时间</param> public static Queue <ImageEffect> SetCharacterSprite(int depth, Sprite sprite, float time) { AnimationBuilder builder = new AnimationBuilder(); return(builder.BeginWith(EffectBuilder.SetSpriteByDepth(depth, sprite)) .Then(EffectBuilder.FadeInByDepth(depth, time)) .Get()); }
/// <summary> /// 改变原有立绘(淡出淡入) /// </summary> /// <param name="depth">图像层数</param> /// <param name="sprite">图像名</param> /// <param name="fadeout">原图淡出时间</param> /// <param name="fadein">淡入时间</param> public static Queue <ImageEffect> ChangeCharacterSprite(int depth, Sprite sprite, float fadeout, float fadein) { AnimationBuilder builder = new AnimationBuilder(); if (fadeout == 0) { builder.BeginWith(EffectBuilder.ChangeByDepth(depth, sprite)); } else { builder.BeginWith(EffectBuilder.FadeOutByDepth(depth, fadeout)) .Then(EffectBuilder.SetSpriteByDepth(depth, sprite)); } if (fadein != 0) { return(builder.Then(EffectBuilder.FadeInByDepth(depth, fadein)).Get()); } return(builder.Get()); }