mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-09-27 02:36:14 +00:00
update
This commit is contained in:
27
JisolGameCocos/assets/script/battle/base/role/GRoleBase.ts
Normal file
27
JisolGameCocos/assets/script/battle/base/role/GRoleBase.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
import { _decorator, sp } from "cc";
|
||||
import { JNGSyncProtoBase } from "../../../App";
|
||||
import GObject from "../GObject";
|
||||
import { BehaviorStatus } from "../../../../../extensions/Behavior Creator/runtime/main";
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
//角色基类
|
||||
export default abstract class GRoleBase<T> extends GObject<T>{
|
||||
|
||||
@property(sp.Skeleton)
|
||||
spine:sp.Skeleton;
|
||||
|
||||
onLoad(){
|
||||
super.onLoad();
|
||||
if(!this.spine) this.spine = this.node.getComponent(sp.Skeleton);
|
||||
|
||||
//如果没有生成则直接销毁
|
||||
this.node.removeFromParent();
|
||||
}
|
||||
|
||||
//攻击
|
||||
public onAttack(data){
|
||||
return BehaviorStatus.Success;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "15e9145c-4eb8-485d-99eb-6d709b3991e7",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
9
JisolGameCocos/assets/script/battle/base/role/impl.meta
Normal file
9
JisolGameCocos/assets/script/battle/base/role/impl.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "1.2.0",
|
||||
"importer": "directory",
|
||||
"imported": true,
|
||||
"uuid": "b2af28db-e925-419f-81b8-3bf755a3224f",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
@@ -0,0 +1,16 @@
|
||||
import { _decorator } from "cc";
|
||||
import GRoleBase from "../GRoleBase";
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
/**
|
||||
* 基础实现
|
||||
*/
|
||||
@ccclass('GRoleEntity')
|
||||
export default class GRoleEntity extends GRoleBase<{}> {
|
||||
|
||||
onLoad(){
|
||||
super.onLoad();
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "c6d20914-49fe-45ea-9bf2-750de7cc7ed2",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
Reference in New Issue
Block a user