(client) feat:添加消息定义,添加故事定义及其运算,武器动画可用,装备UI可用以及切换武器 fix:修复快速攻击导致协程释放出错卡死,重构为计时器,修复类型转换错误导致报错
This commit is contained in:
@ -22,7 +22,7 @@ namespace Prefab
|
||||
|
||||
private void Start()
|
||||
{
|
||||
_originalPosition = transform.position; // 初始位置只需在组件生命周期中获取一次
|
||||
_originalPosition = transform.localPosition; // 初始位置只需在组件生命周期中获取一次
|
||||
}
|
||||
|
||||
private void OnEnable()
|
||||
@ -51,7 +51,7 @@ namespace Prefab
|
||||
var yOffset = GetYPosition?.Invoke(currentAnimationTime) ?? 0f;
|
||||
|
||||
// 应用偏移量到物体位置,保持原始Z轴不变
|
||||
transform.position = _originalPosition + new Vector3(xOffset, yOffset, 0);
|
||||
transform.localPosition = _originalPosition + new Vector3(xOffset, yOffset, 0);
|
||||
|
||||
// 如果达到销毁条件,在完成最后一帧动画更新后销毁物体
|
||||
if (shouldDestroy)
|
||||
|
@ -6,7 +6,8 @@ namespace Prefab
|
||||
public class TemporaryAnimatorImageUI:TemporaryAnimator
|
||||
{
|
||||
public UIImageAnimator imageAnimator;
|
||||
|
||||
public RectTransform rectTransform;
|
||||
|
||||
public void Init(Sprite[] sprite,float fps=3)
|
||||
{
|
||||
if (imageAnimator == null)
|
||||
|
@ -10,11 +10,12 @@ namespace Prefab
|
||||
|
||||
public void Init(Sprite[] textures,float fps=3)
|
||||
{
|
||||
if(spriteAnimator == null)
|
||||
if(!spriteAnimator)
|
||||
spriteAnimator = GetComponentInChildren<SpriteAnimator>();
|
||||
if (!spriteAnimator) return;
|
||||
spriteAnimator.SetSprites(textures);
|
||||
spriteAnimator.SetFPS(fps);
|
||||
spriteAnimator.gameObject.SetActive(true);
|
||||
}
|
||||
}
|
||||
}
|
@ -17,6 +17,8 @@ namespace Prefab
|
||||
/// </summary>
|
||||
[SerializeField] public TMP_Text text;
|
||||
|
||||
public RectTransform rectTransform;
|
||||
|
||||
/// <summary>
|
||||
/// 当前播放的动画帧索引。
|
||||
/// </summary>
|
||||
|
Reference in New Issue
Block a user