Commit 44a8fae4 authored by Tt's avatar Tt

轻量化

parent bc5021ab
{
"ver": "1.1.2",
"uuid": "de2b72f4-ce2e-45c4-b1ba-a6c42bd3a08f",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
[
{
"__type__": "cc.Prefab",
"_name": "",
"_objFlags": 0,
"_native": "",
"data": {
"__id__": 1
},
"optimizationPolicy": 0,
"asyncLoadAssets": false,
"readonly": false
},
{
"__type__": "cc.Node",
"_name": "boy",
"_objFlags": 0,
"_parent": null,
"_children": [
{
"__id__": 2
}
],
"_active": false,
"_components": [
{
"__id__": 5
},
{
"__id__": 6
}
],
"_prefab": {
"__id__": 7
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 715,
"height": 943
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
1500,
-440,
0,
0,
0,
0,
1,
0.65,
0.65,
0.5
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": ""
},
{
"__type__": "cc.Node",
"_name": "aniNode",
"_objFlags": 0,
"_parent": {
"__id__": 1
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 3
}
],
"_prefab": {
"__id__": 4
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 538,
"height": 936.76
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
503,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": ""
},
{
"__type__": "dragonBones.ArmatureDisplay",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_armatureName": "Armature",
"_animationName": "normal",
"_preCacheMode": 0,
"_cacheMode": 0,
"playTimes": -1,
"premultipliedAlpha": false,
"_armatureKey": "811e7afe-8349-4a42-a602-4a7540f79dd6#bf6f8b1d-2589-4076-8421-198d1fbeb965",
"_accTime": 0,
"_playCount": 0,
"_frameCache": null,
"_curFrame": null,
"_playing": false,
"_armatureCache": null,
"_N$dragonAsset": {
"__uuid__": "811e7afe-8349-4a42-a602-4a7540f79dd6"
},
"_N$dragonAtlasAsset": {
"__uuid__": "bf6f8b1d-2589-4076-8421-198d1fbeb965"
},
"_N$_defaultArmatureIndex": 0,
"_N$_animationIndex": 0,
"_N$_defaultCacheMode": 0,
"_N$timeScale": 1,
"_N$debugBones": false,
"_N$enableBatch": false,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__uuid__": "0e9534b6-93d0-45ba-adc2-2a9e889eda0e"
},
"fileId": "27gh7VpBtEULSudnmmLQrx",
"sync": false
},
{
"__type__": "98ebf1Ee7ZABZa1hNEDXEVB",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
},
"_enabled": true,
"aniBody": {
"__id__": 2
},
"_id": ""
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 4,
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 100,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__uuid__": "0e9534b6-93d0-45ba-adc2-2a9e889eda0e"
},
"fileId": "",
"sync": false
}
]
\ No newline at end of file
{
"ver": "1.2.9",
"uuid": "0e9534b6-93d0-45ba-adc2-2a9e889eda0e",
"optimizationPolicy": "AUTO",
"asyncLoadAssets": false,
"readonly": false,
"subMetas": {}
}
\ No newline at end of file
This diff is collapsed.
{
"ver": "1.2.9",
"uuid": "59020958-4b5a-4ef6-8895-b69d08f422a8",
"optimizationPolicy": "AUTO",
"asyncLoadAssets": false,
"readonly": false,
"subMetas": {}
}
\ No newline at end of file
......@@ -8040,8 +8040,6 @@
"__id__": 2
},
"_enabled": true,
"qustionLayer": null,
"boyNode": null,
"btn_next": null,
"qustionLayerRoot": {
"__id__": 8
......
......@@ -9,11 +9,11 @@ const { ccclass, property } = cc._decorator;
@ccclass
export default class SceneComponent extends MyCocosSceneComponent {
@property(cc.Node)
qustionLayer: cc.Node = null;
// @property(cc.Node)
// qustionLayer: cc.Node = null;
@property(cc.Node)
boyNode: cc.Node = null;
// @property(cc.Node)
// boyNode: cc.Node = null;
@property(cc.Node)
btn_next: cc.Node = null;
......@@ -59,7 +59,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
@property(dg29_museum_game) root_game: dg29_museum_game;
@property(dg29_museum_game) root_game: dg29_museum_game = null;
async onLoadEnd() {
// TODO 加载完成后的逻辑写在这里, 下面的代码仅供参考
this.initData();
......@@ -85,7 +85,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
tryPlayVideo() {
cc.log("touch layer--")
cc.log("touch layer--")
if (this.prepared) {
this.prepared = false;
this.vplayer.volume = 0;
......@@ -123,8 +123,6 @@ export default class SceneComponent extends MyCocosSceneComponent {
this.vplayer.node.scale = 1;
this.vplayer.currentTime = 0;
this.vplayer.play();
await asyncDelay(0.1);
this.boyNode.active = false;
}
playLocalAudio(audioName) {
......@@ -165,7 +163,6 @@ export default class SceneComponent extends MyCocosSceneComponent {
this.videoCtrl.active = false;
this.node.getChildByName("bg").active = true;
cc.log("video completed");
this.boyNode.active = true;
this.vplayer.node.active = false;
pg.event.emit('play_video_end')
......
// Learn TypeScript:
// - https://docs.cocos.com/creator/manual/en/scripting/typescript.html
// Learn Attribute:
// - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
// - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
import { asyncPlayDragonBoneAnimation } from "../util_DG16";
const { ccclass, property } = cc._decorator;
@ccclass
export default class Boy extends cc.Component {
@property(cc.Node)
aniBody: cc.Node
aniNameList = ["run", "good", "cheer", "expect", "talk", "invite", "wave", "point"]
log(str) {
const node = cc.find('middleLayer');
if (node) {
node.getComponent('middleLayer').log(str);
} else {
console.log(str);
}
}
protected onLoad(): void {
// let index = 0;
// this.schedule(() => {
// index = index % this.aniNameList.length;
// asyncPlayDragonBoneAnimation(this.aniBody, this.aniNameList[index], 1);
// cc.log("play ani name :" + this.aniNameList[index]);
// index++;
// }, 3, 10000, 5)
// this.aniBody.getComponent(dragonBones.ArmatureDisplay)
}
playNormal() {
this.log("play ani name : normal");
asyncPlayDragonBoneAnimation(this.aniBody, "normal", -1,)
}
async playRun(time: number = 1) {
this.log("play ani name : run");
await asyncPlayDragonBoneAnimation(this.aniBody, "run", time);
this.playNormal();
}
async playCheer(time: number = 1) {
let localTime = time;
this.log("play ani name : cheer");
await asyncPlayDragonBoneAnimation(this.aniBody, "cheer", time);
this.playNormal();
}
async playExpect(time: number = 1) {
let localTime = time;
this.log("play ani name : expect");
await asyncPlayDragonBoneAnimation(this.aniBody, "expect", time);
this.playNormal();
}
async playtalk(time: number = 1) {
let localTime = time;
this.log("play ani name : talk");
await asyncPlayDragonBoneAnimation(this.aniBody, "talk", time,)
this.playNormal();
}
async playGood(time: number = 1) {
let localTime = time;
this.log("play ani name : good");
await asyncPlayDragonBoneAnimation(this.aniBody, "good", time)
this.playNormal();
}
async playWave(time: number = 1) {
let localTime = time;
this.log("play ani name : wave");
await asyncPlayDragonBoneAnimation(this.aniBody, "wave", time)
this.playNormal();
}
async playPoint(time: number = 1) {
let localTime = time;
this.log("play ani name : point");
await asyncPlayDragonBoneAnimation(this.aniBody, "point", time)
this.playNormal();
}
async playInvite(time: number = 1) {
let localTime = time;
this.log("play ani name : invite");
await asyncPlayDragonBoneAnimation(this.aniBody, "invite", time)
this.playNormal();
}
// update (dt) {}
}
{
"ver": "1.0.8",
"uuid": "98ebfd44-7bb6-4005-96b5-84d1035c4541",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
// Learn TypeScript:
// - https://docs.cocos.com/creator/manual/en/scripting/typescript.html
// Learn Attribute:
// - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
// - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
import { getSpriteFrimeByUrl } from "../util_DG16";
const { ccclass, property } = cc._decorator;
@ccclass
export default class QuestionView extends cc.Component {
@property(cc.Label)
lb_info: cc.Label = null;
@property(cc.Label)
lb_pro: cc.Label = null;
@property(cc.Sprite)
icon: cc.Sprite = null;
@property(cc.Node)
leftRoot: cc.Node = null;
@property(cc.Node)
rightRoot: cc.Node = null;
@property(cc.Node)
cover: cc.Node = null;
callback: Function;
isRight: any;
_choseIndex: any;
root: cc.Node;
onLoad() {
this.leftRoot.off("click")
this.rightRoot.off("click")
this.leftRoot.on("click", this.onClickLeft, this)
this.rightRoot.on("click", this.onClickRight, this)
this.root = this.node.getChildByName("root");
this.root.y = 1000;
}
init(data, choseIndex, index, total, callback: Function) {
this.leftRoot.getChildByName("right").active = false;
this.leftRoot.getChildByName("wrong").active = false;
this.leftRoot.getChildByName("lb").getComponent(cc.Label).string = data.option_1_text;
this.rightRoot.getChildByName("right").active = false;
this.rightRoot.getChildByName("wrong").active = false;
this.rightRoot.getChildByName("lb").getComponent(cc.Label).string = data.option_2_text;
this.cover.active = false;
this.callback = callback;
this.lb_pro.string = `${index}/${total}`
this.lb_info.string = data.text;
this.icon.spriteFrame = null;
this._choseIndex = choseIndex;
getSpriteFrimeByUrl(data.image_url, (sf) => {
this.icon.spriteFrame = sf;
this.icon.node.scale = Math.min(800 / this.node.width, 500 / this.node.height)
})
}
hide() {
cc.tween(this.root).to(1, { y: 1000 }).start();
}
show() {
cc.tween(this.root).to(1, { y: 0 }).start();
}
onClickRight() {
this.cover.active = true;
this.rightRoot.getChildByName("right").active = 1 == this._choseIndex;
this.rightRoot.getChildByName("wrong").active = 1 != this._choseIndex;
this.callback && this.callback(1 == this._choseIndex)
}
onClickLeft() {
this.cover.active = true;
this.leftRoot.getChildByName("right").active = 0 == this._choseIndex;
this.leftRoot.getChildByName("wrong").active = 0 != this._choseIndex;
this.callback && this.callback(0 == this._choseIndex)
}
}
{
"ver": "1.0.8",
"uuid": "33dc0574-c82b-4912-924a-0805ba4fff1b",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
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