const engine = @import("engine");
pub const Spinner = struct {
pub const is_component = true;
speed: f32 = 90.0, // editable in inspector
pub fn update(self: *Spinner, time: engine.Time) void { _ =
self.speed * time.delta;
};
真正的编辑器,零运行时负担
Turian 将类 Unity 的可视化工作流与系统级语言的确定性结合在一起。无虚拟机 (VM)、无脚本桥接、无隐式内存分配。
Visual editor
Scene hierarchy, inspector, asset browser and a live 3D viewport — all in a single window powered by SDL3 GPU.
Component system
Declare pub const is_component = true; in any struct and it appears in the Add Component menu with full field inspection.
Live script discovery
Drop a .zig file into assets/ and your component shows up immediately — fields introspected at edit-time.
Asset pipeline
Loads OBJ, glTF 2.0 / GLB, PNG, JPG and more, with GUID-stable references that survive moves and renames.
Headless CLI
turian-cli build compiles your game without opening the GUI — the same artifact your editor produces, ideal for CI.
Pure Zig
No garbage collector, no hidden allocations, no runtime surprises. Compiles to a single executable on every Zig-supported platform.
组件仅仅是 Zig 结构体
只需一个标记即可将普通结构体转为编辑器组件。公共字段自动转为属性检查器中的控件;生命周期钩子只是普通的结构体方法,仅在需要时实现即可。
- 代码驱动发现 —— 编辑器解析真正的 Zig 代码而非正则,因此注释和条件编译绝不会影响其正常工作。
- 属性检查器字段类型化 —— f32、i32、bool、Vec3 以及对象/资源引用都会自动渲染。
- 熟悉的生命周期 —— awake、enable、start、update、disable、destroy。
const std = @import("std");
const engine = @import("engine");
pub const Follower = struct {
pub const is_component = true;
// Drag a GameObject from the Hierarchy here.
target: engine.GameObjectRef = .{},
speed: f32 = 4.0,
pub fn start(self: *Follower) void {
const name = self.target.slice();
if (name.len > 0) std.debug.print("following '{s}'\n", .{name});
}
pub fn update(self: *Follower, time: engine.Time) void {
_ = self.speed * time.delta;
};
};
三个命令。一个二进制。
基架搭建
使用 turian-cli new-project 创建包含资源文件夹和初始场景的项目。
脚本编写与场景布置
打开 Turian Studio,添加组件,连接场景,并在属性检查器中实时调整字段值。
构建与分享
使用 turian-cli build 打包资源并生成一个独立的可执行文件,您可以直接分发给任何人。
加入社区
提出疑问、分享作品并帮助共同塑造引擎 —— 欢迎每一个人的到来。
支持 Turian 开发
Turian 由志愿者共同打造。您的支持将资助持续开发工作,保持引擎免费和开源。