Files
DX12/Engine/Components/Script.h
2026-03-19 18:27:49 +08:00

36 lines
708 B
C++

/**
* @file Script.h
* @brief 脚本组件创建、销毁与更新接口。
*/
#pragma once
#include "ComponentsCommon.h"
namespace XEngine::script {
/**
* @brief 脚本组件初始化信息。
*/
struct init_info
{
detail::script_creator script_creator;
};
/**
* @brief 为实体创建脚本组件。
* @param info 脚本初始化信息。
* @param entity 目标实体。
* @return 创建后的脚本组件句柄。
*/
component create(init_info info, game_entity::entity entity);
/**
* @brief 移除脚本组件。
* @param c 脚本组件句柄。
*/
void remove(component c);
/**
* @brief 更新所有脚本组件。
* @param dt 帧时间间隔(秒)。
*/
void update(float dt);
}