goscr

package
v0.1.34 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 31, 2024 License: LGPL-2.1 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Name      = self.Name
	Using     = self.Using
	Install   = self.Install
	Uninstall = self.Uninstall
)
View Source
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 创建脚本化实体原型属性,用于注册实体原型时自定义相关属性

func EntityWithT

func EntityWithT[T any](prototype, script string, scope *ec.Scope, componentAwakeOnFirstTouch, componentUniqueID *bool, extra ...map[string]any) pt.EntityAttribute

EntityWithT 创建脚本化实体原型属性,用于注册实体原型时自定义相关属性

Types

type Component

type Component struct {
	framework.ComponentBehavior
}

Component 脚本化组件

func (*Component) Awake

func (c *Component) Awake()

Awake 生命周期Awake

func (*Component) Callee

func (c *Component) Callee(method string) reflect.Value

Callee 被调函数

func (*Component) Dispose

func (c *Component) Dispose()

Dispose 生命周期Dispose

func (*Component) Shut

func (c *Component) Shut()

Shut 生命周期Shut

func (*Component) Start

func (c *Component) Start()

Start 生命周期Start

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

func (*ComponentEnableUpdate) Update

func (c *ComponentEnableUpdate) Update()

Update 生命周期Update

type ComponentEnableUpdateAndLateUpdate

type ComponentEnableUpdateAndLateUpdate struct {
	Component
}

ComponentEnableUpdateAndLateUpdate 脚本化组件,支持Update、LateUpdate

func (*ComponentEnableUpdateAndLateUpdate) LateUpdate

func (c *ComponentEnableUpdateAndLateUpdate) LateUpdate()

LateUpdate 生命周期LateUpdate

func (*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

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

type ComponentThis[T any] struct {
	Component
}

ComponentThis 脚本化组件,支持获取This指针,用于函数模式绑定脚本函数

func (*ComponentThis[T]) This added in v0.1.30

func (c *ComponentThis[T]) This() *T

type Entity

type Entity struct {
	framework.EntityBehavior
}

Entity 脚本化实体

func (*Entity) Awake

func (e *Entity) Awake()

Awake 生命周期Awake

func (*Entity) Callee

func (e *Entity) Callee(method string) reflect.Value

Callee 被调函数

func (*Entity) Dispose

func (e *Entity) Dispose()

Dispose 生命周期Dispose

func (*Entity) Shut

func (e *Entity) Shut()

Shut 生命周期Shut

func (*Entity) Start

func (e *Entity) Start()

Start 生命周期Start

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

func (*EntityEnableUpdate) Update

func (e *EntityEnableUpdate) Update()

Update 生命周期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) Declare

func (c EntityPTCreator) Declare()

Declare 声明实体原型

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) Redeclare

func (c EntityPTCreator) Redeclare()

Redeclare 重新声明实体原型

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

type EntityThis[T any] struct {
	Entity
}

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 LifecycleComponentOnDisable added in v0.1.34

type LifecycleComponentOnDisable interface {
	OnDisable()
}

LifecycleComponentOnDisable 组件的生命周期进入关闭(OnDisable)时的回调,组件实现此接口即可使用,脚本中无法使用

type LifecycleComponentOnDisposed added in v0.1.34

type LifecycleComponentOnDisposed interface {
	OnDisposed()
}

LifecycleComponentOnDisposed 组件的生命周期进入释放后(OnDisposed)时的回调,组件实现此接口即可使用,脚本中无法使用

type LifecycleComponentOnEnable added in v0.1.34

type LifecycleComponentOnEnable interface {
	OnEnable()
}

LifecycleComponentOnEnable 组件的生命周期进入启用(OnEnable)时的回调,组件实现此接口即可使用,脚本中无法使用

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 LifecycleEntityOnDisable added in v0.1.34

type LifecycleEntityOnDisable interface {
	OnDisable()
}

LifecycleEntityOnDisable 实体的生命周期进入关闭(OnDisable)时的回调,实体实现此接口即可使用,脚本中无法使用

type LifecycleEntityOnDisposed added in v0.1.34

type LifecycleEntityOnDisposed interface {
	OnDisposed()
}

LifecycleEntityOnDisposed 实体的生命周期进入释放后(OnDisposed)时的回调,实体实现此接口即可使用,脚本中无法使用

type LifecycleEntityOnEnable added in v0.1.34

type LifecycleEntityOnEnable interface {
	OnEnable()
}

LifecycleEntityOnEnable 实体的生命周期进入启用(OnEnable)时的回调,实体实现此接口即可使用,脚本中无法使用

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)时的回调,实体实现此接口即可使用,脚本中无法使用

type LoadedCB

LoadedCB 加载完成回调

type LoadingCB

type LoadingCB = generic.DelegateVoid1[*dynamic.Solution]

LoadingCB 开始加载回调

type ScriptOptions

type ScriptOptions struct {
	PkgRoot    string             // 包根路径
	Projects   []*dynamic.Project // 脚本工程列表
	AutoHotFix bool               // 自动热更新
	LoadingCB  LoadingCB          // 加载完成回调
	LoadedCB   LoadedCB           // 加载完成回调
}

ScriptOptions 所有选项

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL