Class CCVMParentCompAbstract

支持 MVVM 功能的游戏显示对象组件

使用方法:

  1. 对象拥有 cc.Component 组件功能与 ecs.Comp 组件功能
  2. 对象自带全局事件监听、释放、发送全局消息功能
  3. 对象管理的所有节点摊平,直接通过节点名获取cc.Node对象(节点名不能有重名)
  4. 对象支持 VMParent 所有功能

应用场景

  1. 网络游戏,优先有数据对象,然后创建视图对象,当释放视图组件时,部分场景不希望释放数据对象

Example

@ccclass('LoadingViewComp')
@ecs.register('LoadingView', false)
export class LoadingViewComp extends CCVMParentComp {
// VM 组件绑定数据
data: any = {
// 加载资源当前进度
finished: 0,
// 加载资源最大进度
total: 0,
// 加载资源进度比例值
progress: "0",
// 加载流程中提示文本
prompt: ""
};

private progress: number = 0;

reset(): void {

}
}

Hierarchy

  • default
    • CCVMParentComp

Implements

Constructors

  • Parameters

    • Optional name: string

    Returns CCVMParentComp

Properties

VM: VMManager = VM

VM 管理

__editorExtras__: unknown
__prefab: null | CompPrefabInfo
_enabled: boolean

Deprecated

since v3.5.0, this is an engine private interface that will be removed in the future.

_id: string

For internal usage.

Deprecated

since v3.5.0, this is an engine private interface that will be removed in the future.

_name: string
_objFlags: number
_sceneGetter: null | (() => RenderScene)
canRecycle: boolean
data: any = {}

需要绑定的私有数据

node: Node

En

The node this component is attached to. A component is always attached to a node.

Zh

该组件被附加到的节点。组件总会附加到一个节点。

Example

import { log } from 'cc';
log(comp.node);
tag: string = '_temp'

绑定的标签,可以通过这个tag 获取 当前的 vm 实例

EventHandler: typeof EventHandler
compName: string
system: null
tid: number = -1

Accessors

  • get __scriptAsset(): null
  • Deprecated

    since v3.5.0, this is an engine private interface that will be removed in the future.

    Returns null

  • get _isOnLoadCalled(): number
  • En

    Returns a value which used to indicate the onLoad get called or not.

    Zh

    返回一个值用来判断 onLoad 是否被调用过,不等于 0 时调用过,等于 0 时未调用。

    Read Only

    Example

    import { log } from 'cc';
    log(this._isOnLoadCalled > 0);

    Deprecated

    since v3.5.0, this is an engine private interface that will be removed in the future.

    Returns number

  • get enabled(): boolean
  • En

    Indicates whether this component is enabled or not.

    Zh

    表示该组件自身是否启用。

    Default

    true

    Example

    import { log } from 'cc';
    comp.enabled = true;
    log(comp.enabled);

    Returns boolean

  • set enabled(value: boolean): void
  • Parameters

    • value: boolean

    Returns void

  • get enabledInHierarchy(): boolean
  • En

    Indicates whether this component is enabled and its node is also active in the hierarchy.

    Zh

    表示该组件是否被启用并且所在的节点也处于激活状态。

    Read Only

    Example

    import { log } from 'cc';
    log(comp.enabledInHierarchy);

    Returns boolean

  • get event(): EventDispatcher
  • 全局事件管理器

    Returns EventDispatcher

  • get hideFlags(): Flags
  • Returns Flags

  • set hideFlags(hideFlags: Flags): void
  • En

    After inheriting CCObject objects, control whether you need to hide, lock, serialize, and other functions.

    Zh

    在继承 CCObject 对象后,控制是否需要隐藏,锁定,序列化等功能。

    Parameters

    • hideFlags: Flags

    Returns void

  • get isValid(): boolean
  • En

    Indicates whether the object is not yet destroyed. (It will not be available after being destroyed)
    When an object's destroy is called, it is actually destroyed after the end of this frame. So isValid will return false from the next frame, while isValid in the current frame will still be true. If you want to determine whether the current frame has called destroy, use isValid(obj, true), but this is often caused by a particular logical requirements, which is not normally required.

    Zh

    表示该对象是否可用(被 destroy 后将不可用)。
    当一个对象的 destroy 调用以后,会在这一帧结束后才真正销毁。
    因此从下一帧开始 isValid 就会返回 false,而当前帧内 isValid 仍然会是 true。
    如果希望判断当前帧是否调用过 destroy,请使用 isValid(obj, true),不过这往往是特殊的业务需求引起的,通常情况下不需要这样。

    Default

    true

    Read Only

    Example

    import { Node, log } from 'cc';
    const node = new Node();
    log(node.isValid); // true
    node.destroy();
    log(node.isValid); // true, still valid in this frame
    // after a frame...
    log(node.isValid); // false, destroyed in the end of last frame

    Returns boolean

  • get name(): string
  • Returns string

  • set name(value: string): void
  • Parameters

    • value: string

    Returns void

  • get uuid(): string
  • En

    The uuid for editor.

    Zh

    组件的 uuid,用于编辑器。

    Read Only

    Example

    import { log } from 'cc';
    log(comp.uuid);

    Returns string

Methods

  • Private

    En

    __preload is called before every onLoad.
    It is used to initialize the builtin components internally,
    to avoid checking whether onLoad is called before every public method calls.
    This method should be removed if script priority is supported.

    Zh

    __preload 在每次onLoad之前调用。
    它用于在内部初始化内置组件,
    以避免在每次公有方法调用之前检查是否调用了onLoad。
    如果支持脚本优先级,则应删除此方法。

    Returns void

  • Deprecated

    since v3.5.0, this is an engine private interface that will be removed in the future.

    Returns void

  • En

    Clear all references in the instance.

    NOTE: this method will not clear the getter or setter functions which defined in the instance of CCObject.

    Zh

    清理实例的所有引用 注意:此方法不会清理实例上的 getter 与 setter 方法。

    Deprecated

    since v3.5.0, this is an engine private interface that will be removed in the future.

    Example

    // You can override the _destruct method if you need, for example:
    _destruct: function () {
    for (var key in this) {
    if (this.hasOwnProperty(key)) {
    switch (typeof this[key]) {
    case 'string':
    this[key] = '';
    break;
    case 'object':
    case 'function':
    this[key] = null;
    break;
    }
    }
    }

    Returns void

  • Private

    En

    If the component's bounding box is different from the node's, you can implement this method to supply a custom axis aligned bounding box (AABB), so the editor's scene view can perform hit test properly.

    Zh

    如果组件的包围盒与节点不同,您可以实现该方法以提供自定义的轴向对齐的包围盒(AABB), 以便编辑器的场景视图可以正确地执行点选测试。

    Parameters

    • out_rect: Rect

      The rect to store the result bounding rect

    Returns void

  • Deprecated

    since v3.5.0, this is an engine private interface that will be removed in the future.

    Returns RenderScene

  • Deprecated

    since v3.5.0, this is an engine private interface that will be removed in the future.

    Parameters

    • Optional cloned: Component

    Returns undefined | Component

  • Deprecated

    since v3.5.0, this is an engine private interface that will be removed in the future.

    Returns void

  • En

    Adds a component class to the node. You can also add component to node by passing in the name of the script.

    Zh

    向节点添加一个指定类型的组件类,你还可以通过传入脚本的名称来添加组件。

    Example

    import { Sprite } from 'cc';
    const sprite = node.addComponent(Sprite);

    Type Parameters

    • T extends Component<T>

    Parameters

    • classConstructor: __types_globals__Constructor<T>

      The class of component to be retrieved or to be created

    Returns null | T

  • En

    Adds a component class to the node. You can also add component to node by passing in the name of the script.

    Zh

    向节点添加一个指定类型的组件类,你还可以通过传入脚本的名称来添加组件。

    Example

    const test = node.addComponent("Test");
    

    Parameters

    • className: string

      A string for the class name of the component

    Returns null | Component

  • Returns boolean

  • 触发全局事件

    Parameters

    • event: string

      事件名

    • args: any = null

      事件参数

    Returns void

  • En

    Returns the component of supplied type if the node has one attached, null if it doesn't.
    You can also get component in the node by passing in the name of the script.

    Zh

    获取节点上指定类型的组件,如果节点有附加指定类型的组件,则返回,如果没有则为空。
    传入参数也可以是脚本的名称。

    Example

    import { Sprite } from 'cc';
    // get sprite component.
    var sprite = node.getComponent(Sprite);

    Type Parameters

    • T extends Component<T>

    Parameters

    • classConstructor: __types_globals__Constructor<T>

      The class of component to be retrieved or to be created

    Returns null | T

  • En

    Returns the component of supplied type if the node has one attached, null if it doesn't.
    You can also get component in the node by passing in the name of the script.

    Zh

    获取节点上指定类型的组件,如果节点有附加指定类型的组件,则返回,如果没有则为空。
    传入参数也可以是脚本的名称。

    Example

    // get custom test calss.
    var test = node.getComponent("Test");

    Parameters

    • className: string

      A string for the class name of the component

    Returns null | Component

  • En

    Returns the component of supplied type in any of its children using depth first search.

    Zh

    递归查找所有子节点中第一个匹配指定类型的组件。

    Example

    import { Sprite } from 'cc';
    const sprite = node.getComponentInChildren(Sprite);

    Type Parameters

    • T extends Component<T>

    Parameters

    • classConstructor: __types_globals__Constructor<T>

      The class of component to be retrieved

    Returns null | T

  • En

    Returns the component of supplied type in any of its children using depth first search.

    Zh

    递归查找所有子节点中第一个匹配指定类型的组件。

    Example

    var Test = node.getComponentInChildren("Test");
    

    Parameters

    • className: string

      A string for the class name of the component

    Returns null | Component

  • En

    Returns all components of supplied type in the node.

    Zh

    返回节点上指定类型的所有组件。

    Example

    import { Sprite } from 'cc';
    const sprites = node.getComponents(Sprite);

    Type Parameters

    • T extends Component<T>

    Parameters

    • classConstructor: __types_globals__Constructor<T>

      The class of components to be retrieved

    Returns T[]

  • En

    Returns all components of supplied type in the node.

    Zh

    返回节点上指定类型的所有组件。

    Example

    const tests = node.getComponents("Test");
    

    Parameters

    • className: string

      A string for the class name of the components

    Returns Component[]

  • En

    Returns all components of supplied type in self or any of its children.

    Zh

    递归查找自身或所有子节点中指定类型的组件。

    Example

    import { Sprite } from 'cc';
    const sprites = node.getComponentsInChildren(Sprite);

    Type Parameters

    • T extends Component<T>

    Parameters

    • classConstructor: __types_globals__Constructor<T>

      The class of components to be retrieved

    Returns T[]

  • En

    Returns all components of supplied type in self or any of its children.

    Zh

    递归查找自身或所有子节点中指定类型的组件。

    Example

    const tests = node.getComponentsInChildren("Test");
    

    Parameters

    • className: string

      A string for the class name of the components

    Returns Component[]

  • 通过节点名获取预制上的节点,整个预制不能有重名节点

    Parameters

    • name: string

    Returns undefined | Node

  • 获取资源

    Type Parameters

    • T extends Asset<T>

    Parameters

    • path: string

      资源路径

    • Optional type: null | __types_globals__Constructor<T>

      资源类型

    • Optional bundleName: string

      远程资源包名

    Returns null | T

  • En

    LateUpdate is called every frame, if the Component is enabled.
    This is a lifecycle method. It may not be implemented in the super class.
    You can only call its super class method inside it. It should not be called manually elsewhere.

    Zh

    如果该组件启用,则每帧调用 LateUpdate。
    该方法为生命周期方法,父类未必会有实现。并且你只能在该方法内部调用父类的实现,不可在其它地方直接调用该方法。

    Parameters

    • dt: number

      the delta time in seconds it took to complete the last frame

    Returns void

  • 加载资源

    Type Parameters

    • T extends Asset<T>

    Parameters

    • bundleName: string
    • paths: string | string[]
    • type: null | AssetType<T>
    • onProgress: null | _cocos_asset_asset_manager_deprecated__LoadProgressCallback
    • onComplete: any

    Returns void

  • Type Parameters

    • T extends Asset<T>

    Parameters

    • bundleName: string
    • paths: string | string[]
    • onProgress: null | _cocos_asset_asset_manager_deprecated__LoadProgressCallback
    • onComplete: any

    Returns void

  • Type Parameters

    • T extends Asset<T>

    Parameters

    • bundleName: string
    • paths: string | string[]
    • Optional onComplete: any

    Returns void

  • Type Parameters

    • T extends Asset<T>

    Parameters

    • bundleName: string
    • paths: string | string[]
    • type: null | AssetType<T>
    • Optional onComplete: any

    Returns void

  • Type Parameters

    • T extends Asset<T>

    Parameters

    • paths: string | string[]
    • type: null | AssetType<T>
    • onProgress: null | _cocos_asset_asset_manager_deprecated__LoadProgressCallback
    • onComplete: any

    Returns void

  • Type Parameters

    • T extends Asset<T>

    Parameters

    • paths: string | string[]
    • onProgress: null | _cocos_asset_asset_manager_deprecated__LoadProgressCallback
    • onComplete: any

    Returns void

  • Type Parameters

    • T extends Asset<T>

    Parameters

    • paths: string | string[]
    • Optional onComplete: any

    Returns void

  • Type Parameters

    • T extends Asset<T>

    Parameters

    • paths: string | string[]
    • type: null | AssetType<T>
    • Optional onComplete: any

    Returns void

  • 异步加载资源

    Type Parameters

    • T extends Asset<T>

    Parameters

    • bundleName: string
    • paths: string | string[]
    • type: null | AssetType<T>
    • onProgress: null | _cocos_asset_asset_manager_deprecated__LoadProgressCallback
    • onComplete: any

    Returns void

  • Type Parameters

    • T extends Asset<T>

    Parameters

    • bundleName: string
    • paths: string | string[]
    • onProgress: null | _cocos_asset_asset_manager_deprecated__LoadProgressCallback
    • onComplete: any

    Returns void

  • Type Parameters

    • T extends Asset<T>

    Parameters

    • bundleName: string
    • paths: string | string[]
    • Optional onComplete: any

    Returns void

  • Type Parameters

    • T extends Asset<T>

    Parameters

    • bundleName: string
    • paths: string | string[]
    • type: null | AssetType<T>
    • Optional onComplete: any

    Returns void

  • Type Parameters

    • T extends Asset<T>

    Parameters

    • paths: string | string[]
    • type: null | AssetType<T>
    • onProgress: null | _cocos_asset_asset_manager_deprecated__LoadProgressCallback
    • onComplete: any

    Returns void

  • Type Parameters

    • T extends Asset<T>

    Parameters

    • paths: string | string[]
    • onProgress: null | _cocos_asset_asset_manager_deprecated__LoadProgressCallback
    • onComplete: any

    Returns void

  • Type Parameters

    • T extends Asset<T>

    Parameters

    • paths: string | string[]
    • Optional onComplete: any

    Returns void

  • Type Parameters

    • T extends Asset<T>

    Parameters

    • paths: string | string[]
    • type: null | AssetType<T>
    • Optional onComplete: any

    Returns void

  • 加载文件名中资源

    Type Parameters

    • T extends Asset<T>

    Parameters

    • bundleName: string
    • dir: string
    • type: null | AssetType<T>
    • onProgress: null | _cocos_asset_asset_manager_deprecated__LoadProgressCallback
    • onComplete: any

    Returns void

  • Type Parameters

    • T extends Asset<T>

    Parameters

    • bundleName: string
    • dir: string
    • onProgress: null | _cocos_asset_asset_manager_deprecated__LoadProgressCallback
    • onComplete: any

    Returns void

  • Type Parameters

    • T extends Asset<T>

    Parameters

    • bundleName: string
    • dir: string
    • Optional onComplete: any

    Returns void

  • Type Parameters

    • T extends Asset<T>

    Parameters

    • bundleName: string
    • dir: string
    • type: null | AssetType<T>
    • Optional onComplete: any

    Returns void

  • Type Parameters

    • T extends Asset<T>

    Parameters

    • dir: string
    • type: null | AssetType<T>
    • onProgress: null | _cocos_asset_asset_manager_deprecated__LoadProgressCallback
    • onComplete: any

    Returns void

  • Type Parameters

    • T extends Asset<T>

    Parameters

    • dir: string
    • onProgress: null | _cocos_asset_asset_manager_deprecated__LoadProgressCallback
    • onComplete: any

    Returns void

  • Type Parameters

    • T extends Asset<T>

    Parameters

    • dir: string
    • Optional onComplete: any

    Returns void

  • Type Parameters

    • T extends Asset<T>

    Parameters

    • dir: string
    • type: null | AssetType<T>
    • Optional onComplete: any

    Returns void

  • 平摊所有节点存到Map<string, Node>中通过get(name: string)方法获取

    Returns void

  • 移除全局事件

    Parameters

    • event: string

      事件名

    Returns void

  • 注册全局事件

    Parameters

    • event: string

      事件名

    • listener: ListenerFunc

      处理事件的侦听器函数

    • object: any

      侦听函数绑定的this对象

    Returns void

  • 在 onLoad 完成 和 start() 之前调用,你可以在这里进行初始化数据等操作

    Returns void

  • [注意]不能覆盖此方法,如果需要覆盖。 需要在该方法内部调用父类的实现,再定义自己的方法

      onDestroy(){
    super.onDestroy();
    }

    Returns void

  • En

    Called when this component becomes disabled or its node becomes inactive.
    This is a lifecycle method. It may not be implemented in the super class. You can only call its super class method inside it. It should not be called manually elsewhere.

    Zh

    当该组件被禁用或节点变为无效时调用。
    该方法为生命周期方法,父类未必会有实现。并且你只能在该方法内部调用父类的实现,不可在其它地方直接调用该方法。

    Returns void

  • En

    Called when this component becomes enabled and its node is active.
    This is a lifecycle method. It may not be implemented in the super class. You can only call its super class method inside it. It should not be called manually elsewhere.

    Zh

    当该组件被启用,并且它的节点也激活时。
    该方法为生命周期方法,父类未必会有实现。并且你只能在该方法内部调用父类的实现,不可在其它地方直接调用该方法。

    Returns void

  • Returns void

  • 游戏全屏事件回调

    Returns void

  • 游戏切到后台事件回调

    Returns void

  • 游戏旋转屏幕事件回调

    Returns void

  • 游戏画笔尺寸变化事件回调

    Returns void

  • 游戏从后台进入事件回调

    Returns void

  • 键按下

    Parameters

    • event: EventKeyboard

    Returns void

  • 键长按

    Parameters

    • event: EventKeyboard

    Returns void

  • 键放开

    Parameters

    • event: EventKeyboard

    Returns void

  • [注意]不能直接覆盖此方法,如果需要覆盖。 只能在该方法内部调用父类的实现

        onLoad(){
    super.onLoad();
    }

    Returns void

  • Returns void

  • En

    onRestore is called after the user clicks the Reset item in the Inspector's context menu or performs an undo operation on this component.

    If the component contains the "internal state", short for "temporary member variables which not included
    in its CCClass properties", then you may need to implement this function.

    The editor will call the getset accessors of your component to record/restore the component's state
    for undo/redo operation. However, in extreme cases, it may not works well. Then you should implement
    this function to manually synchronize your component's "internal states" with its public properties.
    Once you implement this function, all the getset accessors of your component will not be called when
    the user performs an undo/redo operation. Which means that only the properties with default value
    will be recorded or restored by editor.

    Similarly, the editor may failed to reset your component correctly in extreme cases. Then if you need
    to support the reset menu, you should manually synchronize your component's "internal states" with its
    properties in this function. Once you implement this function, all the getset accessors of your component
    will not be called during reset operation. Which means that only the properties with default value
    will be reset by editor.

    This function is only called in editor mode.

    Zh

    onRestore 是用户在检查器菜单点击 Reset 时,对此组件执行撤消操作后调用的。

    如果组件包含了“内部状态”(不在 CCClass 属性中定义的临时成员变量),那么你可能需要实现该方法。

    编辑器执行撤销/重做操作时,将调用组件的 get set 来录制和还原组件的状态。 然而,在极端的情况下,它可能无法良好运作。
    那么你就应该实现这个方法,手动根据组件的属性同步“内部状态”。 一旦你实现这个方法,当用户撤销或重做时,组件的所有 get set 都不会再被调用。 这意味着仅仅指定了默认值的属性将被编辑器记录和还原。

    同样的,编辑可能无法在极端情况下正确地重置您的组件。
    于是如果你需要支持组件重置菜单,你需要在该方法中手工同步组件属性到“内部状态”。
    一旦你实现这个方法,组件的所有 get set 都不会在重置操作时被调用。 这意味着仅仅指定了默认值的属性将被编辑器重置。
    此方法仅在编辑器下会被调用。

    Returns void

  • 在 onDestroy() 后调用,此时仍然可以获取绑定的 data 数据

    Returns void

  • 播放音效

    Parameters

    • url: string

      资源地址

    Returns void

  • 播放背景音乐

    Parameters

    • url: string

      资源地址

    Returns void

  • 循环播放背景音乐

    Parameters

    • url: string

      资源地址

    Returns void

  • 释放一个资源

    Returns void

  • 释放音效资源

    Returns void

  • 释放一个文件夹的资源

    Returns void

  • Returns void

  • En

    Called to initialize the component or node’s properties when adding the component the first time or when the Reset command is used. This function is only called in editor.

    Zh

    用来初始化组件或节点的一些属性,当该组件被第一次添加到节点上或用户点击了它的 Reset 菜单时调用。这个回调只会在编辑器下调用。

    Parameters

    • Optional didResetToDefault: boolean

    Returns void

  • En

    Use Scheduler system to schedule a custom task.
    If the task is already scheduled, then the interval parameter will be updated without scheduling it again.

    Zh

    使用定时器系统调度一个自定义的回调任务。
    如果回调任务已调度,那么将不会重复调度它,只会更新时间间隔参数。

    Example

    import { log } from 'cc';
    this.schedule((dt) => void log(`time: ${dt}`), 1);

    Parameters

    • callback: any

      The callback function of the task

    • Optional interval: number

      The time interval between each invocation

    • Optional repeat: number

      The repeat count of this task, the task will be invoked (repeat + 1) times, use macro.REPEAT_FOREVER to repeat a task forever

    • Optional delay: number

      The delay time for the first invocation, Unit: s

    Returns void

  • En

    Use Scheduler system to schedule a task that runs only once, with a delay of 0 or larger.

    Zh

    使用定时器系统调度一个只运行一次的回调任务,可以指定 0 让回调函数在下一帧立即执行或者在一定的延时之后执行。

    Method

    scheduleOnce

    See

    schedule

    Example

    import { log } from 'cc';
    this.scheduleOnce((dt) => void log(`time: ${dt}`), 2);

    Parameters

    • callback: any

      The callback function of the task

    • Optional delay: number

      The delay time for the first invocation, Unit: s

    Returns void

  • 批量设置当前界面按钮事件

    Example

    按钮节点Label1Label2必须绑定UIButton等类型的按钮组件才会生效方法名必须与节点名一致
    this.setButton();

    Label1(event: EventTouch) { console.log(event.target.name); }
    Label2(event: EventTouch) { console.log(event.target.name); }

    Returns void

  • 批量设置全局事件

    Example

    this.setEvent("onGlobal");
    this.dispatchEvent("onGlobal", "全局事件");

    onGlobal(event: string, args: any) { console.log(args) };

    Parameters

    • Rest ...args: string[]

    Returns void

  • Parameters

    • args: string[]

    Returns void

  • 监听游戏全屏事件

    Returns void

  • 监听游戏切到后台事件

    Returns void

  • 监听游戏旋转屏幕事件

    Returns void

  • 监听游戏画笔尺寸变化事件

    Returns void

  • 监听游戏从后台进入事件

    Returns void

  • 键盘事件开关

    Parameters

    • on: boolean

      打开键盘事件为true

    Returns void

  • En

    Called before all scripts' update if the Component is enabled the first time.
    Usually used to initialize some logic which need to be called after all components' onload methods called.
    This is a lifecycle method. It may not be implemented in the super class.
    You can only call its super class method inside it. It should not be called manually elsewhere.

    Zh

    如果该组件第一次启用,则在所有组件的 update 之前调用。通常用于需要在所有组件的 onLoad 初始化完毕后执行的逻辑。
    该方法为生命周期方法,父类未必会有实现。并且你只能在该方法内部调用父类的实现,不可在其它地方直接调用该方法。

    Returns void

  • En

    Un-schedules a custom task.

    Zh

    取消调度一个自定义的回调任务。

    Example

    this.unschedule(_callback);
    

    Parameters

    • callback_fn: any

      The callback function of the task

    Returns void

  • En

    unschedule all scheduled tasks.

    Zh

    取消调度所有已调度的回调函数。

    Example

    this.unscheduleAllCallbacks();
    

    Returns void

  • En

    Update is called every frame, if the Component is enabled.
    This is a lifecycle method. It may not be implemented in the super class.
    You can only call its super class method inside it. It should not be called manually elsewhere.

    Zh

    如果该组件启用,则每帧调用 update。
    该方法为生命周期方法,父类未必会有实现。并且你只能在该方法内部调用父类的实现,不可在其它地方直接调用该方法。

    Parameters

    • dt: number

      the delta time in seconds it took to complete the last frame

    Returns void

  • Returns void

Generated using TypeDoc