|
|
@ -341,7 +341,8 @@ pub fn Entity(comptime ctx: anytype) type { |
|
|
|
|
|
|
|
|
|
|
|
pub fn set(self: Self, comptime T: anytype, value: meta.AnyToType(T)) void { |
|
|
|
pub fn set(self: Self, comptime T: anytype, value: meta.AnyToType(T)) void { |
|
|
|
const id = Context.anyToId(T); |
|
|
|
const id = Context.anyToId(T); |
|
|
|
_ = c.ecs_set_id(self.world.raw, self.raw, id, @sizeOf(@TypeOf(value)), &value); |
|
|
|
const size = @sizeOf(@TypeOf(value)); |
|
|
|
|
|
|
|
_ = c.ecs_set_id(self.world.raw, self.raw, id, size, @ptrCast(&value)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// The `fmt` parameter can be one of: |
|
|
|
/// The `fmt` parameter can be one of: |
|
|
|