Files
oops-plugin-framework/assets/module/common/CCComp.ts

31 lines
1004 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/*
* @Author: dgflash
* @Date: 2021-11-11 19:05:32
* @LastEditors: dgflash
* @LastEditTime: 2022-08-05 10:31:47
*/
import { _decorator } from 'cc';
import { GameComponent } from '../../core/game/GameComponent';
import { ecs } from '../../libs/ecs/ECS';
const { ccclass, property } = _decorator;
/**
* ECS结合Cocos Creator组件
* 使用方法:
* 1、对象拥有Cocos引擎组件功能、ECS 组件全局访问功能
* 2、网络游戏优先有数据对象在才创建视图组件的流程在释放视图组件时不释放数据对象
* 3、对象自带监听、释放、发送全局消息功能
* 4、对象管理的所有节点摊平直接通过节点名获取cc.Node对象节点名不能有重名
*/
@ccclass('CCComp')
export abstract class CCComp extends GameComponent implements ecs.IComp {
static tid: number = -1;
static compName: string;
canRecycle!: boolean;
ent!: ecs.Entity;
abstract reset(): void;
}