(client) feat:实现热重载,实现多维度,实现武器,实现掉落物,实现状态UI,实现攻击AI (#44)

Co-authored-by: zzdxxz <2079238449@qq.com>
Co-committed-by: zzdxxz <2079238449@qq.com>
This commit is contained in:
2025-08-27 19:56:49 +08:00
committed by TheRedApricot
parent d91210a6ff
commit 8456b6c162
132 changed files with 18568 additions and 2534 deletions

View File

@ -1,3 +1,4 @@
using System;
using Base;
using UnityEngine;
@ -64,7 +65,7 @@ namespace Prefab
// 更新帧计时器
_frameTimer += deltaTime;
float frameDuration = 1f / _fps;
var frameDuration = 1f / _fps;
// 检查帧切换条件
while (_frameTimer >= frameDuration)
@ -101,6 +102,13 @@ namespace Prefab
// 重置帧计时器,以确保从头开始播放
_frameTimer = 0f;
}
public void Restore()
{
_currentFrameIndex = 0;
_renderer.sprite = _sprites[_currentFrameIndex];
}
public void SetFPS(float newFPS) => _fps = Mathf.Max(0.1f, newFPS);
public void SetStaticSprite(Sprite sprite) => _staticSprite = sprite;
}