game-developer by jeffallan/claude-skills
npx skills add https://github.com/jeffallan/claude-skills --skill game-developer根据上下文加载详细指导:
| 主题 | 参考文档 | 加载时机 |
|---|---|---|
| Unity 开发 | references/unity-patterns.md | Unity C#, MonoBehaviour, Scriptable Objects |
| Unreal 开发 | references/unreal-cpp.md | Unreal C++, Blueprints, Actor components |
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
| ECS 与模式 | references/ecs-patterns.md | Entity Component System, 游戏模式 |
| 性能 | references/performance-optimization.md | FPS 优化, 性能分析, 内存 |
| 网络 | references/multiplayer-networking.md | 多人游戏, 客户端-服务器, 延迟补偿 |
实现游戏功能时,请提供:
public class ObjectPool<T> where T : Component
{
private readonly Queue<T> _pool = new();
private readonly T _prefab;
private readonly Transform _parent;
public ObjectPool(T prefab, int initialSize, Transform parent = null)
{
_prefab = prefab;
_parent = parent;
for (int i = 0; i < initialSize; i++)
Release(Create());
}
public T Get()
{
T obj = _pool.Count > 0 ? _pool.Dequeue() : Create();
obj.gameObject.SetActive(true);
return obj;
}
public void Release(T obj)
{
obj.gameObject.SetActive(false);
_pool.Enqueue(obj);
}
private T Create() => Object.Instantiate(_prefab, _parent);
}
public class PlayerController : MonoBehaviour
{
// 在 Awake 中缓存所有组件引用 — 绝不在 Update 中调用 GetComponent
private Rigidbody _rb;
private Animator _animator;
private PlayerInput _input;
private void Awake()
{
_rb = GetComponent<Rigidbody>();
_animator = GetComponent<Animator>();
_input = GetComponent<PlayerInput>();
}
private void FixedUpdate()
{
// 使用缓存的引用;使用 deltaTime 实现帧率无关性
Vector3 move = _input.MoveDirection * (speed * Time.fixedDeltaTime);
_rb.MovePosition(_rb.position + move);
}
}
public abstract class State
{
public abstract void Enter();
public abstract void Tick(float deltaTime);
public abstract void Exit();
}
public class StateMachine
{
private State _current;
public void TransitionTo(State next)
{
_current?.Exit();
_current = next;
_current.Enter();
}
public void Tick(float deltaTime) => _current?.Tick(deltaTime);
}
// 使用示例
public class IdleState : State
{
private readonly Animator _animator;
public IdleState(Animator animator) => _animator = animator;
public override void Enter() => _animator.SetTrigger("Idle");
public override void Tick(float deltaTime) { /* poll transitions */ }
public override void Exit() { }
}
每周安装量
1.0K
代码仓库
GitHub 星标数
7.2K
首次出现
Jan 20, 2026
安全审计
安装于
opencode873
gemini-cli839
codex831
github-copilot775
cursor761
claude-code746
Load detailed guidance based on context:
| Topic | Reference | Load When |
|---|---|---|
| Unity Development | references/unity-patterns.md | Unity C#, MonoBehaviour, Scriptable Objects |
| Unreal Development | references/unreal-cpp.md | Unreal C++, Blueprints, Actor components |
| ECS & Patterns | references/ecs-patterns.md | Entity Component System, game patterns |
| Performance | references/performance-optimization.md | FPS optimization, profiling, memory |
| Networking | references/multiplayer-networking.md | Multiplayer, client-server, lag compensation |
When implementing game features, provide:
public class ObjectPool<T> where T : Component
{
private readonly Queue<T> _pool = new();
private readonly T _prefab;
private readonly Transform _parent;
public ObjectPool(T prefab, int initialSize, Transform parent = null)
{
_prefab = prefab;
_parent = parent;
for (int i = 0; i < initialSize; i++)
Release(Create());
}
public T Get()
{
T obj = _pool.Count > 0 ? _pool.Dequeue() : Create();
obj.gameObject.SetActive(true);
return obj;
}
public void Release(T obj)
{
obj.gameObject.SetActive(false);
_pool.Enqueue(obj);
}
private T Create() => Object.Instantiate(_prefab, _parent);
}
public class PlayerController : MonoBehaviour
{
// Cache all component references in Awake — never call GetComponent in Update
private Rigidbody _rb;
private Animator _animator;
private PlayerInput _input;
private void Awake()
{
_rb = GetComponent<Rigidbody>();
_animator = GetComponent<Animator>();
_input = GetComponent<PlayerInput>();
}
private void FixedUpdate()
{
// Use cached references; use deltaTime for frame-independence
Vector3 move = _input.MoveDirection * (speed * Time.fixedDeltaTime);
_rb.MovePosition(_rb.position + move);
}
}
public abstract class State
{
public abstract void Enter();
public abstract void Tick(float deltaTime);
public abstract void Exit();
}
public class StateMachine
{
private State _current;
public void TransitionTo(State next)
{
_current?.Exit();
_current = next;
_current.Enter();
}
public void Tick(float deltaTime) => _current?.Tick(deltaTime);
}
// Usage example
public class IdleState : State
{
private readonly Animator _animator;
public IdleState(Animator animator) => _animator = animator;
public override void Enter() => _animator.SetTrigger("Idle");
public override void Tick(float deltaTime) { /* poll transitions */ }
public override void Exit() { }
}
Weekly Installs
1.0K
Repository
GitHub Stars
7.2K
First Seen
Jan 20, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
opencode873
gemini-cli839
codex831
github-copilot775
cursor761
claude-code746
React 组合模式指南:Vercel 组件架构最佳实践,提升代码可维护性
102,200 周安装