Commit d07baf53 authored by zjz1994's avatar zjz1994

调整大炮,转盘手指的资源加载

parent f9995ad1
......@@ -1055,6 +1055,17 @@ export default class MainScene extends Scene {
});
var dirType = Tool.getCannoDir(elements[i]);
canno.resetToCannoView(dirType,this);
//添加大炮
if(cannomvdata){
canno.createCanno(cannomvdata);
}else{
if (!svgaParser) svgaParser = new window["SVGA"].Parser();
svgaParser.load(resPath + 'resource/assets/svgas/canno1.svga',(videoItem)=>{
cannomvdata = videoItem;
canno.createCanno(cannomvdata);
})
}
break;
case ElementConfigType.CANNO_BLOCK:
let canno_block:Element = Tool.getElement(ElementType.CANNO_BLOCK);
......
......@@ -56,6 +56,9 @@ export default class Turntable extends Panel {
this['nums'].text = `我的元宝:${getHomeData().wealth}`;
this['btnLabel'].text = "";
this.initUI();
if(handmoveclip&&handmoveclip.parent){
handmoveclip.parent.removeChild(handmoveclip);
}
}
public async onShowAnim(){
let targetY:number;
......@@ -320,6 +323,7 @@ export default class Turntable extends Panel {
var whandy = this["start_btn"].parent.localToGlobal(0,startpy).y;
var handy = this['container2'].globalToLocal(0,whandy).y-1334/2;
this['container2'].addChild(handmoveclip);
handmoveclip.gotoAndPlay(1);
handmoveclip.y = handy;
}
}
......
......@@ -509,26 +509,25 @@ export class Element extends eui.Component {
}
this.addChild(this.festivalEle)
}
this.createCanno();
}
//添加炮台
createCanno(){
if(this.type==ElementType.CANNO){
createCanno(videoItem:any){
if(this.type==ElementType.CANNO&&videoItem){
if(this.cannoMoveClip){
if(this.cannoMoveClip.parent){
this.cannoMoveClip.parent.removeChild(this.cannoMoveClip);
}
this.initCannoMoveClidp();
return;
}
if (!svgaParser) svgaParser = new window["SVGA"].Parser();
var svgas = ["canno1"]
for(let i=0;i<svgas.length;i++){
let mvname = svgas[i];
svgaParser.load(resPath + 'resource/assets/svgas/'+mvname+'.svga',(videoItem)=>{
if(mvname=="canno1"){
else{
this.cannoMoveClip = new window["SVGA"].EgretMovieClip(videoItem);
// this.cannoMoveClip.lockStep = true;
this.initCannoMoveClidp();
}
}
}
initCannoMoveClidp(){
var mvwidth = 82;
var mvheight = 132;
this.cannoMoveClip.x = (this.cannoboxwid-mvwidth)/2;
......@@ -537,10 +536,6 @@ export class Element extends eui.Component {
this.cannoMoveClip.gotoAndStop(1);
this.cannoMoveClip.addEventListener(egret.Event.ENTER_FRAME,this.toFrameAni,this);
}
});
}
}
}
stopFrame:number;
/**
* 炮台动画停止
......
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