Documentation ¶
Index ¶
- Variables
- func ComponentScript(script string) pt.ComponentAttribute
- func ComponentScriptT[T any](script string) pt.ComponentAttribute
- func EntityScript(prototype, script string) pt.EntityAttribute
- func EntityScriptT[T any](prototype, script string) pt.EntityAttribute
- type Component
- type ComponentBehavior
- type ComponentEnableLateUpdate
- type ComponentEnableLateUpdateThis
- type ComponentEnableUpdate
- type ComponentEnableUpdateAndLateUpdate
- type ComponentEnableUpdateAndLateUpdateThis
- type ComponentEnableUpdateThis
- type ComponentThis
- type Entity
- type EntityBehavior
- type EntityEnableLateUpdate
- type EntityEnableLateUpdateThis
- type EntityEnableUpdate
- type EntityEnableUpdateAndLateUpdate
- type EntityEnableUpdateAndLateUpdateThis
- type EntityEnableUpdateThis
- type EntityPTCreator
- func (c EntityPTCreator) AddComponent(comp any, name ...string) EntityPTCreator
- func (c EntityPTCreator) ComponentAwakeOnFirstTouch(b bool) EntityPTCreator
- func (c EntityPTCreator) ComponentNameIndexing(b bool) EntityPTCreator
- func (c EntityPTCreator) ComponentUniqueID(b bool) EntityPTCreator
- func (c EntityPTCreator) Declare()
- func (c EntityPTCreator) Extra(extra map[string]any) EntityPTCreator
- func (c EntityPTCreator) Instance(instance any) EntityPTCreator
- func (c EntityPTCreator) Redeclare()
- func (c EntityPTCreator) Scope(scope ec.Scope) EntityPTCreator
- func (c EntityPTCreator) Script(script string) EntityPTCreator
- type EntityThis
- type IScript
- type LifecycleComponentOnCreate
- type LifecycleComponentOnDisposed
- type LifecycleComponentOnStarted
- type LifecycleComponentOnStop
- type LifecycleEntityOnCreate
- type LifecycleEntityOnDisposed
- type LifecycleEntityOnStarted
- type LifecycleEntityOnStop
- type LoadedCB
- type LoadingCB
- type ScriptOptions
Constants ¶
This section is empty.
Variables ¶
var ( Name = self.Name Using = self.Using Install = self.Install Uninstall = self.Uninstall )
var With _Option
Functions ¶
func ComponentScript ¶ added in v0.1.40
func ComponentScript(script string) pt.ComponentAttribute
ComponentScript 创建脚本化组件原型属性,用于注册实体原型时自定义相关属性
func ComponentScriptT ¶ added in v0.1.38
func ComponentScriptT[T any](script string) pt.ComponentAttribute
ComponentScriptT 创建脚本化组件原型属性,用于注册实体原型时自定义相关属性
func EntityScript ¶ added in v0.1.38
func EntityScript(prototype, script string) pt.EntityAttribute
EntityScript 创建脚本化实体原型属性,用于注册实体原型时自定义相关属性
func EntityScriptT ¶ added in v0.1.38
func EntityScriptT[T any](prototype, script string) pt.EntityAttribute
EntityScriptT 创建脚本化实体原型属性,用于注册实体原型时自定义相关属性
Types ¶
type Component ¶
type Component struct {
framework.ComponentBehavior
}
Component 脚本化组件
func (*Component) OnDisable ¶ added in v0.1.38
func (c *Component) OnDisable()
OnDisable 生命周期关闭(OnDisable)
type ComponentBehavior ¶ added in v0.1.41
type ComponentBehavior struct { ComponentEnableUpdateAndLateUpdateThis[ComponentBehavior] }
ComponentBehavior 组件脚本化行为
type ComponentEnableLateUpdate ¶
type ComponentEnableLateUpdate struct {
Component
}
ComponentEnableLateUpdate 脚本化组件,支持帧迟滞更新(Late Update)
func (*ComponentEnableLateUpdate) LateUpdate ¶
func (c *ComponentEnableLateUpdate) LateUpdate()
LateUpdate 帧迟滞更新(Late Update)
type ComponentEnableLateUpdateThis ¶ added in v0.1.30
type ComponentEnableLateUpdateThis[T any] struct { ComponentEnableLateUpdate }
ComponentEnableLateUpdateThis 脚本化组件,支持帧迟滞更新(Late Update),支持获取This指针,用于函数模式绑定脚本函数
func (*ComponentEnableLateUpdateThis[T]) This ¶ added in v0.1.30
func (c *ComponentEnableLateUpdateThis[T]) This() func() *T
type ComponentEnableUpdate ¶
type ComponentEnableUpdate struct {
Component
}
ComponentEnableUpdate 脚本化组件,支持帧更新(Update)
type ComponentEnableUpdateAndLateUpdate ¶
type ComponentEnableUpdateAndLateUpdate struct {
Component
}
ComponentEnableUpdateAndLateUpdate 脚本化组件,支持帧更新(Update)、帧迟滞更新(Late Update)
func (*ComponentEnableUpdateAndLateUpdate) LateUpdate ¶
func (c *ComponentEnableUpdateAndLateUpdate) LateUpdate()
LateUpdate 帧迟滞更新(Late Update)
func (*ComponentEnableUpdateAndLateUpdate) Update ¶
func (c *ComponentEnableUpdateAndLateUpdate) Update()
Update 帧更新(Update)
type ComponentEnableUpdateAndLateUpdateThis ¶ added in v0.1.30
type ComponentEnableUpdateAndLateUpdateThis[T any] struct { ComponentEnableUpdateAndLateUpdate }
ComponentEnableUpdateAndLateUpdateThis 脚本化组件,支持帧更新(Update)、帧迟滞更新(Late Update),支持获取This指针,用于函数模式绑定脚本函数
func (*ComponentEnableUpdateAndLateUpdateThis[T]) This ¶ added in v0.1.30
func (c *ComponentEnableUpdateAndLateUpdateThis[T]) This() func() *T
type ComponentEnableUpdateThis ¶ added in v0.1.30
type ComponentEnableUpdateThis[T any] struct { ComponentEnableUpdate }
ComponentEnableUpdateThis 脚本化组件,支持帧更新(Update),支持获取This指针,用于函数模式绑定脚本函数
func (*ComponentEnableUpdateThis[T]) This ¶ added in v0.1.30
func (c *ComponentEnableUpdateThis[T]) This() func() *T
type ComponentThis ¶ added in v0.1.30
ComponentThis 脚本化组件,支持获取This指针,用于函数模式绑定脚本函数
func (*ComponentThis[T]) This ¶ added in v0.1.30
func (c *ComponentThis[T]) This() func() *T
type EntityBehavior ¶ added in v0.1.41
type EntityBehavior struct { EntityEnableUpdateAndLateUpdateThis[EntityBehavior] }
EntityBehavior 实体脚本化行为
type EntityEnableLateUpdate ¶
type EntityEnableLateUpdate struct {
Entity
}
EntityEnableLateUpdate 脚本化实体,支持帧迟滞更新(Late Update)
func (*EntityEnableLateUpdate) LateUpdate ¶
func (e *EntityEnableLateUpdate) LateUpdate()
LateUpdate 帧迟滞更新(Late Update)
type EntityEnableLateUpdateThis ¶ added in v0.1.30
type EntityEnableLateUpdateThis[T any] struct { EntityEnableLateUpdate }
EntityEnableLateUpdateThis 脚本化实体,支持帧迟滞更新(Late Update),支持获取This指针,用于函数模式绑定脚本函数
func (*EntityEnableLateUpdateThis[T]) This ¶ added in v0.1.30
func (c *EntityEnableLateUpdateThis[T]) This() func() *T
type EntityEnableUpdate ¶
type EntityEnableUpdate struct {
Entity
}
EntityEnableUpdate 脚本化实体,支持帧更新(Update)
type EntityEnableUpdateAndLateUpdate ¶
type EntityEnableUpdateAndLateUpdate struct {
Entity
}
EntityEnableUpdateAndLateUpdate 脚本化实体,支持帧更新(Update)、帧迟滞更新(Late Update)
func (*EntityEnableUpdateAndLateUpdate) LateUpdate ¶
func (e *EntityEnableUpdateAndLateUpdate) LateUpdate()
LateUpdate 帧迟滞更新(Late Update)
func (*EntityEnableUpdateAndLateUpdate) Update ¶
func (e *EntityEnableUpdateAndLateUpdate) Update()
Update 帧更新(Update)
type EntityEnableUpdateAndLateUpdateThis ¶ added in v0.1.30
type EntityEnableUpdateAndLateUpdateThis[T any] struct { EntityEnableUpdateAndLateUpdate }
EntityEnableUpdateAndLateUpdateThis 脚本化实体,支持帧更新(Update)、帧迟滞更新(Late Update),支持获取This指针,用于函数模式绑定脚本函数
func (*EntityEnableUpdateAndLateUpdateThis[T]) This ¶ added in v0.1.30
func (c *EntityEnableUpdateAndLateUpdateThis[T]) This() func() *T
type EntityEnableUpdateThis ¶ added in v0.1.30
type EntityEnableUpdateThis[T any] struct { EntityEnableUpdate }
EntityEnableUpdateThis 脚本化实体,支持帧更新(Update),支持获取This指针,用于函数模式绑定脚本函数
func (*EntityEnableUpdateThis[T]) This ¶ added in v0.1.30
func (c *EntityEnableUpdateThis[T]) This() func() *T
type EntityPTCreator ¶
type EntityPTCreator struct {
// contains filtered or unexported fields
}
EntityPTCreator 实体原型构建器
func CreateEntityPT ¶
func CreateEntityPT(svcCtx service.Context, prototype string) EntityPTCreator
CreateEntityPT 创建实体原型
func (EntityPTCreator) AddComponent ¶
func (c EntityPTCreator) AddComponent(comp any, name ...string) EntityPTCreator
AddComponent 添加组件
func (EntityPTCreator) ComponentAwakeOnFirstTouch ¶
func (c EntityPTCreator) ComponentAwakeOnFirstTouch(b bool) EntityPTCreator
ComponentAwakeOnFirstTouch 开启组件被首次访问时,检测并调用Awake()
func (EntityPTCreator) ComponentNameIndexing ¶ added in v0.1.44
func (c EntityPTCreator) ComponentNameIndexing(b bool) EntityPTCreator
ComponentNameIndexing 是否开启组件名称索引
func (EntityPTCreator) ComponentUniqueID ¶
func (c EntityPTCreator) ComponentUniqueID(b bool) EntityPTCreator
ComponentUniqueID 开启组件唯一Id
func (EntityPTCreator) Extra ¶
func (c EntityPTCreator) Extra(extra map[string]any) EntityPTCreator
Extra 自定义属性
func (EntityPTCreator) Instance ¶
func (c EntityPTCreator) Instance(instance any) EntityPTCreator
Instance 设置实例,用于扩展实体能力
func (EntityPTCreator) Scope ¶
func (c EntityPTCreator) Scope(scope ec.Scope) EntityPTCreator
Scope 设置实体的可访问作用域
func (EntityPTCreator) Script ¶
func (c EntityPTCreator) Script(script string) EntityPTCreator
Script 脚本
type EntityThis ¶ added in v0.1.30
EntityThis 脚本化实体,支持获取This指针,用于函数模式绑定脚本函数
func (*EntityThis[T]) This ¶ added in v0.1.30
func (c *EntityThis[T]) This() func() *T
type IScript ¶
type IScript interface { // Hotfix 热更新 Hotfix() error // Solution 解决方案 Solution() *dynamic.Solution }
IScript 脚本插件接口
type LifecycleComponentOnCreate ¶ added in v0.1.34
type LifecycleComponentOnCreate interface {
OnCreate()
}
LifecycleComponentOnCreate 组件的生命周期进入创建(OnCreate)时的回调,组件实现此接口即可使用,脚本中无法使用
type LifecycleComponentOnDisposed ¶ added in v0.1.34
type LifecycleComponentOnDisposed interface {
OnDisposed()
}
LifecycleComponentOnDisposed 组件的生命周期进入释放后(OnDisposed)时的回调,组件实现此接口即可使用,脚本中无法使用
type LifecycleComponentOnStarted ¶ added in v0.1.34
type LifecycleComponentOnStarted interface {
OnStarted()
}
LifecycleComponentOnStarted 组件的生命周期进入开始后(OnStarted)时的回调,组件实现此接口即可使用,脚本中无法使用
type LifecycleComponentOnStop ¶ added in v0.1.34
type LifecycleComponentOnStop interface {
OnStop()
}
LifecycleComponentOnStop 组件的生命周期进入结束前(OnStop)时的回调,组件实现此接口即可使用,脚本中无法使用
type LifecycleEntityOnCreate ¶ added in v0.1.34
type LifecycleEntityOnCreate interface {
OnCreate()
}
LifecycleEntityOnCreate 实体的生命周期进入创建(OnCreate)时的回调,实体实现此接口即可使用,脚本中无法使用
type LifecycleEntityOnDisposed ¶ added in v0.1.34
type LifecycleEntityOnDisposed interface {
OnDisposed()
}
LifecycleEntityOnDisposed 实体的生命周期进入释放后(OnDisposed)时的回调,实体实现此接口即可使用,脚本中无法使用
type LifecycleEntityOnStarted ¶ added in v0.1.34
type LifecycleEntityOnStarted interface {
OnStarted()
}
LifecycleEntityOnStarted 实体的生命周期进入开始后(OnStarted)时的回调,实体实现此接口即可使用,脚本中无法使用
type LifecycleEntityOnStop ¶ added in v0.1.34
type LifecycleEntityOnStop interface {
OnStop()
}
LifecycleEntityOnStop 实体的生命周期进入结束前(OnStop)时的回调,实体实现此接口即可使用,脚本中无法使用