Documentation ¶
Index ¶
- Variables
- func ComponentWith(name, script string, nonRemovable bool, extra ...map[string]any) pt.ComponentAttribute
- func ComponentWithT[T any](name, script string, nonRemovable bool, extra ...map[string]any) pt.ComponentAttribute
- func EntityWith(prototype, script string, scope *ec.Scope, ...) pt.EntityAttribute
- func EntityWithT[T any](prototype, script string, scope *ec.Scope, ...) pt.EntityAttribute
- type Component
- type ComponentEnableLateUpdate
- type ComponentEnableLateUpdateThis
- type ComponentEnableUpdate
- type ComponentEnableUpdateAndLateUpdate
- type ComponentEnableUpdateAndLateUpdateThis
- type ComponentEnableUpdateThis
- type ComponentThis
- type Entity
- 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) 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 ComponentWith ¶
func ComponentWith(name, script string, nonRemovable bool, extra ...map[string]any) pt.ComponentAttribute
ComponentWith 创建脚本化组件原型属性,用于注册实体原型时自定义相关属性
func ComponentWithT ¶
func ComponentWithT[T any](name, script string, nonRemovable bool, extra ...map[string]any) pt.ComponentAttribute
ComponentWithT 创建脚本化组件原型属性,用于注册实体原型时自定义相关属性
func EntityWith ¶
func EntityWith(prototype, script string, scope *ec.Scope, componentAwakeOnFirstTouch, componentUniqueID *bool, extra ...map[string]any) pt.EntityAttribute
EntityWith 创建脚本化实体原型属性,用于注册实体原型时自定义相关属性
Types ¶
type ComponentEnableLateUpdate ¶
type ComponentEnableLateUpdate struct {
Component
}
ComponentEnableLateUpdate 脚本化组件,支持LateUpdate
func (*ComponentEnableLateUpdate) LateUpdate ¶
func (c *ComponentEnableLateUpdate) LateUpdate()
LateUpdate 生命周期LateUpdate
type ComponentEnableLateUpdateThis ¶ added in v0.1.30
type ComponentEnableLateUpdateThis[T any] struct { ComponentEnableLateUpdate }
ComponentEnableLateUpdateThis 脚本化组件,支持LateUpdate,支持获取This指针,用于函数模式绑定脚本函数
func (*ComponentEnableLateUpdateThis[T]) This ¶ added in v0.1.30
func (c *ComponentEnableLateUpdateThis[T]) This() *T
type ComponentEnableUpdate ¶
type ComponentEnableUpdate struct {
Component
}
ComponentEnableUpdate 脚本化组件,支持Update
type ComponentEnableUpdateAndLateUpdate ¶
type ComponentEnableUpdateAndLateUpdate struct {
Component
}
ComponentEnableUpdateAndLateUpdate 脚本化组件,支持Update、LateUpdate
func (*ComponentEnableUpdateAndLateUpdate) LateUpdate ¶
func (c *ComponentEnableUpdateAndLateUpdate) LateUpdate()
LateUpdate 生命周期LateUpdate
func (*ComponentEnableUpdateAndLateUpdate) Update ¶
func (c *ComponentEnableUpdateAndLateUpdate) Update()
Update 生命周期Update
type ComponentEnableUpdateAndLateUpdateThis ¶ added in v0.1.30
type ComponentEnableUpdateAndLateUpdateThis[T any] struct { ComponentEnableUpdateAndLateUpdate }
ComponentEnableUpdateAndLateUpdateThis 脚本化组件,支持Update、LateUpdate,支持获取This指针,用于函数模式绑定脚本函数
func (*ComponentEnableUpdateAndLateUpdateThis[T]) This ¶ added in v0.1.30
func (c *ComponentEnableUpdateAndLateUpdateThis[T]) This() *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() *T
type ComponentThis ¶ added in v0.1.30
ComponentThis 脚本化组件,支持获取This指针,用于函数模式绑定脚本函数
func (*ComponentThis[T]) This ¶ added in v0.1.30
func (c *ComponentThis[T]) This() *T
type EntityEnableLateUpdate ¶
type EntityEnableLateUpdate struct {
Entity
}
EntityEnableLateUpdate 脚本化实体,支持LateUpdate
func (*EntityEnableLateUpdate) LateUpdate ¶
func (e *EntityEnableLateUpdate) LateUpdate()
LateUpdate 生命周期LateUpdate
type EntityEnableLateUpdateThis ¶ added in v0.1.30
type EntityEnableLateUpdateThis[T any] struct { EntityEnableLateUpdate }
EntityEnableLateUpdateThis 脚本化实体,支持LateUpdate,支持获取This指针,用于函数模式绑定脚本函数
func (*EntityEnableLateUpdateThis[T]) This ¶ added in v0.1.30
func (e *EntityEnableLateUpdateThis[T]) This() *T
type EntityEnableUpdate ¶
type EntityEnableUpdate struct {
Entity
}
EntityEnableUpdate 脚本化实体,支持Update
type EntityEnableUpdateAndLateUpdate ¶
type EntityEnableUpdateAndLateUpdate struct {
Entity
}
EntityEnableUpdateAndLateUpdate 脚本化实体,支持Update、LateUpdate
func (*EntityEnableUpdateAndLateUpdate) LateUpdate ¶
func (e *EntityEnableUpdateAndLateUpdate) LateUpdate()
LateUpdate 生命周期LateUpdate
func (*EntityEnableUpdateAndLateUpdate) Update ¶
func (e *EntityEnableUpdateAndLateUpdate) Update()
Update 生命周期Update
type EntityEnableUpdateAndLateUpdateThis ¶ added in v0.1.30
type EntityEnableUpdateAndLateUpdateThis[T any] struct { EntityEnableUpdateAndLateUpdate }
EntityEnableUpdateAndLateUpdateThis 脚本化实体,支持Update、LateUpdate,支持获取This指针,用于函数模式绑定脚本函数
func (*EntityEnableUpdateAndLateUpdateThis[T]) This ¶ added in v0.1.30
func (e *EntityEnableUpdateAndLateUpdateThis[T]) This() *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 (e *EntityEnableUpdateThis[T]) This() *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) 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 (e *EntityThis[T]) This() *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)时的回调,实体实现此接口即可使用,脚本中无法使用