(client) feat:实现摄像机跟踪,柏林噪声改为单例,角色渲染树支持指定像素密度

chore:将UI的Tick进行了显示时显式添加并作为预制体
This commit is contained in:
m0_75251201
2025-08-05 14:54:30 +08:00
parent 3c9be3a30c
commit 6a222d82b2
29 changed files with 2217 additions and 3262 deletions

View File

@ -83,7 +83,24 @@ namespace Prefab
// 外部控制方法
public void SetPaused(bool paused) => _isPaused = paused;
public void SetSprites(Sprite[] newSprites) => _sprites = newSprites;
public void SetSprites(Sprite[] newSprites)
{
_sprites = newSprites;
// 如果有新的精灵数组,则立即显示第一帧
if (_sprites != null && _sprites.Length > 0)
{
_currentFrameIndex = 0; // 重置当前帧索引为第一帧
_renderer.sprite = _sprites[_currentFrameIndex]; // 立即显示第一帧
}
else
{
_renderer.sprite = null; // 如果没有精灵,则清空渲染器
}
// 重置帧计时器,以确保从头开始播放
_frameTimer = 0f;
}
public void SetFPS(float newFPS) => _fps = Mathf.Max(0.1f, newFPS);
public void SetStaticSprite(Sprite sprite) => _staticSprite = sprite;
}