日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

白鹭龙骨异步加载

發布時間:2023/12/2 编程问答 46 豆豆
生活随笔 收集整理的這篇文章主要介紹了 白鹭龙骨异步加载 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

private armatureDisplay: dragonBones.EgretArmatureDisplay;
/**
* 加載龍骨動畫
* Create scene interface
*/
private loadGragon(): void {
let t = this;
t.removeGragon();
//默認男戰士
let sex = t.occupationSex.selectedValue ? t.occupationSex.selectedValue : 1;
let url1 = `resource/assets/gameui2/dragon/${sex == 1 ? "nan" : "nv"}zhanshi_ske.json`;
let url2 = `resource/assets/gameui2/dragon/${sex == 1 ? "nan" : "nv"}zhanshi_tex.json`;
let url3 = `resource/assets/gameui2/dragon/${sex == 1 ? "nan" : "nv"}zhanshi_tex.png`;
RES.getResByUrl(url1, t.createGragon, t, RES.NOCache);
RES.getResByUrl(url2, t.createGragon, t, RES.NOCache);
RES.getResByUrl(url3, t.createGragon, t, RES.NOCache);

}
dragonbonesData;
textureData;
texture;
temp = 0;
/**
* 創建龍骨動畫
* Create scene interface
*/
private createGragon(data, url): void {
let t = this;
if (data.frameRate) {
t.dragonbonesData = data;
} else if (data.SubTexture) {
t.textureData = data;
} else if (data.bitmapData) {
t.texture = data;
}
if (t.temp == 0) {
t.temp++;
} else if (t.temp == 1) {
t.temp++;
} else if (t.temp == 2 && t.texture && t.textureData && t.dragonbonesData) {
t.temp = 0;
let egretFactory: dragonBones.EgretFactory = dragonBones.EgretFactory.factory;
if (!t.dragonbonesData) return;
egretFactory.parseDragonBonesData(t.dragonbonesData);
egretFactory.parseTextureAtlasData(t.textureData, t.texture);
let sex = t.occupationSex.selectedValue ? t.occupationSex.selectedValue : 1;
t.armatureDisplay = sex == 1 ? egretFactory.buildArmatureDisplay("armatureName") : egretFactory.buildArmatureDisplay("nvzhanshi");

t.armatureDisplay.x = sex == 1 ? 550 : 580;
t.armatureDisplay.y = sex == 1 ? 480 : 280;
t.armatureDisplay.scaleX = 0.5;
t.armatureDisplay.scaleY = 0.5;
t.armatureDisplay.animation.play("animation", 0);
t.mainGro.addChildAt(t.armatureDisplay, 2);
}
}

private removeGragon(): void {
let t = this;
if (t.armatureDisplay) {
t.armatureDisplay.animation.stop();
t.armatureDisplay.dispose();
t.armatureDisplay.removeSelf();
t.armatureDisplay = null;
}
}

/**適用類似創角界面這種用一次龍骨的界面,經常使用的,不用這么麻煩,直接按官網的教程做就行**/

轉載于:https://www.cnblogs.com/jiajunjie/p/10922142.html

總結

以上是生活随笔為你收集整理的白鹭龙骨异步加载的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。