BehaviorLib~ BehaviorTarget

行为目标对象

Constructor

new BehaviorTarget()

Members

self :any

行为目标自身

Type:
  • any

behaviors :Array.<BehaviorTargetBehavior>

行为目标所具有的行为

Type:
  • Array.<BehaviorTargetBehavior>

onTickEvent :EasyBox3Lib.onTickEventToken|undefined

Type:
  • EasyBox3Lib.onTickEventToken | undefined

data

行为对象数据

self :any

行为目标自身

Type:
  • any

behaviors :Array.<BehaviorTargetBehavior>

行为目标所具有的行为

Type:
  • Array.<BehaviorTargetBehavior>

onTickEvent :EasyBox3Lib.onTickEventToken|undefined

Type:
  • EasyBox3Lib.onTickEventToken | undefined

data

行为对象数据

Methods

addBehavior(behavior, priority)

添加行为

Parameters:
NameTypeDescription
behaviorstring

行为id

prioritynumber

行为优先级

removeBehavior(behavior)

移除行为

Parameters:
NameTypeDescription
behaviorstring

行为id

enableBehavior(behavior)

对该对象启用行为

Parameters:
NameTypeDescription
behaviorstring

行为id

disabledBehavior(behavior)

对该对象禁用行为
禁用后,该对象将不会执行该行为

Parameters:
NameTypeDescription
behaviorstring

行为id

hasBehavior(id) → {boolean}

检查是否有某种行为

Parameters:
NameTypeDescription
idstring

行为id

Returns:

是否有行为

Type: 
boolean

(async) callBehavior(behaviorId, data) → {any}

调用其他行为的函数

Parameters:
NameTypeDescription
behaviorIdstring

要调用的行为id

dataany

传入行为的数据

Returns:

行为返回结果

Type: 
any

createOnTickEvent(tpc, performanceImpact) → {EasyBox3Lib.onTickEventToken}

为该对象的行为创建onTick

Parameters:
NameTypeDescription
tpcnumber

每循环执行次数

performanceImpactnumber

性能影响程度

Returns:

事件令牌

Type: 
EasyBox3Lib.onTickEventToken

addBehavior(behavior, priority)

添加行为

Parameters:
NameTypeDescription
behaviorstring

行为id

prioritynumber

行为优先级

removeBehavior(behavior)

移除行为

Parameters:
NameTypeDescription
behaviorstring

行为id

enableBehavior(behavior)

对该对象启用行为

Parameters:
NameTypeDescription
behaviorstring

行为id

disabledBehavior(behavior)

对该对象禁用行为
禁用后,该对象将不会执行该行为

Parameters:
NameTypeDescription
behaviorstring

行为id

hasBehavior(id) → {boolean}

检查是否有某种行为

Parameters:
NameTypeDescription
idstring

行为id

Returns:

是否有行为

Type: 
boolean

(async) callBehavior(behaviorId, data) → {any}

调用其他行为的函数

Parameters:
NameTypeDescription
behaviorIdstring

要调用的行为id

dataany

传入行为的数据

Returns:

行为返回结果

Type: 
any

createOnTickEvent(tpc, performanceImpact) → {EasyBox3Lib.onTickEventToken}

为该对象的行为创建onTick

Parameters:
NameTypeDescription
tpcnumber

每循环执行次数

performanceImpactnumber

性能影响程度

Returns:

事件令牌

Type: 
EasyBox3Lib.onTickEventToken

BehaviorLib~ BehaviorTarget

行为目标对象

Constructor

new BehaviorTarget()

Members

self :any

行为目标自身

Type:
  • any

behaviors :Array.<BehaviorTargetBehavior>

行为目标所具有的行为

Type:
  • Array.<BehaviorTargetBehavior>

onTickEvent :EasyBox3Lib.onTickEventToken|undefined

Type:
  • EasyBox3Lib.onTickEventToken | undefined

data

行为对象数据

self :any

行为目标自身

Type:
  • any

behaviors :Array.<BehaviorTargetBehavior>

行为目标所具有的行为

Type:
  • Array.<BehaviorTargetBehavior>

onTickEvent :EasyBox3Lib.onTickEventToken|undefined

Type:
  • EasyBox3Lib.onTickEventToken | undefined

data

行为对象数据

Methods

addBehavior(behavior, priority)

添加行为

Parameters:
NameTypeDescription
behaviorstring

行为id

prioritynumber

行为优先级

removeBehavior(behavior)

移除行为

Parameters:
NameTypeDescription
behaviorstring

行为id

enableBehavior(behavior)

对该对象启用行为

Parameters:
NameTypeDescription
behaviorstring

行为id

disabledBehavior(behavior)

对该对象禁用行为
禁用后,该对象将不会执行该行为

Parameters:
NameTypeDescription
behaviorstring

行为id

hasBehavior(id) → {boolean}

检查是否有某种行为

Parameters:
NameTypeDescription
idstring

行为id

Returns:

是否有行为

Type: 
boolean

(async) callBehavior(behaviorId, data) → {any}

调用其他行为的函数

Parameters:
NameTypeDescription
behaviorIdstring

要调用的行为id

dataany

传入行为的数据

Returns:

行为返回结果

Type: 
any

createOnTickEvent(tpc, performanceImpact) → {EasyBox3Lib.onTickEventToken}

为该对象的行为创建onTick

Parameters:
NameTypeDescription
tpcnumber

每循环执行次数

performanceImpactnumber

性能影响程度

Returns:

事件令牌

Type: 
EasyBox3Lib.onTickEventToken

addBehavior(behavior, priority)

添加行为

Parameters:
NameTypeDescription
behaviorstring

行为id

prioritynumber

行为优先级

removeBehavior(behavior)

移除行为

Parameters:
NameTypeDescription
behaviorstring

行为id

enableBehavior(behavior)

对该对象启用行为

Parameters:
NameTypeDescription
behaviorstring

行为id

disabledBehavior(behavior)

对该对象禁用行为
禁用后,该对象将不会执行该行为

Parameters:
NameTypeDescription
behaviorstring

行为id

hasBehavior(id) → {boolean}

检查是否有某种行为

Parameters:
NameTypeDescription
idstring

行为id

Returns:

是否有行为

Type: 
boolean

(async) callBehavior(behaviorId, data) → {any}

调用其他行为的函数

Parameters:
NameTypeDescription
behaviorIdstring

要调用的行为id

dataany

传入行为的数据

Returns:

行为返回结果

Type: 
any

createOnTickEvent(tpc, performanceImpact) → {EasyBox3Lib.onTickEventToken}

为该对象的行为创建onTick

Parameters:
NameTypeDescription
tpcnumber

每循环执行次数

performanceImpactnumber

性能影响程度

Returns:

事件令牌

Type: 
EasyBox3Lib.onTickEventToken