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

update card

parent 90249662
This diff is collapsed.
{
"ver": "1.1.3",
"uuid": "4d5ab8f4-cc6a-45d9-b1ba-786cf27276b8",
"importer": "folder",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
The.png
size: 1508,1508
format: RGBA8888
filter: Linear,Linear
repeat: none
open/Box
rotate: true
xy: 1084, 1064
size: 441, 421
orig: 441, 421
offset: 0, 0
index: -1
open/Star
rotate: true
xy: 1084, 99
size: 154, 157
orig: 154, 157
offset: 0, 0
index: -1
open/girf_2
rotate: false
xy: 1084, 255
size: 364, 364
orig: 364, 364
offset: 0, 0
index: -1
open/light
rotate: false
xy: 2, 112
size: 1080, 1393
orig: 1080, 1393
offset: 0, 0
index: -1
open/the
rotate: true
xy: 1084, 621
size: 441, 421
orig: 441, 421
offset: 0, 0
index: -1
{
"ver": "1.0.3",
"uuid": "3528a632-9d9c-4ba1-a2cd-6ece1c92c4bf",
"importer": "asset",
"subMetas": {}
}
\ No newline at end of file
This diff is collapsed.
{
"ver": "1.2.5",
"uuid": "c7779876-e7ea-4a74-8ed6-5e9ac1ca0175",
"importer": "spine",
"textures": [
"d061a051-f6e1-488a-9ca8-b331cfb97f1f"
],
"scale": 1,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.3.7",
"uuid": "d061a051-f6e1-488a-9ca8-b331cfb97f1f",
"importer": "texture",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 1508,
"height": 1508,
"platformSettings": {},
"subMetas": {
"The": {
"ver": "1.0.6",
"uuid": "16811471-9dce-4883-bf40-e256e53aa6dd",
"importer": "sprite-frame",
"rawTextureUuid": "d061a051-f6e1-488a-9ca8-b331cfb97f1f",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": -5.5,
"offsetY": -28.5,
"trimX": 19,
"trimY": 99,
"width": 1459,
"height": 1367,
"rawWidth": 1508,
"rawHeight": 1508,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
...@@ -5,6 +5,8 @@ const { ccclass, property } = cc._decorator; ...@@ -5,6 +5,8 @@ const { ccclass, property } = cc._decorator;
@ccclass @ccclass
export default class HuController extends cc.Component { export default class HuController extends cc.Component {
@property(sp.Skeleton)
private spine2: sp.Skeleton = null;
private _spine: sp.Skeleton = null; private _spine: sp.Skeleton = null;
private _pointStart: cc.Vec2 = null; private _pointStart: cc.Vec2 = null;
......
...@@ -4,19 +4,31 @@ const { ccclass, property } = cc._decorator; ...@@ -4,19 +4,31 @@ const { ccclass, property } = cc._decorator;
@ccclass @ccclass
export default class TheController extends cc.Component { export default class TheController extends cc.Component {
@property([cc.SpriteFrame])
private frames: cc.SpriteFrame[] = [];
private _spine: sp.Skeleton = null; private _spine: sp.Skeleton = null;
private _skins: string[] = ["goi", "the"];
private _textSprite: cc.Sprite = null;
protected onLoad(): void { protected onLoad(): void {
this._textSprite = this.getComponentInChildren(cc.Sprite);
this._spine = this.node.getComponent(sp.Skeleton); this._spine = this.node.getComponent(sp.Skeleton);
this._spine.setCompleteListener((trackEntry) => { this._spine.setCompleteListener((trackEntry) => {
if (trackEntry.animation.name == 'Open') { if (trackEntry.animation.name == 'Open') {
this._spine.setAnimation(0, 'Idle', true); this._spine.setAnimation(0, 'Idle', true);
console.log('Idle', )
} }
}) })
} }
protected onEnable(): void { protected onEnable(): void {
this._spine.setAnimation(0, 'Open', false); this._spine.setAnimation(0, 'Open', false);
this._spine.timeScale = 0.5;
const skinIndex = this.getRandomInt(0, this._skins.length);
this._spine.setSkin(this._skins[skinIndex]);
this._textSprite.spriteFrame = this.frames[skinIndex];
}
private getRandomInt(min: number, max: number): number {
return Math.floor(Math.random() * (max - min)) + min;
} }
} }
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