This commit is contained in:
2024-05-01 19:13:01 +08:00
parent cf008327aa
commit 80a32d9b1b
150 changed files with 8561 additions and 5045 deletions

View File

@@ -1,31 +1,37 @@
import { _decorator, Component, Tween, tween } from 'cc'
const { ccclass, property } = _decorator
import { Component, Tween, _decorator, tween } from 'cc'
import { FishInfo } from '../../script/game/config/FishInfo'
import { FishPathInfo } from '../../script/game/config/FishPathInfo'
import FishManager from '../../script/game/manager/FishManager'
import { FishInfo } from '../../script/game/config/FishInfo'
import WsManager from '../../script/game/manager/WsManager'
const { ccclass, property } = _decorator
@ccclass('FishBase')
export default class FishBase extends Component {
public fishInfo: FishInfo
public fishType: number = 1
public blood: number = 1
public fishPathInfo: FishPathInfo
public isDead: boolean
onLoad() {}
start() {}
public playDeadMv() {
this.isDead = true
this.scheduleOnce(() => {
FishManager.instance.killFish(this)
}, 1.5)
tween(this.node)
.repeatForever(tween().by(0.6, { angle: -360 }))
.start()
}
onDisable() {
//this.node.stopAllActions();
Tween.stopAllByTarget(this.node)
this.unscheduleAllCallbacks()
}
public fishInfo: FishInfo
public fishType: number = 1
public fishId: string = ''
public fishPathInfo: FishPathInfo
public isDead: number = 2
onLoad() {}
start() {}
// 播放死亡动画
public playDeadMv(res: any) {
this.isDead = 1
this.scheduleOnce(() => {
FishManager.instance.killFish(res)
}, 1)
tween(this.node)
.repeatForever(tween().by(0.6, { angle: -360 }))
.start()
}
onDisable() {
Tween.stopAllByTarget(this.node)
this.unscheduleAllCallbacks()
}
}