Commit 4bfc7496 authored by liujiangnan's avatar liujiangnan

feat: 测试class 同名

parent 566cd0c0
No preview for this file type
{
"ver": "1.1.2",
"uuid": "c35bb2f6-f24a-4850-ae44-643f2fdc7541",
"uuid": "dabed501-3438-4811-8461-b20ab5312b07",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {
"ios": false,
"android": false
},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.1.2",
"uuid": "cb9fa4ea-66ca-45af-ad31-e445c7b0ef32",
"uuid": "966f8c7b-e66c-4b02-b757-5d94dd53f763",
"isBundle": false,
"bundleName": "",
"priority": 1,
......
{
"ver": "1.1.2",
"uuid": "0853721c-3f55-4eb2-873d-e3081cfadd4b",
"uuid": "a3ecfe24-4d9e-49cb-a9be-2a71e90741fe",
"isBundle": false,
"bundleName": "",
"priority": 1,
......
{
"ver": "2.0.1",
"uuid": "f0680ae0-c079-45ef-abd7-9e63d90b982b",
"uuid": "23427dfc-6fdb-49d6-837e-66de3d030a90",
"downloadMode": 0,
"duration": 0.130612,
"subMetas": {}
......
{
"ver": "2.0.1",
"uuid": "a7a49003-90d0-4ba6-a1aa-0104bbda8e65",
"downloadMode": 0,
"duration": 2.1956,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "bdda70bf-c4d2-4c28-a0a5-5cfe03fb5f7b",
"downloadMode": 0,
"duration": 0.365714,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "d3026525-e78c-4c32-914a-412c36770f4c",
"downloadMode": 0,
"duration": 0.972,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "53a0cbe1-a0e7-469b-a650-2c772ac5fd44",
"downloadMode": 0,
"duration": 0.864,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "07047d2f-8f5c-4877-b7b3-d71d600cae4c",
"downloadMode": 0,
"duration": 1.368,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "5697bcb1-17e7-4291-9fbe-bf9979196351",
"downloadMode": 0,
"duration": 0.365714,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "116f0a57-fd96-4940-bfdf-d7d3d7bbaf74",
"downloadMode": 0,
"duration": 1.188,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "a78a0b54-3a77-4a5b-90bc-71eb50e50e84",
"downloadMode": 0,
"duration": 0.936,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.1.0",
"uuid": "4fc1d44d-4473-48ab-8928-ea3260febff8",
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.1.0",
"uuid": "d098fc24-7437-4a9a-9251-b89036f8b4a8",
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.1.0",
"uuid": "93e33adc-a4af-4414-a2e5-f9ea7633bfb9",
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.1.0",
"uuid": "04c2fdd8-cf5c-4965-b801-2c2e84dbefb5",
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.1.2",
"uuid": "059f6bdc-2aca-4faf-bf2b-b7eccbf356b6",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
/**
* PlayABC渠道
*/
import { Singleton } from "../Common/Utils/Singleton";
import { DCGame } from "../DataCenter/DCGame";
import { defaultData } from "../DataCenter/DefaultData";
export class PlayABC extends Singleton {
private callBack: Function;
//获得表数据数据
public InitData(cb: Function) {
this.callBack = cb;
console.log('初始化数据');
if (window && (<any>window).courseware && (<any>window).courseware.getData) {
(<any>window).courseware.getData((data) => {
DCGame.getInstance().data = data || this.getDefaultData();
this.preload();
})
} else {
DCGame.getInstance().data = this.getDefaultData();
this.preload();
}
}
public getDefaultData() {
return defaultData;
}
public preload() {
if (window && window["air"]) {
this.onLoadEnd();
window["air"].hideAirClassLoading();
} else {
this.onLoadEnd();
}
cc.debug.setDisplayStats(false);
}
public onLoadEnd() {
this.callBack && this.callBack();
}
}
\ No newline at end of file
{
"ver": "1.0.8",
"uuid": "c41b0e51-55d7-443c-af3a-b22c3dd9b9e5",
"uuid": "7fb9fd21-8a0a-4e60-bf0b-067f173ebeb5",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
......
{
"ver": "1.1.2",
"uuid": "1d09141d-a59f-4af7-9358-f79f5973db6f",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.1.2",
"uuid": "e50d4196-0650-4532-ab62-cce8064f1dfc",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
import { DCGame, Option } from "../../DataCenter/DCGame";
import { ItemAnswer } from "../../Game/ItemAnswer";
import { E_AudioName, Speaker } from "../../Game/Speaker";
import AssetMgr from "../Module/AssetMgr/AssetMgr";
import EventMgr from "../Module/EventMgr/EventMgr";
//拖拽节点
const { ccclass, property } = cc._decorator;
@ccclass
export class DragGameAnswerObject extends cc.Component {
onLoad(): void {
// super.onLoad();
//注册事件
this.regEvent();
this.oldPos = this.node.getPosition();
}
protected onDestroy(): void {
//注销事件
this.unEvent();
}
private regEvent() {
this.node.on(cc.Node.EventType.TOUCH_START, this.touchBegan, this);
this.node.on(cc.Node.EventType.TOUCH_MOVE, this.touchMove, this);
this.node.on(cc.Node.EventType.TOUCH_END, this.touchEnd, this);
this.node.on(cc.Node.EventType.TOUCH_CANCEL, this.touchCancel, this);
}
private unEvent() {
}
private m_dragGameManager//管理器
private m_nAnswerIdx//当前答案的id
private m_nDeltaPos//移动距离
private m_bMove;//是否移动
private dmOption: Option;//当前选项的数据模型
private oldPos;//原来的节点坐标
//设置Item数据
setData(value: Option) {
this.dmOption = value;
this.m_dragGameManager = null;
this.m_nAnswerIdx = this.dmOption.option_Idx;
}
private tw1//缓动1
touchBegan(event) {
this.m_bMove = false;
this.m_nDeltaPos = this.node.x + this.node.y;
if (DCGame.getInstance().questionIdx == 0) {
let answer_1 = this.node.parent.getChildByName("answer_1")
this.tw1 = cc.tween(answer_1)
.to(0.2, { y: 200 })
.start();
}
}
touchMove(event) {
var delta = event.getDelta();
this.node.x += delta.x;
this.node.y += delta.y;
var tempDeltaPos = this.node.x + this.node.y;
if (Math.abs(this.m_nDeltaPos - tempDeltaPos) > 10) {
this.m_bMove = true;
}
}
touchEnd() {
//点击
if (!this.m_bMove) {
console.log("点击");
if (DCGame.getInstance().questionIdx == 1) {
//第二轮点击图片播放声音
let path = this.dmOption.option_audio_url
AssetMgr.playAudioByUrl(path);
this.node.setPosition(this.oldPos);
} else {
EventMgr.emit("checkAnswer", this.node, this.m_nAnswerIdx)
}
} else {
console.log("移动");
//向管理器发送结果 把当前id跟节点发送过去开始检验结果
EventMgr.emit("checkAnswer", this.node, this.m_nAnswerIdx)
// this.m_dragGameManager.checkAnswer(this.node, this.m_nAnswerIdx);
}
}
touchCancel() {
console.log("取消");
this.node.setPosition(this.oldPos);
}
//答对了
AnswerRight() {
console.log("答对了");
//答对播放一遍正确音效
let path = this.dmOption.option_audio_url
AssetMgr.playAudioByUrl(path)
//开始做表现
if (DCGame.getInstance().questionIdx == 0) {
this.node.getComponent(ItemAnswer).AnswerRightEffect_1();
} else {
this.node.getComponent(ItemAnswer).AnswerRightEffect_2();
}
}
//答错了
AnswerError() {
console.log("答错了");
Speaker.playErrorEffect();
if (DCGame.getInstance().questionIdx == 0) {
let answer_1 = this.node.parent.getChildByName("answer_1")
answer_1.stopAllActions();
cc.tween(answer_1)
.to(0.1, { y: -52.5 })
.start();
}
this.node.setPosition(this.oldPos);
}
//设置回原来位置
setOldPosition() {
this.node.scale = 1;
if (DCGame.getInstance().questionIdx == 0) {
let answer_1 = this.node.parent.getChildByName("answer_1");
answer_1.stopAllActions();
this.node.parent.getChildByName("answer_1").y = -52;
}
this.node.setPosition(this.oldPos);
}
}
\ No newline at end of file
{
"ver": "1.0.8",
"uuid": "f8b451ff-857c-4ca8-9870-866bc5154a29",
"uuid": "a4f8c754-19ae-4fb6-9ae4-b44ed4aed671",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
......
import { DCGame } from "../../DataCenter/DCGame";
import EventMgr from "../Module/EventMgr/EventMgr";
import { UICtrl } from "../UICtrl/UICtrl";
import { DragGameAnswerObject } from "./DragGameAnswerObject";
import { DragGameOptionObject } from "./DragGameOptionObject";
//拖拽管理器
const { ccclass, property } = cc._decorator;
@ccclass
export class DragGameManager extends UICtrl {
onLoad(): void {
super.onLoad();
//注册事件
this.regEvent();
this.initProperty()
}
initProperty() {
}
protected onDestroy(): void {
//注销事件
this.unEvent();
}
private regEvent() {
this.unEvent();
EventMgr.reg("checkAnswer", this.checkAnswer.bind(this))
}
private unEvent() {
EventMgr.remove("checkAnswer");
}
//检查结果
checkAnswer(nodAnswer, option_i) {
let scrAnswer = nodAnswer.getComponent(DragGameAnswerObject)
//获得目标点 一般是根据配置id从列表中获取到当前的节点,现在直接在初始化中设置好了,
let nod = DCGame.getInstance().objOption;
//查看当前节点的矩阵跟之前矩阵的包含情况
let OptionAABB = nod.getComponent(DragGameOptionObject).setAABB();
let AnswerAABB = this.getCallerAABB(nodAnswer);
var isIntersect = OptionAABB.containsRect(AnswerAABB);//判断是否被包含
console.log("是否包含", isIntersect)
if (isIntersect) {
scrAnswer.AnswerRight();
} else {
scrAnswer.AnswerError();
}
}
getCallerAABB(caller) {
let svLeftBottomPoint = caller.parent.convertToWorldSpaceAR(
cc.v2(
caller.x,
caller.y
)
);
var posNode_1 = cc.rect(
svLeftBottomPoint.x,
svLeftBottomPoint.y,
0,
0
);
return posNode_1
}
}
\ No newline at end of file
{
"ver": "1.0.8",
"uuid": "1dfa9ae1-c267-4143-83f3-bd86db045fcc",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
import { Group, Option } from "../../DataCenter/DCGame";
import { DCGame } from "./../../DataCenter/DCGame";
import AssetMgr from "../Module/AssetMgr/AssetMgr";
import EventMgr from "../Module/EventMgr/EventMgr";
import { UICtrl } from "../UICtrl/UICtrl";
const { ccclass, property } = cc._decorator;
@ccclass
export class DragGameOptionObject extends UICtrl {
onLoad(): void {
super.onLoad();
this.initProperty();
this.updateUI();
}
private layQuestionText: cc.Node;
private labText: cc.Node;
private sptPhoto: cc.Sprite;
private layQuestionSpt: cc.Node;
private btnAudio: cc.Node;
private labTitle: cc.Label;
initProperty() {
this.layQuestionText = this.view["layQuestionText"];
this.labText = this.view["labText"]
this.layQuestionSpt = this.view["layQuestionSpt"]
this.sptPhoto = this.view["sptPhoto"].getComponent(cc.Sprite);
this.btnAudio = this.view["btnAudio"];
this.labTitle = this.view["labTitle"].getComponent(cc.Label);
}
private dmGroup: Group
setData(value: Group) {
this.dmGroup = value;
this.updateUI();
}
updateUI() {
if (!this.view) return;
this.btnAudio.active = DCGame.getInstance().questionIdx == 0 ? true : false;
this.labTitle.node.active = DCGame.getInstance().questionIdx == 1 ? true : false;
//设置标题
this.labTitle.string = this.dmGroup.group_text;
}
setAABB() {
var node = this.node
let svLeftBottomPoint = node.parent.convertToWorldSpaceAR(
cc.v2(
node.x - node.width / 2,
node.y - node.height / 2,
)
);
console.log("世界坐标目标点" + svLeftBottomPoint);
// 求出 ScrollView 可视区域在世界坐标系中的矩形(碰撞盒)
let svBBoxRect = cc.rect(
svLeftBottomPoint.x,
svLeftBottomPoint.y,
node.width,
node.height
);
// console.log(Id + ":" + svLeftBottomPoint.x + "," + svLeftBottomPoint.y);
return svBBoxRect
}
Effect_1(labText, dmOption: Option) {
this.AddText1(labText)
AssetMgr.getSpriteFrimeByUrl(dmOption.option_pic_url, (spriteFrame) => {
this.sptPhoto.spriteFrame = spriteFrame
let sptPic = cc.instantiate(this.sptPhoto.node);
sptPic.active = true;
this.AddSpt(sptPic);
})
}
//添加一个文字
AddText1(labText) {
labText.scale = 1.5
labText.parent = this.layQuestionText;
cc.tween(labText)
.to(0.4, { scale: 1 })
.call(() => {
labText.color = cc.color(60, 0, 0);
//开始下一题
EventMgr.emit("nextAnswer");
})
.start();
}
AddSpt(sptPic) {
sptPic.y = 0;
sptPic.parent = this.layQuestionSpt;
this.photoScare(sptPic, 90)
}
Effect_2(sptPic, dmOption: Option) {
this.AddSpt(sptPic)
this.AddText2(dmOption.option_text)
}
//
AddText2(Value) {
let labText = cc.instantiate(this.labText);
labText.parent = this.layQuestionText;
labText.getComponent(cc.Label).string = Value;
labText.active = true;
cc.tween(labText)
.to(0.4, { scale: 1.5 })
.to(0.4, { scale: 1 })
.call(() => {
//开始下一题
EventMgr.emit("nextAnswer");
})
.start();
}
_tap_btnAudio() {
let path = this.dmGroup.group_audio_url
AssetMgr.playAudioByUrl(path)
}
_tap_labTitle() {
let path = this.dmGroup.group_audio_url
AssetMgr.playAudioByUrl(path)
}
}
{
"ver": "1.0.8",
"uuid": "ec731280-c515-4c22-adc9-9f3a75da6b55",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.1.2",
"uuid": "b899141d-f86d-4b49-902d-7b6aa84508e3",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.1.2",
"uuid": "660204b7-7435-4876-963a-cec4198dc9a0",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
import AudioMgr from "../AudioMgr/AudioMgr";
/**
* 资源管理中心
*/
export default class AssetMgr {
public static getSprNode(resName) {
const sf = cc.find('Canvas/res/img/' + resName).getComponent(cc.Sprite).spriteFrame;
const node = new cc.Node();
node.addComponent(cc.Sprite).spriteFrame = sf;
return node;
}
public static getSpriteFrimeByUrl(url, cb) {
cc.loader.load({ url }, (err, img) => {
const spriteFrame = new cc.SpriteFrame(img)
if (cb) {
cb(spriteFrame);
}
})
}
public static getSprNodeByUrl(url, cb) {
const node = new cc.Node();
const spr = node.addComponent(cc.Sprite);
this.getSpriteFrimeByUrl(url, (sf) => {
spr.spriteFrame = sf;
if (cb) {
cb(node);
}
})
}
private static callBack;
public static playAudioByUrl(audio_url, cb = null) {
if (audio_url) {
cc.assetManager.loadRemote(audio_url, (err, audioClip) => {
// this.callBack && this.callBack();
// this.callBack = cb;
AudioMgr.stopAllEffect();
AudioMgr.playEffect(audioClip, false, cb);
});
}
}
// 加载预制体文件
public static loadBundlePrefab(abName: string, resPath: string): any {
return new Promise((resolve, reject) => {
cc.assetManager.loadBundle(abName, (err: Error | null, bundle: cc.AssetManager.Bundle) => {
if (!err) {
bundle.load(resPath, cc.Prefab, (err: Error | null, prefab: cc.Prefab) => {
if (!err) {
let node = cc.instantiate(prefab);
resolve(node);
} else {
reject(null);
console.warn(err);
}
});
} else {
reject(null);
console.warn(err);
}
});
})
}
//加载音频文件
public static loadAudio(abName: string, resPath: string): Promise<cc.AudioClip> {
return new Promise((resolve, reject) => {
cc.assetManager.loadBundle(abName, (err: Error | null, bundle: cc.AssetManager.Bundle) => {
if (!err) {
bundle.load(resPath, cc.AudioClip, (err: Error | null, clip: cc.AudioClip) => {
if (!err) {
resolve(clip);
} else {
reject(null);
console.warn(err);
}
});
} else {
reject(null);
console.warn(err);
}
});
})
}
}
{
"ver": "1.0.8",
"uuid": "a218e35b-c1c2-4475-935d-2158d8636bf7",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.1.2",
"uuid": "75b80a88-1158-44b4-b143-dbf9b538497a",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
/**
* 音频播放类
*/
export default class AudioMgr {
private static _music: Map<cc.AudioClip, number> = new Map();
private static _effect: Map<number, cc.AudioClip> = new Map();
private static _masterVolume: number = 1.0;
/**
* 主音量
*/
public static get masterVolume(): number { return this._masterVolume; }
private static _musicVolume: number = 1.0;
/**
* 音乐音量
*/
public static get musicVolume(): number { return this._musicVolume; }
private static _effectVolume: number = 1.0;
/**
* 特效音量
*/
public static get effectVolume(): number { return this._effectVolume; }
/**
* 设置主音量
* @param value 音量值(0.0 ~ 1.0)
*/
public static setMasterVolume(value: number): void {
if (value < 0.0) value = 0.0;
else if (value > 1.0) value = 1.0;
this._masterVolume = value;
this.setMusicVolume(this._musicVolume);
this.setEffectVolume(this._effectVolume);
}
/**
* 设置音量(音乐与特效)
* @param value 音量值(0.0 ~ 1.0)
*/
public static setVolume(value: number): void {
this.setMusicVolume(value);
this.setEffectVolume(value);
}
/**
* 设置音乐音量
* @param value 音量值(0.0 ~ 1.0)
*/
public static setMusicVolume(value: number): void {
if (value < 0.0) value = 0.0;
else if (value > 1.0) value = 1.0;
this._musicVolume = value;
let realVolume = this._masterVolume * value;
this._music.forEach((id, clip) => cc.audioEngine.setVolume(id, realVolume));
}
/**
* 设置特效音量
* @param value 音量值(0.0 ~ 1.0)
*/
public static setEffectVolume(value: number): void {
if (value < 0.0) value = 0.0;
else if (value > 1.0) value = 1.0;
this._effectVolume = value;
let realVolume = this._masterVolume * value;
this._effect.forEach((clip, id) => cc.audioEngine.setVolume(id, realVolume));
}
/**
* 播放音乐
* @param clip 音频
*/
public static playMusic(clip: cc.AudioClip): void {
if (this._music.has(clip)) this.stopMusic(clip);
let id = cc.audioEngine.play(clip, true, this._masterVolume * this._musicVolume);
this._music.set(clip, id);
}
/**
* 停止音乐
* @param clip 音频
*/
public static stopMusic(clip: cc.AudioClip): void {
if (!this._music.has(clip)) return;
cc.audioEngine.stop(this._music.get(clip));
this._music.delete(clip);
}
/**
* 停止所有音乐
*/
public static stopAllMusic(): void {
this._music.forEach((id, clip) => this.stopMusic(clip));
}
/**
* 暂停音乐
* @param clip 音频
*/
public static pauseMusic(clip: cc.AudioClip): void {
if (!this._music.has(clip)) return;
cc.audioEngine.pause(this._music.get(clip));
}
/**
* 暂停所有音乐
*/
public static pauseAllMusic(): void {
this._music.forEach((id, clip) => this.pauseMusic(clip));
}
/**
* 恢复音乐
* @param clip 音频
*/
public static resumeMusic(clip: cc.AudioClip): void {
if (!this._music.has(clip)) return;
cc.audioEngine.resume(this._music.get(clip));
}
/**
* 恢复所有音乐
*/
public static resumeAllMusic(): void {
this._music.forEach((id, clip) => this.resumeMusic(clip));
}
/**
* 播放特效音频
* @param clip 音频
* @param loop 循环
*/
public static playEffect(clip: cc.AudioClip, loop: boolean, cb?: Function): void {
let id = cc.audioEngine.play(clip, loop, this._masterVolume * this._effectVolume);
this._effect.set(id, clip);
if (!loop) cc.audioEngine.setFinishCallback(id, () => {
cb && cb();
this._effect.delete(id)
});
}
/**
* 停止特效音频
* @param clip 音频
*/
public static stopEffect(clip: cc.AudioClip): void {
this._effect.forEach((_clip, id) => {
if (_clip === clip) {
cc.audioEngine.stop(id);
this._effect.delete(id);
}
});
}
/**
* 停止所有特效音频
*/
public static stopAllEffect(): void {
this._effect.forEach((clip, id) => {
cc.audioEngine.stop(id);
this._effect.delete(id);
});
}
/**
* 暂停特效音频
* @param clip 音频
*/
public static pauseEffect(clip: cc.AudioClip): void {
this._effect.forEach((_clip, id) => _clip === clip && cc.audioEngine.pause(id));
}
/**
* 暂停所有特效音频
*/
public static pauseAllEffect(): void {
this._effect.forEach((clip, id) => cc.audioEngine.pause(id));
}
/**
* 恢复特效音频
* @param clip 音频
*/
public static resumeEffect(clip: cc.AudioClip): void {
this._effect.forEach((_clip, id) => _clip === clip && cc.audioEngine.resume(id));
}
/**
* 恢复所有特效音频
*/
public static resumeAllEffect(): void {
this._effect.forEach((clip, id) => cc.audioEngine.resume(id));
}
/**
* 停止所有音频
*/
public static stopAll(): void {
this.stopAllMusic();
this.stopAllEffect();
}
/**
* 暂停所有音频
*/
public static pauseAll(): void {
this.pauseAllMusic();
this.pauseAllEffect();
}
/**
* 恢复所有音频
*/
public static resumeAll(): void {
this.resumeAllMusic();
this.resumeAllEffect();
}
/**
* 静音
*/
public static mute(): void {
this.setMasterVolume(0.0);
}
}
{
"ver": "1.0.8",
"uuid": "492752bd-85b8-46bf-9645-832f0133d50d",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.1.2",
"uuid": "948de346-d010-4bd3-9dd6-e79253702f0b",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
/**
* 事件管理器
* @example
* // 注册事件
* EventMgr.reg('game-start', this.onGameStart, this);
* // 发射事件
* EventMgr.emit('game-start', 666);
*/
export default class EventMgr {
/**
* 普通事件容器
*/
private static events: Map<string, Subscription[]> = new Map<string, Subscription[]>();
/**
* 一次性事件容器
*/
private static onceEvents: Map<string, Subscription[]> = new Map<string, Subscription[]>();
/**
* 注册事件
* @param name 事件名
* @param callback 回调
* @param target 目标
*/
public static reg(name: string, callback: Function, target?: any) {
const events = this.events;
if (!events.has(name)) {
events.set(name, [{ callback, target }]);
return;
}
events.get(name).push({ callback, target });
}
/**
* 注册事件(一次性)
* @param name 事件名
* @param callback 回调
* @param target 目标
*/
public static once(name: string, callback: Function, target?: any) {
const events = this.onceEvents;
if (!events.has(name)) {
events.set(name, [{ callback, target }]);
return;
}
events.get(name).push({ callback, target });
}
/**
* 取消注册事件
* @param name 事件名
* @param callback 回调
* @param target 目标
*/
public static off(name: string, callback: Function, target?: any) {
// 普通事件
const event = this.events.get(name);
if (event) {
for (let i = 0, l = event.length; i < l; i++) {
if (this.compare(event[i], callback, target)) {
event.splice(i, 1);
if (event.length === 0) {
this.events.delete(name);
}
break;
}
}
}
// 一次性事件
const onceEvent = this.onceEvents.get(name);
if (onceEvent) {
for (let i = 0, l = onceEvent.length; i < l; i++) {
if (this.compare(onceEvent[i], callback, target)) {
onceEvent.splice(i, 1);
if (onceEvent.length === 0) {
this.onceEvents.delete(name);
}
break;
}
}
}
}
/**
* 通过事件名发送事件
* @param name 事件名
* @param args 参数
*/
public static emit(name: string, ...args: any[]) {
// 普通事件
const event = this.events.get(name);
if (event) {
for (let i = 0; i < event.length; i++) {
const { callback, target } = event[i];
callback.apply(target, args);
}
}
// 一次性事件
const onceEvent = this.onceEvents.get(name);
if (onceEvent) {
for (let i = 0; i < onceEvent.length; i++) {
const { callback, target } = onceEvent[i];
callback.apply(target, args);
}
this.onceEvents.delete(name);
}
}
/**
* 移除指定事件
* @param name 事件名
*/
public static remove(name: string) {
// 普通事件
if (this.events.has(name)) {
this.events.delete(name);
}
// 一次性事件
if (this.onceEvents.has(name)) {
this.onceEvents.delete(name);
}
}
/**
* 移除所有事件
*/
public static removeAll() {
// 普通事件
this.events.clear();
// 一次性事件
this.onceEvents.clear();
}
/**
* 对比
* @param subscription 订阅
* @param inCallback 回调
* @param inTarget 目标
*/
private static compare(subscription: Subscription, inCallback: Function, inTarget: any) {
const { callback, target } = subscription;
return target === inTarget && (callback === inCallback || callback.toString() === inCallback.toString());
}
}
/** 订阅 */
interface Subscription {
/** 回调 */
callback: Function;
/** 目标 */
target: any;
}
{
"ver": "1.0.8",
"uuid": "737bb68e-5d22-4ba5-86a0-ff46d2d0c5c3",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.1.2",
"uuid": "5724fad1-733b-47a0-b65b-214be9a799a1",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
import EventMgr from "../Module/EventMgr/EventMgr";
import { generateUUID } from "../Utils/util";
/**
* 背景适配组建
*/
const { ccclass, property } = cc._decorator;
@ccclass
export default class BGView extends cc.Component {
protected onLoad(): void {
this.setBgScale();
//注册事件 当尺寸变化时重新适配
EventMgr.reg("adjustUI", () => {
this.setBgScale();
}, generateUUID());
}
//背景适配
setBgScale() {
// 1. 先找到 SHOW_ALL 模式适配之后,本节点的实际宽高以及初始缩放值
let scaleForShowAll = Math.min(
cc.view.getCanvasSize().width / this.node.width,
cc.view.getCanvasSize().height / this.node.height
);
let realWidth = this.node.width * scaleForShowAll;
let realHeight = this.node.height * scaleForShowAll;
// 2. 基于第一步的数据,再做缩放适配
this.node.scale = Math.max(
cc.view.getCanvasSize().width / realWidth,
cc.view.getCanvasSize().height / realHeight
);
}
}
{
"ver": "1.0.8",
"uuid": "9d630844-1784-4e42-b1c6-cc3e831f95ee",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
//所有UI控制脚本
export abstract class UICtrl extends cc.Component {
protected view: {};//保存所有节点信息
onLoad() {
this.view = {};
this.loadAllObject(this.node, "");
}
//加载所有节点
loadAllObject(root: any, path: string) {
for (let i = 0; i < root.children.length; i++) {
//添加监听事件
this.handlePartAdded(root.children[i], root.children[i].name);
//把每个节点存起来
this.view[path + root.children[i].name] = root.children[i];
this.loadAllObject(root.children[i], path + root.children[i].name + "/");
}
}
//添加监听事件
handlePartAdded(addHandNode: Node, name: string) {
//如果以_tap_+节点名字 并且有按钮组件的 默认注册点击监听事件
let itemClick = this["_tap_" + name];
if (itemClick) {
this.addBtnListen(addHandNode, this, itemClick);
}
}
//添加按钮监听事件
public addBtnListen(nodView, caller, cb) {
var button = nodView.getComponent(cc.Button);
if (!button) {
return;
}
nodView.on("click", cb, caller);
}
public get m_view() {
return this.view;
}
//图片适配
public photoScare(node, maxNum = 110) {
// var maxNum = 110;
let maxSize = Math.min(maxNum / node.height, maxNum / node.width);
if (node.perScale == undefined) {
node.perScale = node.scaleX;
} else {
node.scaleX = node.perScale;
node.scaleY = node.perScale;
}
// node.scaleX *= maxSize;
// node.scaleY *= maxSize;
node.width = maxSize * node.width;
node.height = maxSize * node.height;
}
}
\ No newline at end of file
{
"ver": "1.0.8",
"uuid": "6397ad6f-7dba-4c64-8310-65a89491575a",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
import EventMgr from "../Module/EventMgr/EventMgr";
import { Singleton } from "../Utils/Singleton";
const WIDTH = 1280
const HIGHT = 720
export class View extends Singleton {
Init() {
//适配一次
this.initSize();
//注册事件 当尺寸变化时重新适配
EventMgr.reg("adjustUI", () => {
this.initSize();
}, 1);
}
initSize() {
//根据屏幕大小决定适配策略
//想明白原理,请阅读本文 https://blog.csdn.net/qq_36720848/article/details/89742451
var s = cc.view.getFrameSize();
var rw = s.width;
var rh = s.height;
var finalW = rw;
var finalH = rh;
if ((rw / rh) > (WIDTH / HIGHT)) {
//!#zh: 是否优先将设计分辨率高度撑满视图高度。 */
//cvs.fitHeight = true;
//如果更长,则用定高
finalH = HIGHT;
finalW = finalH * rw / rh;
}
else {
/*!#zh: 是否优先将设计分辨率宽度撑满视图宽度。 */
//cvs.fitWidth = true;
//如果更短,则用定宽
finalW = WIDTH;
finalH = rh / rw * finalW;
}
cc.view.setDesignResolutionSize(finalW, finalH, cc.ResolutionPolicy.UNKNOWN);
let cvs = cc.find('Canvas')!.getComponent(cc.Canvas);
cvs.designResolution = cc.size(finalW, finalH);
cvs.node.width = finalW;
cvs.node.height = finalH;
cvs.node.emit("resize");
}
}
{
"ver": "1.0.8",
"uuid": "62e23983-b13f-4575-82b0-09833f04e062",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.1.2",
"uuid": "06d35dc7-b462-445a-85b8-a4a103bfbf65",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
/***
* 单例接口:所有单例模块都继承这里
*/
export class Singleton {
/***
* 统一的单例获取接口。
*/
static getInstance<T extends {}>(this: new () => T): T {
if (!(<any>this).instance) {
(<any>this).instance = new this();
}
return (<any>this).instance;
}
}
\ No newline at end of file
{
"ver": "1.0.8",
"uuid": "73a5b059-484c-44d4-a878-41feb2a87657",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.0.8",
"uuid": "b54300af-b8e5-4b4e-aa2f-9ac1cef7b598",
"uuid": "12f7c61e-6e5f-46e3-954d-3d149f44761c",
"isPlugin": true,
"loadPluginInWeb": true,
"loadPluginInNative": true,
......
export function randArr(arr) {
for (var i = 0; i < arr.length; i++) {
var random = Math.floor(Math.random() * (i + 1));
[arr[i], arr[random]] = [arr[random], arr[i]];
}
return arr;
}
export function deepCopy(src) {
var cpy = src instanceof Array ? [] : {};
for (var i in src) {
cpy[i] = typeof src[i] === 'object' ? this.deepCopy(src[i]) : src[i];
}
return cpy;
}
// 范围随机
export function randFromTo(_min, _max) {
var min = parseFloat(_min);
var max = parseFloat(_max);
return (min + Math.random() * (max - min));
}
// 范围随机一个整数
// 例:1~3,返回的可能值为:1、2、3
export function randFromTo_Int(min, max) {
var val = this.randFromTo(min, max + 1 - 0.0001);
return Math.floor(val);
}
export function getPosByAngle(angle, len) {
const radian = angle * Math.PI / 180;
const x = Math.sin(radian) * len;
const y = Math.cos(radian) * len;
return { x, y };
}
export function getAngleByPos(px, py, mx, my) {
const x = Math.abs(px - mx);
const y = Math.abs(py - my);
const z = Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2));
const cos = y / z;
const radina = Math.acos(cos); // 用反三角函数求弧度
let angle = Math.floor(180 / (Math.PI / radina) * 100) / 100; // 将弧度转换成角度
if (mx > px && my > py) {// 鼠标在第四象限
angle = 180 - angle;
}
if (mx === px && my > py) {// 鼠标在y轴负方向上
angle = 180;
}
if (mx > px && my === py) {// 鼠标在x轴正方向上
angle = 90;
}
if (mx < px && my > py) {// 鼠标在第三象限
angle = 180 + angle;
}
if (mx < px && my === py) {// 鼠标在x轴负方向
angle = 270;
}
if (mx < px && my < py) {// 鼠标在第二象限
angle = 360 - angle;
}
// console.log('angle: ', angle);
return angle;
}
export function exchangeNodePos(baseNode, targetNode) {
return baseNode.convertToNodeSpaceAR(targetNode._parent.convertToWorldSpaceAR(cc.v2(targetNode.x, targetNode.y)));
}
export function RandomInt(a, b = 0) {
let max = Math.max(a, b);
let min = Math.min(a, b);
return Math.floor(Math.random() * (max - min) + min);
}
export function randomSortByArr(arr) {
const newArr = [];
const tmpArr = arr.concat();
while (tmpArr.length > 0) {
const randomIndex = Math.floor(tmpArr.length * Math.random());
newArr.push(tmpArr[randomIndex]);
tmpArr.splice(randomIndex, 1);
}
return newArr;
}
export function setSprNodeMaxLen(sprNode, maxW, maxH) {
const sx = maxW / sprNode.width;
const sy = maxH / sprNode.height;
const s = Math.min(sx, sy);
sprNode.scale = Math.round(s * 1000) / 1000;
}
export function localPosTolocalPos(baseNode, targetNode) {
const worldPos = targetNode.parent.convertToWorldSpaceAR(cc.v2(targetNode.x, targetNode.y));
const localPos = baseNode.parent.convertToNodeSpaceAR(cc.v2(worldPos.x, worldPos.y));
return localPos;
}
export function worldPosToLocalPos(worldPos, baseNode) {
const localPos = baseNode.parent.convertToNodeSpaceAR(cc.v2(worldPos.x, worldPos.y));
return localPos;
}
export function getScaleRateBy2Node(baseNode, targetNode, maxFlag = true) {
const worldRect1 = targetNode.getBoundingBoxToWorld();
const worldRect2 = baseNode.getBoundingBoxToWorld();
const sx = worldRect1.width / worldRect2.width;
const sy = worldRect1.height / worldRect2.height;
if (maxFlag) {
return Math.max(sx, sy);
} else {
return Math.min(sx, sy);
}
}
export function getDistance(start, end) {
var pos = cc.v2(start.x - end.x, start.y - end.y);
var dis = Math.sqrt(pos.x * pos.x + pos.y * pos.y);
return dis;
}
export function playAudioByUrl(audio_url, cb = null) {
if (audio_url) {
cc.assetManager.loadRemote(audio_url, (err, audioClip) => {
const audioId = cc.audioEngine.play(audioClip, false, 0.8);
if (cb) {
cc.audioEngine.setFinishCallback(audioId, () => {
cb();
});
}
});
}
}
export function btnClickAnima(btn, time = 0.15, rate = 1.05) {
btn.tmpScale = btn.scale;
btn.on(cc.Node.EventType.TOUCH_START, () => {
cc.tween(btn)
.to(time / 2, { scale: btn.scale * rate })
.start()
})
btn.on(cc.Node.EventType.TOUCH_CANCEL, () => {
cc.tween(btn)
.to(time / 2, { scale: btn.tmpScale })
.start()
})
btn.on(cc.Node.EventType.TOUCH_END, () => {
cc.tween(btn)
.to(time / 2, { scale: btn.tmpScale })
.start()
})
}
export function getSpriteFrimeByUrl(url, cb) {
cc.loader.load({ url }, (err, img) => {
const spriteFrame = new cc.SpriteFrame(img)
if (cb) {
cb(spriteFrame);
}
})
}
export function getSprNode(resName) {
const sf = cc.find('Canvas/res/img/' + resName).getComponent(cc.Sprite).spriteFrame;
const node = new cc.Node();
node.addComponent(cc.Sprite).spriteFrame = sf;
return node;
}
export function getSprNodeByUrl(url, cb) {
const node = new cc.Node();
const spr = node.addComponent(cc.Sprite);
getSpriteFrimeByUrl(url, (sf) => {
spr.spriteFrame = sf;
if (cb) {
cb(spr);
}
})
}
export function playAudio(audioClip, cb = null) {
if (audioClip) {
const audioId = cc.audioEngine.playEffect(audioClip, false);
if (cb) {
cc.audioEngine.setFinishCallback(audioId, () => {
cb();
});
}
}
}
export async function asyncDelay(time) {
return new Promise((resolve, reject) => {
try {
setTimeout(() => {
resolve(null);
}, time * 1000);
} catch (e) {
reject(e);
}
})
}
export class FireworkSettings {
baseNode; // 父节点
nodeList; // 火花节点的array
pos; // 发射点
side; // 发射方向
range; // 扩散范围
number; // 发射数量
scalseRange; // 缩放范围
constructor(baseNode, nodeList,
pos = cc.v2(0, 0),
side = cc.v2(0, 100),
range = 50,
number = 100,
scalseRange = 0
) {
this.baseNode = baseNode;
this.nodeList = nodeList;
this.pos = pos;
this.side = side;
this.range = range;
this.number = number;
this.scalseRange = scalseRange;
}
static copy(firework) {
return new FireworkSettings(
firework.baseNode,
firework.nodeList,
firework.pos,
firework.side,
firework.range,
firework.number,
);
}
}
export async function showFireworks(fireworkSettings) {
const { baseNode, nodeList, pos, side, range, number, scalseRange } = fireworkSettings;
new Array(number).fill(' ').forEach(async (_, i) => {
let rabbonNode = new cc.Node();
rabbonNode.parent = baseNode;
rabbonNode.x = pos.x;
rabbonNode.y = pos.y;
rabbonNode.angle = 60 * Math.random() - 30;
let node = cc.instantiate(nodeList[RandomInt(nodeList.length)]);
node.parent = rabbonNode;
node.active = true;
node.x = 0;
node.y = 0;
node.angle = 0;
node.scale = (Math.random() - 0.5) * scalseRange + 1;
const rate = Math.random();
const angle = Math.PI * (Math.random() * 2 - 1);
await asyncTweenBy(rabbonNode, 0.3, {
x: side.x * rate + Math.cos(angle) * range * rate,
y: side.y * rate + Math.sin(angle) * range * rate
}, {
easing: 'quadIn'
});
cc.tween(rabbonNode)
.by(8, { y: -2000 })
.start();
cc.tween(rabbonNode)
.to(5, { scale: (Math.random() - 0.5) * scalseRange + 1 })
.start();
rabbonFall(rabbonNode);
await asyncDelay(Math.random());
cc.tween(node)
.by(0.15, { x: -10, angle: -10 })
.by(0.3, { x: 20, angle: 20 })
.by(0.15, { x: -10, angle: -10 })
.union()
.repeatForever()
.start();
cc.tween(rabbonNode)
.delay(5)
.to(0.3, { opacity: 0 })
.call(() => {
node.stopAllActions();
node.active = false;
node.parent = null;
node = null;
})
.start();
});
}
async function rabbonFall(node) {
const time = 1 + Math.random();
const offsetX = RandomInt(-200, 200) * time;
await asyncTweenBy(node, time, { x: offsetX, angle: offsetX * 60 / 200 });
rabbonFall(node);
}
export async function asyncTweenTo(node, duration, obj, ease = undefined) {
return new Promise((resolve, reject) => {
try {
cc.tween(node)
.to(duration, obj, ease)
.call(() => {
resolve(null);
})
.start();
} catch (e) {
reject(e);
}
});
}
export async function asyncTweenBy(node, duration, obj, ease = undefined) {
return new Promise((resolve, reject) => {
try {
cc.tween(node)
.by(duration, obj, ease)
.call(() => {
resolve(null);
})
.start();
} catch (e) {
reject(e);
}
});
}
export function showTrebleFirework(baseNode, rabbonList) {
const middle = new FireworkSettings(baseNode, rabbonList);
middle.pos = cc.v2(0, -400);
middle.side = cc.v2(0, 1000);
middle.range = 200;
middle.number = 100;
middle.scalseRange = 0.4;
const left = FireworkSettings.copy(middle);
left.pos = cc.v2(-600, -400);
left.side = cc.v2(200, 1000);
const right = FireworkSettings.copy(middle);
right.pos = cc.v2(600, -400);
right.side = cc.v2(-200, 1000);
showFireworks(middle);
showFireworks(left);
showFireworks(right);
}
export function onHomeworkFinish() {
const middleLayer = cc.find('middleLayer');
if (middleLayer) {
const middleLayerComponent = middleLayer.getComponent('middleLayer');
if (middleLayerComponent.role == 'student') {
middleLayerComponent.onHomeworkFinish(() => { });
}
} else {
console.log('onHomeworkFinish');
}
}
//生成唯一标识
export function generateUUID(): string {
var d = new Date().getTime();
var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
var r = (d + Math.random() * 16) % 16 | 0;
d = Math.floor(d / 16);
return (c == 'x' ? r : (r & 0x3 | 0x8)).toString(16);
});
return uuid;
}
{
"ver": "1.0.8",
"uuid": "ade7af40-d56d-4087-bbc6-2888fef55353",
"uuid": "0b2bfb01-9b2d-40fd-a3aa-6611d68ebd7d",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
......
{
"ver": "1.1.2",
"uuid": "abdd0429-2d86-480b-bdbf-23edfabc9fb6",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
/**
* 游戏数据中心
*/
import { Singleton } from "../Common/Utils/Singleton";
import { randArr } from "./../Common/Utils/util";
export class DCGame extends Singleton {
private _data: ObjData; //配置数据
//临时数据
private m_nQuestionIdx = 0; //当前问题Idx
private m_objOption: cc.Node; //目标节点
//游戏数据
private m_optionArr: Array<Option>;//选项列表 当前小题的所有选项
//初始化数据
initData() {
this.questionIdx = 0;
this.m_objOption = null;
this.m_optionArr = [];
this.setOptionArr();
}
//表单配置数据
set data(value: any) {
this._data = value;
}
get data(): ObjData {
return this._data;
}
//设置游戏问题ID
public get questionIdx() {
return this.m_nQuestionIdx;
}
public set questionIdx(value) {
this.m_nQuestionIdx = value;
}
//设置目标节点
public get objOption() {
return this.m_objOption;
}
public set objOption(value) {
this.m_objOption = value;
}
//获得开始引导音频
getAudioBegin() {
if (!this.data.guideBegin_audio_url) return "";
return this.data.guideBegin_audio_url;
}
// getAudioEnd() {
// if (!this.data.guideEnd_audio_url) return "";
// return this.data.guideEnd_audio_url;
// }
//获得重新开始音频
getAudioReStart() {
if (!this.data.guideRestart_audio_url) return "";
return this.data.guideRestart_audio_url;
}
//获得题目
getQuestionByIdx() {
let Idx = this.m_nQuestionIdx
return this.data.question_arr[Idx]
}
//获得题干音频
getQuestionAudioUrl() {
let Idx = this.m_nQuestionIdx
return this.data.question_arr[Idx].question_audio_url
}
//获得题干结束音频
getQuestionEndAudioUrl() {
let Idx = this.m_nQuestionIdx
return this.data.question_arr[Idx].question_audio_url_end;
}
//拿到组1数据
getGroup1() {
let question = this.getQuestionByIdx()
return question.group_arr_1
}
//拿到组1数据
getGroup2() {
let question = this.getQuestionByIdx()
return question.group_arr_2
}
//获得选项列表
getOptionArr() {
let Idx = this.m_nQuestionIdx
let arr = JSON.parse(JSON.stringify(this.data.question_arr[Idx].option_arr));
arr = randArr(arr)
return arr
}
//设置选项列表
setOptionArr() {
this.m_optionArr = this.getOptionArr();
}
//从选项列表中抽一个出来
getOption() {
return this.m_optionArr.pop();
}
}
export class ObjData {
guideBegin_audio_url: string = "";
// guideEnd_audio_url: string = "";
guideRestart_audio_url: string = "";
question_arr: Question[] = [];
}
export class Question {
question_audio_url: string = "";
question_audio_url_end: string = "";
group_arr_1: Group = new Group();
group_arr_2: Group = new Group();
option_arr: Option[] = [];
}
export class Group {
group_audio_url: string = "";
group_text: string = ""
}
export class Option {
option_text: string = "";
option_pic_url: string = "";
option_audio_url: string = "";
option_Idx: number = 0;
}
\ No newline at end of file
{
"ver": "1.0.8",
"uuid": "b8d87261-f4d4-4cda-8073-4375ad1961c9",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
/**
* 默认数据
*/
// export const defaultData = {
// "guideBegin_audio_url": "http://staging-teach.cdn.ireadabc.com/bd6e2b3a870ef3f9ee9ad9c0fda79228.mp3",
// "guideEnd_audio_url": "http://staging-teach.cdn.ireadabc.com/bd6e2b3a870ef3f9ee9ad9c0fda79228.mp3",
// "guideRestart_audio_url": "http://staging-teach.cdn.ireadabc.com/bd6e2b3a870ef3f9ee9ad9c0fda79228.mp3",
// //一共有四个题目
// "question_arr": [
// {
// "question_audio_url": "",
// "question_title": "",
// "option_arr": [
// {
// "option_text": "111",
// "option_pic_url": "http://staging-teach.cdn.ireadabc.com/f6ee3bc41ddc32451fffea9aa49a3b6c.png",
// "option_audio_url": "http://staging-teach.cdn.ireadabc.com/e3921a16a8313df274d8bc4e3f2bedd8.mp3",
// "option_Idx": 1,//方便后续扩展,
// },
// {
// "option_text": "222",
// "option_pic_url": "http://staging-teach.cdn.ireadabc.com/f6ee3bc41ddc32451fffea9aa49a3b6c.png",
// "option_audio_url": "http://staging-teach.cdn.ireadabc.com/e3921a16a8313df274d8bc4e3f2bedd8.mp3",
// "option_Idx": 1,//方便后续扩展,
// }]
// },
// {
// "question_audio_url": "",
// "question_title": "",
// "option_arr": [
// {
// "option_text": "777",
// "option_pic_url": "http://staging-teach.cdn.ireadabc.com/f6ee3bc41ddc32451fffea9aa49a3b6c.png",
// "option_audio_url": "http://staging-teach.cdn.ireadabc.com/e3921a16a8313df274d8bc4e3f2bedd8.mp3",
// "option_Idx": 1,//方便后续扩展,
// }]
// },
// ],
// "pic_url": "http://staging-teach.cdn.ireadabc.com/ed94332a503c31e0908bd4c6923a2665.png",
// "pic_url_2": "http://staging-teach.cdn.ireadabc.com/5fb60317ade0195d35ad8034d5370a7f.png",
// "text": "This is a test label.",
// "audio_url": "http://staging-teach.cdn.ireadabc.com/f47f1d7b5c160fe1c59500d180346240.mp3"
// }
export const defaultData = {
"guideBegin_audio_url": "http://staging-teach.cdn.ireadabc.com/e3921a16a8313df274d8bc4e3f2bedd8_l.mp3",
"guideEnd_audio_url": "http://staging-teach.cdn.ireadabc.com/e3921a16a8313df274d8bc4e3f2bedd8_l.mp3",
"guideRestart_audio_url": "http://staging-teach.cdn.ireadabc.com/e3921a16a8313df274d8bc4e3f2bedd8_l.mp3",
"question_arr": [
{
"question_audio_url": "http://staging-teach.cdn.ireadabc.com/e3921a16a8313df274d8bc4e3f2bedd8_l.mp3",
"question_audio_url_end": "http://staging-teach.cdn.ireadabc.com/e3921a16a8313df274d8bc4e3f2bedd8_l.mp3",
"group_arr_1": {
"group_audio_url": "http://staging-teach.cdn.ireadabc.com/e3921a16a8313df274d8bc4e3f2bedd8_l.mp3",
"group_text": "a"
},
"group_arr_2": {
"group_audio_url": "http://staging-teach.cdn.ireadabc.com/e3921a16a8313df274d8bc4e3f2bedd8_l.mp3",
"group_text": "b"
},
"option_arr": [
{
"option_text": "1",
"option_pic_url": "http://staging-teach.cdn.ireadabc.com/d71245eb42f7309a8db9b17378cf81cb.png",
"option_audio_url": "http://staging-teach.cdn.ireadabc.com/e3921a16a8313df274d8bc4e3f2bedd8_l.mp3",
"option_Idx": "1",
"undefined": "http://staging-teach.cdn.ireadabc.com/e3921a16a8313df274d8bc4e3f2bedd8_l.mp3"
},
{
"option_text": "2",
"option_pic_url": "http://staging-teach.cdn.ireadabc.com/d71245eb42f7309a8db9b17378cf81cb.png",
"option_audio_url": "http://staging-teach.cdn.ireadabc.com/e3921a16a8313df274d8bc4e3f2bedd8_l.mp3",
"option_Idx": "1"
},
{
"option_text": "3",
"option_pic_url": "http://staging-teach.cdn.ireadabc.com/0f081c3a21b129db0627e2110a64f711.png",
"option_audio_url": "http://staging-teach.cdn.ireadabc.com/e3921a16a8313df274d8bc4e3f2bedd8_l.mp3",
"option_Idx": "2"
},
{
"option_text": "4",
"option_pic_url": "http://staging-teach.cdn.ireadabc.com/0f081c3a21b129db0627e2110a64f711.png",
"option_audio_url": "http://staging-teach.cdn.ireadabc.com/e3921a16a8313df274d8bc4e3f2bedd8_l.mp3",
"option_Idx": "2"
}
]
},
{
"question_audio_url": "http://staging-teach.cdn.ireadabc.com/e3921a16a8313df274d8bc4e3f2bedd8_l.mp3",
"question_audio_url_end": "http://staging-teach.cdn.ireadabc.com/e3921a16a8313df274d8bc4e3f2bedd8_l.mp3",
"group_arr_1": {
"group_audio_url": "http://staging-teach.cdn.ireadabc.com/e3921a16a8313df274d8bc4e3f2bedd8_l.mp3",
"group_text": "aa"
},
"group_arr_2": {
"group_audio_url": "http://staging-teach.cdn.ireadabc.com/e3921a16a8313df274d8bc4e3f2bedd8_l.mp3",
"group_text": "bb"
},
"option_arr": [
{
"option_text": "aa",
"option_pic_url": "http://staging-teach.cdn.ireadabc.com/d71245eb42f7309a8db9b17378cf81cb.png",
"option_audio_url": "http://staging-teach.cdn.ireadabc.com/e3921a16a8313df274d8bc4e3f2bedd8_l.mp3",
"option_Idx": "1"
},
{
"option_text": "aa",
"option_pic_url": "http://staging-teach.cdn.ireadabc.com/d71245eb42f7309a8db9b17378cf81cb.png",
"option_audio_url": "http://staging-teach.cdn.ireadabc.com/e3921a16a8313df274d8bc4e3f2bedd8_l.mp3",
"option_Idx": "1"
},
{
"option_text": "bb",
"option_pic_url": "http://staging-teach.cdn.ireadabc.com/0f081c3a21b129db0627e2110a64f711.png",
"option_audio_url": "http://staging-teach.cdn.ireadabc.com/e3921a16a8313df274d8bc4e3f2bedd8_l.mp3",
"option_Idx": "2"
},
{
"option_text": "bb",
"option_pic_url": "http://staging-teach.cdn.ireadabc.com/0f081c3a21b129db0627e2110a64f711.png",
"option_audio_url": "http://staging-teach.cdn.ireadabc.com/e3921a16a8313df274d8bc4e3f2bedd8_l.mp3",
"option_Idx": "2"
}
]
}
]
}
\ No newline at end of file
{
"ver": "1.0.8",
"uuid": "63c8446f-de8a-42fc-bfa9-f1e97e347ab0",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.1.2",
"uuid": "4763bb18-22cd-46b0-ba85-9bd3f7a1abe8",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
//游戏主逻辑
import { DragGameAnswerObject } from "../Common/DragGame/DragGameAnswerObject";
import { DragGameOptionObject } from "../Common/DragGame/DragGameOptionObject";
import AssetMgr from "../Common/Module/AssetMgr/AssetMgr";
import EventMgr from "../Common/Module/EventMgr/EventMgr";
import { UICtrl } from "../Common/UICtrl/UICtrl";
import { DCGame } from "../DataCenter/DCGame";
import { ItemAnswer } from "./ItemAnswer";
const { ccclass, property } = cc._decorator;
@ccclass
export class Game extends UICtrl {
onLoad(): void {
super.onLoad();
//注册事件
this.regEvent();
//初始化组件节点
this.initProperty()
// //初始化游戏
// this.initGame();
}
protected onEnable(): void {
this.initGame();
}
protected onDestroy(): void {
//注销事件
this.unEvent();
}
private regEvent() {
this.unEvent();
EventMgr.reg("onRestart", this.onRestart.bind(this), 1)
EventMgr.reg("nextAnswer", this.OptionMove.bind(this), 1)
}
private unEvent() {
EventMgr.remove("onRestart")
EventMgr.remove("nextAnswer")
}
//
private nodQuestion: cc.Node;//问题节点
private itemQuestion: cc.Node;//问题预制节点
private dbCat: dragonBones.ArmatureDisplay;//猫咪龙骨
private dbLeaf: dragonBones.ArmatureDisplay;//撒树叶特效
private nodMask: cc.Node;//遮罩节点
private nodAnswer1: cc.Node;
private nodAnswer2: cc.Node;
//重新开始效果
private nodRestart: cc.Node;//重新开始游戏节点
private m_nowQuestion = [];//当前的题目的目标节点
private m_nowAnswer: cc.Node;//当前拖动选项
initProperty() {
this.nodQuestion = this.view["nodQuestion"];
this.itemQuestion = this.view["itemQuestion"];
this.dbCat = this.view["dbCat"].getComponent(dragonBones.ArmatureDisplay);
this.dbLeaf = this.view["dbLeaf"].getComponent(dragonBones.ArmatureDisplay);
this.nodMask = this.view["mask"];
this.nodAnswer1 = this.view["nodAnswer/nodAnswer1"];
this.nodAnswer2 = this.view["nodAnswer/nodAnswer2"];
this.nodRestart = this.view["nodRestart"]
}
//初始化游戏
initGame() {
//初始化数据
DCGame.getInstance().initData();
this.guideGame();
}
//重新开始游戏
onRestart() {
//要求直接销毁
let node = this.m_nowQuestion.shift();
node.destroy();
this.initGame();
}
//选项回收
OptionMove() {
let nodAnswer = DCGame.getInstance().questionIdx == 0 ? this.nodAnswer1 : this.nodAnswer2;
this.m_nowAnswer = nodAnswer;
cc.tween(this.m_nowAnswer)
.to(0.5, { y: 250 })
.call(() => {
//顺带初始化
this.onOptionFinish();
})
.start();
}
//选项出来
OptionCome() {
cc.tween(this.m_nowAnswer)
.call(() => {
this.m_nowAnswer.getChildByName("itemAnswer").getComponent(DragGameAnswerObject).setOldPosition();
})
.to(0.5, { y: 0 })
.start();
}
//先引导游戏
guideGame() {
//播放引导开始音频
let path = DCGame.getInstance().getAudioBegin();
if (!path)
return this.nodMask.active = false;
this.playAudioByUrl(path, "begin", () => {
this.nodMask.active = false;
//开始第一题
this.getNewQuestion();
//回收选项时初始化
this.OptionMove();
})
}
//new一个新的题目
getNewQuestion() {
this.carMove();
this.carCome();
}
//开始下一个选项
onOptionFinish() {
//获取下一个选项
let dmOption = DCGame.getInstance().getOption();
//判断是否还有选项
if (!dmOption) {
//判断是否游戏结束
if (DCGame.getInstance().questionIdx + 1 >= 2) {
//游戏结束
this.onGameFinish();
} else {
//获取下一个大题
this.getNextQuestion();
}
} else {
//获得下一个选项
this.getNextOption(dmOption);
}
}
//游戏结束
onGameFinish() {
//获得当前大题结束语音
let path = DCGame.getInstance().getQuestionEndAudioUrl();
// //游戏结束 播放撒花特效
// this.playLeaf();
//同时播放结束音频
this.playAudioByUrl(path, "begin", () => {
this.nodRestart.active = true;
});
return;
}
//获取下一个大题
getNextQuestion() {
//获得当前大题结束语音
let path = DCGame.getInstance().getQuestionEndAudioUrl();
DCGame.getInstance().questionIdx += 1;
//游戏未结束,开始下一大题
this.playAudioByUrl(path, "finish", () => {
//重新初始化大题选项数量
DCGame.getInstance().setOptionArr();
//获得一个新的大题
this.getNewQuestion();
//重新初始化头部选项
this.OptionMove();
})
}
//获得下一个选项
getNextOption(dmOption) {
//开始初始化选项
let com = this.m_nowAnswer.getChildByName("itemAnswer");
com.getComponent(ItemAnswer).setData(dmOption);
com.active = true;
//把当前正确的篮子节点保存起来
DCGame.getInstance().objOption = this.getOption(dmOption.option_Idx);
this.OptionCome();
}
//获得当前目标选项
getOption(Idx: number) {
return this.m_nowQuestion[0].getChildByName("nodBasket_" + Idx)
}
//车走了
carMove() {
let node = this.m_nowQuestion.shift()
if (!node)
return
cc.tween(node)
.to(1, { x: -1080 })
.call(() => {
node.destroy()
})
.start();
}
//车来了
carCome() {
//进入游戏
this.nodMask.active = true;
let Layer = cc.instantiate(this.itemQuestion);
this.m_nowQuestion.push(Layer);
this.initGroup();
Layer.x = 1080;
Layer.y = 0;
Layer.parent = this.nodQuestion;
Layer.active = true;
//移动(0,0)点
cc.tween(Layer)
.to(1, { x: 0 })
.call(() => {
//车子进来后播放题干音频
let path = DCGame.getInstance().getQuestionAudioUrl();
this.playAudioByUrl(path)
this.nodMask.active = false;
})
.start();
}
//初始化Group
initGroup() {
let grop1 = this.getOption(1).getComponent(DragGameOptionObject)
let grop2 = this.getOption(2).getComponent(DragGameOptionObject)
grop1.setData(DCGame.getInstance().getGroup1());
grop2.setData(DCGame.getInstance().getGroup2());
}
//点击猫
_tap_btnCheckCat() {
if (DCGame.getInstance().questionIdx >= 2 || this.nodRestart.active == true) {
//播放结束
let path = DCGame.getInstance().getAudioReStart();
if (!path) return;
this.playAudioByUrl(path);
} else {
let path = DCGame.getInstance().getQuestionAudioUrl();
if (!path) return;
this.playAudioByUrl(path);
}
}
//播放音频
playAudioByUrl(path: string, name: string = "begin", cb?: Function) {
this.playCatDragon("begin");
cb && (this.nodMask.active = true);
AssetMgr.playAudioByUrl(path, () => {
this.nodMask.active = false;
this.playCatDragon("normal");
cb && cb();
})
}
//猫咪龙骨
playCatDragon(name: string) {
this.dbCat.armatureName = "Armature";
this.dbCat.playAnimation(name, -1);
}
//播放撒树叶特效
playLeaf(cb?) {
this.dbLeaf.node.active = true;
this.dbLeaf.armatureName = "Armature";
this.dbLeaf.playAnimation("normal", 1);
cb && this.dbLeaf.addEventListener(dragonBones.EventObject.COMPLETE, cb);
}
}
{
"ver": "1.0.8",
"uuid": "534c053c-7aad-479b-a980-d430006e174a",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
const { ccclass, property } = cc._decorator;
import { DragGameAnswerObject } from "../Common/DragGame/DragGameAnswerObject";
import { DragGameOptionObject } from "../Common/DragGame/DragGameOptionObject";
import AssetMgr from "../Common/Module/AssetMgr/AssetMgr";
import { DCGame, Option } from "../DataCenter/DCGame";
import { UICtrl } from "./../Common/UICtrl/UICtrl";
@ccclass
export class ItemAnswer extends UICtrl {
onLoad(): void {
super.onLoad();
this.initProperty();
this.updateUI();
}
//
private labText: cc.Label;//文字节点
private sptPhoto: cc.Sprite;//图片节点
private dmOption: Option;
private DragGameAnswerObject;
initProperty() {
this.labText = this.view["nodText/labText"]?.getComponent(cc.Label);
this.sptPhoto = this.view["nodPhoto/sptPhoto"]?.getComponent(cc.Sprite);
this.DragGameAnswerObject = this.node.getComponent(DragGameAnswerObject)
}
setData(value: Option) {
this.dmOption = value;
this.updateUI();
this.DragGameAnswerObject.setData(value);
}
//更新界面使用
updateUI(): void {
if (!this.dmOption) return;
//设置Label文字
this.labText && this.setText();
//设置图片
this.sptPhoto && this.setPhoto();
};
//设置labText
setText() {
let value = this.dmOption.option_text
this.labText.string = value;
}
//设置图片
setPhoto() {
let value = this.dmOption.option_pic_url
AssetMgr.getSpriteFrimeByUrl(value, (spriteFrame) => {
this.sptPhoto.node.x = 0;
this.sptPhoto.node.y = 0;
this.sptPhoto.spriteFrame = spriteFrame
this.photoScare(this.sptPhoto.node, 100);
})
}
//
AnswerRightEffect_1() {
let objOption = DCGame.getInstance().objOption
//文字变红
this.labText.node.color = cc.Color.RED;
//放到目标点位置
//放大
cc.tween(this.node)
.to(0.4, { scale: 1.5 })
.call(() => {
let nodText = cc.instantiate(this.labText.node);
objOption.getComponent(DragGameOptionObject).Effect_1(nodText, this.dmOption);
this.node.active = false;
this.labText.node.color = cc.Color.WHITE;
// this.DragGameAnswerObject.setOldPosition();
})
.start();
}
//效果2
AnswerRightEffect_2() {
//效果2
console.log("效果2");
//拷贝节点放在原来的地方
let objOption = DCGame.getInstance().objOption
let nodPic = cc.instantiate(this.sptPhoto.node);
objOption.getComponent(DragGameOptionObject).Effect_2(nodPic, this.dmOption);
this.node.active = false;
// this.DragGameAnswerObject.setOldPosition();
}
}
{
"ver": "1.0.8",
"uuid": "1c4f2550-27e1-44f3-8ccc-eb0b06e7f1d0",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
import AssetMgr from "../Common/Module/AssetMgr/AssetMgr";
import AudioMgr from "../Common/Module/AudioMgr/AudioMgr";
import { randFromTo_Int } from "../Common/Utils/util";
/**
* 音效使用
*/
//游戏音效枚举
export enum E_AudioName {
BTN = "btn",
ENDEFFECT = "endEffect"
}
export class Speaker {
//播放音效
// public static playEffect(name) {
// AssetMgr.loadAudio("Audios", name).then((clip) => {
// AudioMgr.playEffect(clip, false);
// })
// let clip = this.getClip();
// }
//播放正确音效
public static playRightEffect(cb?: Function) {
//随机
let name = "right" + randFromTo_Int(0, 2);
this.playEffect(name, cb);
// AssetMgr.loadAudio("Audios", name).then((clip) => {
// AudioMgr.playEffect(clip, false, cb);
// })
}
//播放失败音效
public static playErrorEffect(cb?: Function) {
//随机
let name = "wrong" + randFromTo_Int(0, 2);
this.playEffect(name, cb);
// AssetMgr.loadAudio("Audios", name).then((clip) => {
// AudioMgr.playEffect(clip, false, cb);
// })
}
public static playEffect(audioName, cb?) {
const audio = cc.find(`Canvas/nodRes/audio/${audioName}`).getComponent(cc.AudioSource);
AudioMgr.playEffect(audio.clip, false, cb)
}
}
\ No newline at end of file
{
"ver": "1.0.8",
"uuid": "64dc5fe8-47dc-4e10-87fe-00ae7c77d0c9",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
const { ccclass, property } = cc._decorator;
import EventMgr from "../Common/Module/EventMgr/EventMgr";
import { UICtrl } from "./../Common/UICtrl/UICtrl";
@ccclass
export class nodRestart extends UICtrl {
onLoad(): void {
super.onLoad();
//初始化组件节点
this.initProperty()
}
//重新开始效果
private sptCircle: cc.Node;
initProperty() {
this.sptCircle = this.view["sptCircle"]
}
onEnable() {
this.showRestartBtn();
}
onDisable() {
this.hideRestartBtn();
}
//重新开始特效
showRestartBtn() {
cc.tween(this.sptCircle)
.set({ scale: 0.8 * 0.6, opacity: 255 })
.to(2, { scale: 1.2 * 0.6, opacity: 0 })
.union()
.repeatForever()
.start();
}
//关闭重新开始特效
hideRestartBtn() {
this.sptCircle.stopAllActions();
this.sptCircle.scale = 0.8 * 0.6;
this.sptCircle.opacity = 255;
}
//重新开始
_tap_btnRestart() {
EventMgr.emit("onRestart");
this.node.active = false;
}
}
{
"ver": "1.0.8",
"uuid": "d1027847-2e91-4f0d-bfc0-cdf999e70d8c",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
const { ccclass, property } = cc._decorator;
@ccclass
export default class nodSptStar extends cc.Component {
@property
private starNum: number = 0;
private _timeoutIds: any[];
onLoad() {
this._timeoutIds = [];
this.node.scale = 0;
this.node.opacity = 0;
}
onDestroy(): void {
this._timeoutIds.forEach(id => {
clearTimeout(id);
});
}
start() {
console.log(this.starNum);
this._timeoutIds.push(setTimeout(() => {
this.showScale();
}, this.starNum * 1000))
}
//重新开始特效
showScale() {
cc.tween(this.node)
.to(1, { scale: 1, opacity: 255 })
.delay(0.7)
.to(1, { scale: 0, opacity: 0 })
.delay(2)
.union()
.repeatForever()
.start();
}
}
{
"ver": "1.0.8",
"uuid": "fbd60d1a-e26a-4059-87ec-9b0f4dff5e9d",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.1.2",
"uuid": "0a45a06a-8320-48b3-a7c7-e23d24efbf5a",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.1.2",
"uuid": "ddc9c695-f0d5-4883-9117-f16bc38f255d",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.0.1",
"uuid": "d24b00bf-dbd3-4258-8628-829d5da4cceb",
"subMetas": {}
}
\ No newline at end of file
{
"width": 32,
"SubTexture": [
{
"width": 28,
"y": 1,
"height": 53,
"name": "树叶",
"x": 1
}
],
"height": 64,
"name": "OP67_leaf",
"imagePath": "OP67_leaf_tex.png"
}
\ No newline at end of file
{
"ver": "1.0.1",
"uuid": "c9d8b4a9-7356-4397-9451-e51c8bae1695",
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "92eff851-af00-4f7f-b9ce-1a292d12114c",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 32,
"height": 64,
"platformSettings": {},
"subMetas": {
"OP67_leaf_tex": {
"ver": "1.0.4",
"uuid": "b0425e77-0ecd-4650-9386-290670951412",
"rawTextureUuid": "92eff851-af00-4f7f-b9ce-1a292d12114c",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": -1,
"offsetY": 4.5,
"trimX": 1,
"trimY": 1,
"width": 28,
"height": 53,
"rawWidth": 32,
"rawHeight": 64,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "1.1.2",
"uuid": "a23de010-e0f4-448f-9543-9023edb21c93",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
{
"frameRate": 24,
"name": "bee",
"version": "5.5",
"compatibleVersion": "5.5",
"armature": [
{
"type": "Armature",
"frameRate": 24,
"name": "Armature",
"aabb": {
"x": -82,
"y": -48,
"width": 152,
"height": 108
},
"bone": [
{
"name": "root"
},
{
"length": 38,
"name": "bone",
"parent": "root",
"transform": {
"x": 14.25,
"y": 13.6,
"skX": -34.5275,
"skY": -34.5275
}
},
{
"length": 52,
"name": "__87",
"parent": "bone",
"transform": {
"x": 2.5325,
"y": 4.17,
"skX": -139.3317,
"skY": -139.3317
}
},
{
"length": 42,
"name": "__89",
"parent": "bone",
"transform": {
"x": 7.3132,
"y": 8.248,
"skX": 59.9185,
"skY": 59.9185
}
},
{
"length": 18,
"name": "__91",
"parent": "__87",
"transform": {
"x": 39.7144,
"y": 13.4287,
"skX": 47.6721,
"skY": 47.6721
}
},
{
"length": 16,
"name": "__90",
"parent": "__87",
"transform": {
"x": 49.7942,
"y": 9.4275,
"skX": 19.7395,
"skY": 19.7395
}
},
{
"length": 45,
"name": "__88(2)",
"parent": "__87",
"transform": {
"x": 8.2957,
"y": 16.809,
"skX": 137.4857,
"skY": 137.4857
}
},
{
"length": 42,
"name": "__88",
"parent": "__87",
"transform": {
"x": 14.5794,
"y": 16.7867,
"skX": 46.826,
"skY": 46.826
}
}
],
"slot": [
{
"name": "__89",
"parent": "__89"
},
{
"name": "__87",
"parent": "__87"
},
{
"name": "__90",
"parent": "__90"
},
{
"name": "__91",
"parent": "__91"
},
{
"name": "__88",
"parent": "__88"
},
{
"name": "__88(2)",
"parent": "__88(2)"
}
],
"skin": [
{
"slot": [
{
"name": "__87",
"display": [
{
"name": "蜜蜂原地飞_尾巴一抖一抖翅膀快速扇动触角缓慢摆动/__87",
"transform": {
"x": 6.49,
"y": -11.66,
"skX": 173.86,
"skY": 173.86
}
}
]
},
{
"name": "__89",
"display": [
{
"name": "蜜蜂原地飞_尾巴一抖一抖翅膀快速扇动触角缓慢摆动/__89",
"transform": {
"x": 19.63,
"y": -0.74,
"skX": -25.39,
"skY": -25.39
}
}
]
},
{
"name": "__88",
"display": [
{
"name": "蜜蜂原地飞_尾巴一抖一抖翅膀快速扇动触角缓慢摆动/__88",
"transform": {
"x": 25.98,
"y": 0.18,
"skX": 127.03,
"skY": 127.03
}
}
]
},
{
"name": "__88(2)",
"display": [
{
"name": "蜜蜂原地飞_尾巴一抖一抖翅膀快速扇动触角缓慢摆动/__88(2)",
"transform": {
"x": 27.7,
"y": -0.09,
"skX": 36.37,
"skY": 36.37
}
}
]
},
{
"name": "__91",
"display": [
{
"name": "蜜蜂原地飞_尾巴一抖一抖翅膀快速扇动触角缓慢摆动/__91",
"transform": {
"x": 19.86,
"y": -11.06,
"skX": 126.19,
"skY": 126.19
}
}
]
},
{
"name": "__90",
"display": [
{
"name": "蜜蜂原地飞_尾巴一抖一抖翅膀快速扇动触角缓慢摆动/__90",
"transform": {
"x": 24.14,
"y": -6.82,
"skX": 154.12,
"skY": 154.12
}
}
]
}
]
}
],
"animation": [
{
"duration": 24,
"playTimes": 0,
"name": "normal",
"bone": [
{
"name": "bone",
"translateFrame": [
{
"duration": 6,
"tweenEasing": 0
},
{
"duration": 6,
"tweenEasing": 0,
"y": -4.79
},
{
"duration": 6,
"tweenEasing": 0
},
{
"duration": 6,
"tweenEasing": 0,
"y": -4.79
},
{
"duration": 0
}
]
},
{
"name": "__89",
"rotateFrame": [
{
"duration": 4,
"tweenEasing": 0
},
{
"duration": 4,
"tweenEasing": 0,
"rotate": 11.02
},
{
"duration": 4,
"tweenEasing": 0
},
{
"duration": 4,
"tweenEasing": 0,
"rotate": 11.02
},
{
"duration": 4,
"tweenEasing": 0
},
{
"duration": 4,
"tweenEasing": 0,
"rotate": 11.02
},
{
"duration": 0
}
]
},
{
"name": "__91",
"rotateFrame": [
{
"duration": 4,
"tweenEasing": 0
},
{
"duration": 4,
"tweenEasing": 0,
"rotate": 6.21
},
{
"duration": 4,
"tweenEasing": 0
},
{
"duration": 4,
"tweenEasing": 0,
"rotate": 6.21
},
{
"duration": 4,
"tweenEasing": 0
},
{
"duration": 4,
"tweenEasing": 0,
"rotate": 6.21
},
{
"duration": 0
}
]
},
{
"name": "__90",
"rotateFrame": [
{
"duration": 4,
"tweenEasing": 0
},
{
"duration": 4,
"tweenEasing": 0,
"rotate": 6.21
},
{
"duration": 4,
"tweenEasing": 0
},
{
"duration": 4,
"tweenEasing": 0,
"rotate": 6.21
},
{
"duration": 4,
"tweenEasing": 0
},
{
"duration": 4,
"tweenEasing": 0,
"rotate": 6.21
},
{
"duration": 0
}
]
},
{
"name": "__88(2)",
"rotateFrame": [
{
"duration": 2,
"tweenEasing": 0,
"rotate": 12.75
},
{
"duration": 2,
"tweenEasing": 0,
"rotate": -28.92
},
{
"duration": 2,
"tweenEasing": 0,
"rotate": 12.75
},
{
"duration": 2,
"tweenEasing": 0,
"rotate": -28.92
},
{
"duration": 2,
"tweenEasing": 0,
"rotate": 12.75
},
{
"duration": 2,
"tweenEasing": 0,
"rotate": -28.92
},
{
"duration": 2,
"tweenEasing": 0,
"rotate": 12.75
},
{
"duration": 2,
"tweenEasing": 0,
"rotate": -28.92
},
{
"duration": 2,
"tweenEasing": 0,
"rotate": 12.75
},
{
"duration": 2,
"tweenEasing": 0,
"rotate": -28.92
},
{
"duration": 2,
"tweenEasing": 0,
"rotate": 12.75
},
{
"duration": 2,
"tweenEasing": 0,
"rotate": -28.92
},
{
"duration": 0,
"rotate": 12.75
}
]
},
{
"name": "__88",
"rotateFrame": [
{
"duration": 2,
"tweenEasing": 0,
"rotate": -11.65
},
{
"duration": 2,
"tweenEasing": 0,
"rotate": 27.41
},
{
"duration": 2,
"tweenEasing": 0,
"rotate": -11.65
},
{
"duration": 2,
"tweenEasing": 0,
"rotate": 27.41
},
{
"duration": 2,
"tweenEasing": 0,
"rotate": -11.65
},
{
"duration": 2,
"tweenEasing": 0,
"rotate": 27.41
},
{
"duration": 2,
"tweenEasing": 0,
"rotate": -11.65
},
{
"duration": 2,
"tweenEasing": 0,
"rotate": 27.41
},
{
"duration": 2,
"tweenEasing": 0,
"rotate": -11.65
},
{
"duration": 2,
"tweenEasing": 0,
"rotate": 27.41
},
{
"duration": 2,
"tweenEasing": 0,
"rotate": -11.65
},
{
"duration": 2,
"tweenEasing": 0,
"rotate": 27.41
},
{
"duration": 0,
"rotate": -11.65
}
]
}
]
}
],
"defaultActions": [
{
"gotoAndPlay": "normal"
}
]
}
]
}
\ No newline at end of file
{
"ver": "1.0.1",
"uuid": "641426d7-2663-46de-81be-c98ff36c3a06",
"subMetas": {}
}
\ No newline at end of file
{
"SubTexture": [
{
"width": 54,
"y": 70,
"height": 50,
"name": "蜜蜂原地飞_尾巴一抖一抖翅膀快速扇动触角缓慢摆动/__89",
"x": 1
},
{
"width": 102,
"y": 1,
"height": 67,
"name": "蜜蜂原地飞_尾巴一抖一抖翅膀快速扇动触角缓慢摆动/__87",
"x": 1
},
{
"width": 55,
"y": 166,
"height": 13,
"name": "蜜蜂原地飞_尾巴一抖一抖翅膀快速扇动触角缓慢摆动/__90",
"x": 1
},
{
"width": 44,
"y": 122,
"height": 27,
"name": "蜜蜂原地飞_尾巴一抖一抖翅膀快速扇动触角缓慢摆动/__91",
"x": 1
},
{
"width": 39,
"y": 115,
"height": 49,
"name": "蜜蜂原地飞_尾巴一抖一抖翅膀快速扇动触角缓慢摆动/__88",
"x": 57
},
{
"width": 53,
"y": 70,
"height": 43,
"name": "蜜蜂原地飞_尾巴一抖一抖翅膀快速扇动触角缓慢摆动/__88(2)",
"x": 57
}
],
"width": 128,
"height": 256,
"name": "bee",
"imagePath": "bee_tex.png"
}
\ No newline at end of file
{
"ver": "1.0.1",
"uuid": "4e8aaa63-25fc-42a0-a1e7-4fe991d4de9d",
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "b0ad4660-4fc7-4d67-91df-c67224576540",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 128,
"height": 256,
"platformSettings": {},
"subMetas": {
"bee_tex": {
"ver": "1.0.4",
"uuid": "25d96505-e62b-401d-804c-3a5b1b81d6d3",
"rawTextureUuid": "b0ad4660-4fc7-4d67-91df-c67224576540",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": -8.5,
"offsetY": 38,
"trimX": 1,
"trimY": 1,
"width": 109,
"height": 178,
"rawWidth": 128,
"rawHeight": 256,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "1.1.2",
"uuid": "d695c495-db5f-4f13-84a5-380cd568432a",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
This diff is collapsed.
{
"ver": "1.0.1",
"uuid": "40ba7c63-28ad-4831-a3b3-3795eba045da",
"subMetas": {}
}
\ No newline at end of file
{"name":"mao","imagePath":"mao_tex.png","SubTexture":[{"name":"猫01/影子","x":1,"height":66,"y":343,"width":337},{"name":"猫01/尾巴","x":1,"height":109,"y":188,"width":175},{"name":"猫01/右腿","x":178,"height":117,"y":188,"width":104},{"name":"猫01/左腿","x":1,"height":115,"y":569,"width":64},{"name":"猫01/右手","x":427,"height":122,"y":590,"width":69},{"name":"猫01/左手","x":301,"height":74,"y":590,"width":124},{"name":"猫01伸/左手伸直","x":299,"height":169,"y":172,"width":168},{"name":"猫01伸/右手伸直","x":299,"height":169,"y":1,"width":168},{"name":"猫01/身体","x":340,"height":180,"y":343,"width":122},{"name":"猫01/领带","x":1,"height":156,"y":411,"width":120},{"name":"猫01/右耳","x":155,"height":76,"y":602,"width":90},{"name":"猫01/左耳","x":67,"height":85,"y":602,"width":86},{"name":"猫01/组_1","x":1,"height":185,"y":1,"width":296},{"name":"猫01/右眼","x":1,"height":60,"y":686,"width":59},{"name":"猫01/右眉毛","x":67,"height":5,"y":595,"width":33},{"name":"猫01/左眼","x":247,"height":60,"y":666,"width":59},{"name":"猫01/左眉毛","x":247,"height":12,"y":602,"width":31},{"name":"猫01/眼镜","x":301,"height":63,"y":525,"width":170},{"name":"猫01/胡子","x":123,"height":85,"y":515,"width":176},{"name":"猫01/鼻子","x":67,"height":24,"y":569,"width":28},{"name":"猫01/嘴","x":1,"height":30,"y":299,"width":65},{"name":"猫01/帽子","x":123,"height":102,"y":411,"width":158}],"height":1024,"width":512}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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