CI / Go Backend (push) Canceled after 0s
初始化 monorepo: Go后端(7微服务) + Unity客户端(9模块) + 启动器 HTML5原型: Three.js 3D体素世界, Perlin噪声地形, 原版材质, 22种方块 Minecraft创造模式背包: 双栏布局, 拖拽移动物品, 方向性元件引脚 AI助搭策划文档 + 客户端/服务端骨架 + Docker Compose + CI
84 lines
2.3 KiB
C#
84 lines
2.3 KiB
C#
using UnityEngine;
|
|
|
|
namespace RedCircuit.AIAssistant
|
|
{
|
|
/// <summary>
|
|
/// 上下文采集器,收集当前游戏状态供 AI 参考。
|
|
/// </summary>
|
|
public class AIContextProvider : MonoBehaviour
|
|
{
|
|
/// <summary>采集当前游戏上下文</summary>
|
|
public GameContext CollectContext()
|
|
{
|
|
var context = new GameContext
|
|
{
|
|
Mode = GetCurrentMode(),
|
|
CanvasWidth = GetCanvasWidth(),
|
|
CanvasHeight = GetCanvasHeight(),
|
|
ComponentCount = GetComponentCount(),
|
|
SelectedComponentId = GetSelectedComponentId(),
|
|
SelectedComponentType = GetSelectedComponentType(),
|
|
LevelId = GetCurrentLevelId(),
|
|
LevelTitle = GetCurrentLevelTitle(),
|
|
RedstoneCoins = GetRedstoneCoins()
|
|
};
|
|
|
|
return context;
|
|
}
|
|
|
|
private string GetCurrentMode()
|
|
{
|
|
// TODO: 从 GameManager 获取当前游戏模式
|
|
return "creative"; // creative / puzzle / automation / multiplayer
|
|
}
|
|
|
|
private int GetCanvasWidth()
|
|
{
|
|
// TODO: 从 GridCanvas 获取画布宽度
|
|
return 128;
|
|
}
|
|
|
|
private int GetCanvasHeight()
|
|
{
|
|
// TODO: 从 GridCanvas 获取画布高度
|
|
return 128;
|
|
}
|
|
|
|
private int GetComponentCount()
|
|
{
|
|
// TODO: 从 CircuitGraph 获取当前元件数
|
|
return 0;
|
|
}
|
|
|
|
private string GetSelectedComponentId()
|
|
{
|
|
// TODO: 从 PlacementController 获取选中元件 ID
|
|
return null;
|
|
}
|
|
|
|
private string GetSelectedComponentType()
|
|
{
|
|
// TODO: 从 PlacementController 获取选中元件类型
|
|
return null;
|
|
}
|
|
|
|
private int? GetCurrentLevelId()
|
|
{
|
|
// TODO: 解谜模式下获取当前关卡 ID
|
|
return null;
|
|
}
|
|
|
|
private string GetCurrentLevelTitle()
|
|
{
|
|
// TODO: 解谜模式下获取当前关卡标题
|
|
return null;
|
|
}
|
|
|
|
private long GetRedstoneCoins()
|
|
{
|
|
// TODO: 从 EconomyManager 获取红石币余额
|
|
return 0;
|
|
}
|
|
}
|
|
}
|