Selaa lähdekoodia

a_bullet_many_animation

0224995 2 viikkoa sitten
vanhempi
commit
fc2a1c2f7a

+ 0 - 4
assets/Script/Game/MyApp/GameScene/Bullet.ts

@@ -37,8 +37,6 @@ export class Bullet extends Component {
 
     protected onLoad(): void {
         this._animation = this.node.addComponent(Animation);
-        this._createClip(BulletState.Normal, [], 10);
-        this._createClip(BulletState.Explode, [], 10);
     }
     start() {
         this._initPos = this.node.position.clone();
@@ -66,7 +64,6 @@ export class Bullet extends Component {
         this.isExplode = false;
         this.bulletSpeed = this._isEnemyBullet ? 100 : 90;
         this._initPos = this.node.position.clone();
-        this._collectAni();
         this._playAnimation(BulletState.Normal);
         //重置位置和动画
         this.node.active = true;
@@ -82,7 +79,6 @@ export class Bullet extends Component {
             //回收到对象池
             this._pool.recycle(this.node, this._isEnemyBullet);
         } else {
-            console.log("destroy");
             this.node.destroy();
         }
     }

+ 0 - 1
assets/Script/Game/MyApp/GameScene/MyRole.ts

@@ -3,7 +3,6 @@ import { Role, RoleState } from '../Role';
 import { RoleData } from '../../../DataItem/ItemData';
 import { LifeBar } from './LifeBar';
 import { Enemy } from './Enemy';
-import { MyTower } from './MyTower';
 import { EnemyTower } from './EnemyTower';
 const { ccclass, property } = _decorator;
 

+ 6 - 8
assets/Script/Game/MyApp/Role.ts

@@ -107,12 +107,12 @@ export class Role extends Component {
         this.moveSpeed = roleData.moveSpeed;
     }
 
-    _setupPhysics() {
-        //确保有碰撞组件
-        const collider2D = this.getComponent(BoxCollider2D) || this.addComponent(BoxCollider2D);
-        collider2D.group = this._getCollisionGroup();
-        collider2D.apply();
-    }
+    // _setupPhysics() {
+    //     //确保有碰撞组件
+    //     const collider2D = this.getComponent(BoxCollider2D) || this.addComponent(BoxCollider2D);
+    //     collider2D.group = this._getCollisionGroup();
+    //     collider2D.apply();
+    // }
 
     //获取精灵帧组 
     /*
@@ -292,7 +292,6 @@ export class Role extends Component {
         } else {
             this._switchState(state, clipName);
         }
-
     }
 
     private _switchState(state: RoleState, clipName: string) {
@@ -323,7 +322,6 @@ export class Role extends Component {
             targetNode: this.currentTarget.node,
             atk: this.atk,
         })
-        console.log(this._bullet.getComponent(Animation))
     }
 
     //要求子类实现的碰撞分组和阵营判断方法,确保不同阵营角色可以正确交互

+ 0 - 53
assets/Script/Game/MyApp/TouchCharacterSlot-001.ts

@@ -1,53 +0,0 @@
-import { _decorator, find, Label, math, Node, Rect, UITransform } from 'cc';
-import { TouchMgr } from './TouchMgr';
-import { CharacterSlotMgr } from './CharacterSlotMgr';
-import { UIMgr } from '../../Frames/UIManager';
-import { PopupUI } from '../UI/PopupUI';
-import { UIType } from '../GameFrameWork/UIBase';
-import { PopupUIDataConfig } from './GameScene/Data/PopupUIDataConfig';
-const { ccclass, property } = _decorator;
-
-@ccclass('TouchCharacterSlot')
-export class TouchCharacterSlot extends TouchMgr {
-    private _characterSlot: Node = null;
-    private unLock: Node = null;
-    protected onLoad(): void {
-        this._characterSlot = this.node.parent.getChildByName("CharacterSlot");
-    }
-    func(pos: math.Vec2): void {
-        this.node.parent.getChildByName("CharacterSlot").getComponent(CharacterSlotMgr).removeCardImg(pos);
-        for (const node of this._characterSlot.children) {
-            if (node.getChildByName("Label").active) {
-                const box: Rect = node.getComponent(UITransform).getBoundingBoxToWorld();
-                if (box.contains(pos)) {
-                    this.unLock = node;
-                    PopupUIDataConfig.Instance.setUIName("解锁");
-                    PopupUIDataConfig.Instance.setTypeImg("Lock");
-                    PopupUIDataConfig.Instance.setTypeMoney("Gold");
-                    PopupUIDataConfig.Instance.setLabel(
-                        `可用卡槽:${PopupUIDataConfig.Instance.getAvailableCardSlot()}`,
-                        `下一级:${PopupUIDataConfig.Instance.getAvailableCardSlot() + 1}`,
-                        `耗费:`, `2000`);
-                    PopupUIDataConfig.Instance.setFunction(() => {
-                        this.closeNode();
-                    })
-                    UIMgr.openUI("PopupUI", UIType.WIDGET);
-                }
-            }
-        }
-    }
-
-    closeNode() {
-        if (this.unLock) {
-            this.unLock.getChildByName("Lock").active = false;
-            this.unLock.getChildByName("Label").active = false;
-            PopupUIDataConfig.Instance.setAvailableCardSlot(PopupUIDataConfig.Instance.getAvailableCardSlot() + 1)
-
-            const indexNext: number = this.unLock.getSiblingIndex();
-            if (indexNext === this.unLock.parent.children.length - 1) return;
-            const nodeNext = this.unLock.parent.children[indexNext + 1];
-            nodeNext.getChildByName("Lock").active = true;
-            nodeNext.getChildByName("Label").active = true;
-        }
-    }
-}

+ 0 - 1
assets/Script/Game/MyApp/TouchCharacterSlot-001.ts.meta

@@ -1 +0,0 @@
-{"ver":"4.0.23","importer":"typescript","imported":true,"uuid":"3c3e5f8c-dd29-4fac-9be3-7ba10181ff56","files":[],"subMetas":{},"userData":{}}