mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-09-27 02:36:14 +00:00
基础的数值计算
This commit is contained in:
@@ -8,7 +8,9 @@ import { Vec2 } from "cc";
|
||||
export default class GDetection{
|
||||
|
||||
//检测角色
|
||||
static testAABBRole(rect:math.Rect):GRoleBase<{}>[]{
|
||||
static testAABBCenterRole(rect:math.Rect):GRoleBase<{}>[]{
|
||||
rect.x -= rect.width / 2;
|
||||
rect.y -= rect.height / 2;
|
||||
//@ts-ignore
|
||||
return PhysicsSystem2D.instance.testAABB(rect).map(item => item.getComponent(GRoleBase<any>));
|
||||
}
|
||||
|
@@ -0,0 +1,13 @@
|
||||
import GRoleBase from "../role/GRoleBase";
|
||||
import GRoleDefault from "../role/GRoleDefault";
|
||||
import { GRoleAttackType } from "../values/GRoleValues";
|
||||
|
||||
//宠物攻击 工具类
|
||||
export default class GRoleAttack{
|
||||
|
||||
//普通攻击
|
||||
static onNormalAttack(attack:GRoleBase<{}>,hit:GRoleBase<{}>){
|
||||
hit.onHit(GRoleAttackType.NormalAttack,attack.values.onAttack(GRoleAttackType.NormalAttack),attack);
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "d4ea04bc-bcfc-45ce-9753-126ac88604d1",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
@@ -48,7 +48,7 @@ export default class GSpine{
|
||||
}
|
||||
|
||||
// 创建一个 Spine 并且 播放 销毁
|
||||
static onPlaySceneSpine(scene:GBaseMode<{}>,pos:Vec2,spine:sp.SkeletonData,play:string):JNSkeleton{
|
||||
static onPlaySceneSpine(scene:GBaseMode<{},{}>,pos:Vec2,spine:sp.SkeletonData,play:string):JNSkeleton{
|
||||
|
||||
let create = this.onCreateSpine(spine);
|
||||
scene.addGNode(create.node,pos);
|
||||
|
Reference in New Issue
Block a user