Commit 3aa52172 authored by Vũ Gia Vương's avatar Vũ Gia Vương

add fog in jar

parent 8e2c8cf7
This diff is collapsed.
......@@ -13,6 +13,12 @@ export default class BreakingJarController extends cc.Component {
private hammerNode: cc.Node = null;
@property(cc.Node)
private behindJar: cc.Node = null;
@property(cc.ParticleSystem)
private particleFont: cc.ParticleSystem = null;
@property(cc.ParticleSystem)
private particleBehind: cc.ParticleSystem = null;
@property(cc.Node)
private mask: cc.Node = null;
private _spine: sp.Skeleton = null;
private _skins = ["Ga", "Gai_lung", "Gay", "Bua",];
......@@ -46,6 +52,10 @@ export default class BreakingJarController extends cc.Component {
this._fragmentsPosition = this._fontFragments.map(item => item.position.clone());
this._behindJarChild = this.behindJar.children.map(item => item.getComponent(BehindFragment));
this._behindJarChildPosition = this.behindJar.children.map(item => item.position.clone());
this.particleFont.enabled = false;
this.particleBehind.enabled = false;
this.mask.active = false;
}
private beatGuild() {
......@@ -100,7 +110,7 @@ export default class BreakingJarController extends cc.Component {
private checkFragment(fragmentNode: cc.Node) {
const fontFragment = this._fontFragments.findIndex(item => item === fragmentNode);
const behindFragment = this._behindJarChild[fontFragment];
behindFragment.onDrop();
// behindFragment.onDrop();
if (this._isEnd) {
return;
......@@ -120,28 +130,10 @@ export default class BreakingJarController extends cc.Component {
const isDropTop = this.fragmentSpecialNodes.every(item => item.getComponent(FragmentJarController).isDropped);
if (isSpecial && isDropTop) {
console.log('this._countFragment', this._countFragment)
eventTarget.emit(DROP_TOP_FRAGMENT);
}
}
// private checkFragment(name: string) {
// if (this._isEnd) {
// return;
// }
// if (!name.includes('nap')) {
// this._bodyFragments.push(name);
// }
// this._countFragment++;
// if (this._countFragment == 8) {
// this.scheduleOnce(() => eventTarget.emit(SHOW_CARD_POPUP), 1.5);
// this._isEnd = true;
// }
// if (this._bodyFragments.length == 6) {
// eventTarget.emit(DROP_FRAGMENT);
// }
// }
private onTouchStart(event: cc.Event.EventTouch) {
eventTarget.emit(STOP_GUILD_TAP);
const pos = event.getLocation();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment