graphify
GRGraphify-Labs/graphify156k2,512 new stars in the last 7 days
Use when building game systems, implementing Unity/Unreal Engine features, or optimizing game performance. Invoke to implement ECS architecture, configure physics systems and colliders, set up multiplayer networking with lag compensation, optimize frame rates to 60+ FPS targets, develop shaders, or apply game design patterns such as object pooling and state machines. Trigger keywords: Unity, Unreal Engine, game development, ECS architecture, game physics, multiplayer networking, game optimization, shader programming, game AI.
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:
// UnityEngine.Pool.ObjectPool<T> is built in since Unity 2021.1
// Bullet is your own MonoBehaviour on the prefab
using UnityEngine;
using UnityEngine.Pool;
public class BulletSpawner : MonoBehaviour
{
[SerializeField] private Bullet _prefab;
private ObjectPool<Bullet> _pool;
private void Awake()
{
_pool = new ObjectPool<Bullet>(
createFunc: () => Instantiate(_prefab),
actionOnGet: bullet => bullet.gameObject.SetActive(true),
actionOnRelease: bullet => bullet.gameObject.SetActive(false),
actionOnDestroy: bullet => Destroy(bullet.gameObject),
collectionCheck: true,
defaultCapacity: 20,
maxSize: 100
);
}
public Bullet Spawn() => _pool.Get();
public void Despawn(Bullet bullet) => _pool.Release(bullet);
}
using UnityEngine;
using UnityEngine.InputSystem;
public class PlayerController : MonoBehaviour
{
[SerializeField] private float _speed = 5f;
// Cache all component references in Awake — never call GetComponent in Update
private Rigidbody _rb;
private InputAction _move;
private void Awake()
{
_rb = GetComponent<Rigidbody>();
_move = GetComponent<PlayerInput>().actions["Move"];
}
private void FixedUpdate()
{
// Use cached references; scale by fixedDeltaTime in FixedUpdate
Vector2 input = _move.ReadValue<Vector2>();
Vector3 move = new Vector3(input.x, 0f, input.y) * (_speed * Time.fixedDeltaTime);
_rb.MovePosition(_rb.position + move);
}
}
using UnityEngine;
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() { }
}
Maintained by @jeffallan, Principal Consultant at Synergetic Solutions
GRGraphify-Labs/graphify156k2,512 new stars in the last 7 days
PApaperclipai/paperclip119k1,920 new stars in the last 7 days
NEnexu-io/open-design111k1,263 new stars in the last 7 days
HEheygen-com/hyperframes95k4,615 new stars in the last 7 days
BYbytedance/deer-flow86k255 new stars in the last 7 days
BYbytedance/deer-flow86k255 new stars in the last 7 days