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
- func GetComponentScript(entity ec.Entity, name string) func() *ComponentBehavior
- func GetComponentScriptT[T interface{ ... }](entity ec.Entity, name string) func() T
- func GetEntityScript(entity ec.Entity) func() *EntityBehavior
- func GetEntityScriptT[T interface{ ... }](entity ec.Entity) func() T
- 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) Declare()
- func (c EntityPTCreator) Redeclare()
- func (c EntityPTCreator) SetComponentAwakeOnFirstTouch(b bool) EntityPTCreator
- func (c EntityPTCreator) SetComponentNameIndexing(b bool) EntityPTCreator
- func (c EntityPTCreator) SetComponentUniqueID(b bool) EntityPTCreator
- func (c EntityPTCreator) SetExtra(extra map[string]any) EntityPTCreator
- func (c EntityPTCreator) SetInstance(instance any) EntityPTCreator
- func (c EntityPTCreator) SetScope(scope ec.Scope) EntityPTCreator
- func (c EntityPTCreator) SetScript(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 创建脚本化实体原型属性,用于注册实体原型时自定义相关属性
func GetComponentScript ¶ added in v0.1.47
func GetComponentScript(entity ec.Entity, name string) func() *ComponentBehavior
GetComponentScript 获取组件脚本
func GetComponentScriptT ¶ added in v0.1.47
GetComponentScriptT 获取组件脚本
func GetEntityScript ¶ added in v0.1.47
func GetEntityScript(entity ec.Entity) func() *EntityBehavior
GetEntityScript 获取实体脚本
func GetEntityScriptT ¶ added in v0.1.47
GetEntityScriptT 获取实体脚本
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 BuildEntityPT ¶ added in v0.1.55
func BuildEntityPT(svcCtx service.Context, prototype string) EntityPTCreator
BuildEntityPT 创建实体原型
func (EntityPTCreator) AddComponent ¶
func (c EntityPTCreator) AddComponent(comp any, name ...string) EntityPTCreator
AddComponent 添加组件
func (EntityPTCreator) SetComponentAwakeOnFirstTouch ¶ added in v0.1.55
func (c EntityPTCreator) SetComponentAwakeOnFirstTouch(b bool) EntityPTCreator
SetComponentAwakeOnFirstTouch 设置当实体组件首次被访问时,生命周期是否进入唤醒(Awake)
func (EntityPTCreator) SetComponentNameIndexing ¶ added in v0.1.55
func (c EntityPTCreator) SetComponentNameIndexing(b bool) EntityPTCreator
SetComponentNameIndexing 设置是否开启组件名称索引
func (EntityPTCreator) SetComponentUniqueID ¶ added in v0.1.55
func (c EntityPTCreator) SetComponentUniqueID(b bool) EntityPTCreator
SetComponentUniqueID 设置是否为实体组件分配唯一Id
func (EntityPTCreator) SetExtra ¶ added in v0.1.55
func (c EntityPTCreator) SetExtra(extra map[string]any) EntityPTCreator
SetExtra 设置自定义属性
func (EntityPTCreator) SetInstance ¶ added in v0.1.55
func (c EntityPTCreator) SetInstance(instance any) EntityPTCreator
SetInstance 设置实例,用于扩展实体能力
func (EntityPTCreator) SetScope ¶ added in v0.1.55
func (c EntityPTCreator) SetScope(scope ec.Scope) EntityPTCreator
SetScope 设置实体的可访问作用域
func (EntityPTCreator) SetScript ¶ added in v0.1.56
func (c EntityPTCreator) SetScript(script string) EntityPTCreator
SetScript 设置脚本
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)时的回调,实体实现此接口即可使用,脚本中无法使用