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

init branch OPT

parent ae8bab5a
{
"ver": "1.1.3",
"uuid": "2801a2f4-59c0-4edb-b1bb-df8afd2b71d3",
"importer": "folder",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
This diff is collapsed.
{
"ver": "1.3.2",
"uuid": "c035ce77-4ebb-4255-94ff-c5a64737b575",
"importer": "prefab",
"optimizationPolicy": "AUTO",
"asyncLoadAssets": false,
"readonly": false,
"subMetas": {}
}
\ No newline at end of file
This diff is collapsed.
{
"ver": "1.3.2",
"uuid": "f6c31663-b4ec-4a86-bf0f-48a96158db5f",
"importer": "prefab",
"optimizationPolicy": "AUTO",
"asyncLoadAssets": false,
"readonly": false,
"subMetas": {}
}
\ No newline at end of file
This diff is collapsed.
{
"ver": "1.3.2",
"uuid": "88c28e89-077d-4fdc-bb6c-dfa486e59e47",
"importer": "prefab",
"optimizationPolicy": "AUTO",
"asyncLoadAssets": false,
"readonly": false,
"subMetas": {}
}
\ No newline at end of file
This diff is collapsed.
{ {
"ver": "2.3.7", "ver": "2.3.7",
"uuid": "74c3b388-ebcf-4537-890d-b33d28f8bb61", "uuid": "7c20f152-6cd7-4f68-81be-0ce5e6186ab3",
"importer": "texture", "importer": "texture",
"type": "sprite", "type": "sprite",
"wrapMode": "clamp", "wrapMode": "clamp",
...@@ -8,15 +8,15 @@ ...@@ -8,15 +8,15 @@
"premultiplyAlpha": false, "premultiplyAlpha": false,
"genMipmaps": false, "genMipmaps": false,
"packable": true, "packable": true,
"width": 1080, "width": 649,
"height": 1920, "height": 867,
"platformSettings": {}, "platformSettings": {},
"subMetas": { "subMetas": {
"bg": { "bg-dh": {
"ver": "1.0.6", "ver": "1.0.6",
"uuid": "d013e226-852c-4d39-b953-daef9f74c4c0", "uuid": "f8db3cf8-4cbc-46be-9800-2435df7507be",
"importer": "sprite-frame", "importer": "sprite-frame",
"rawTextureUuid": "74c3b388-ebcf-4537-890d-b33d28f8bb61", "rawTextureUuid": "7c20f152-6cd7-4f68-81be-0ce5e6186ab3",
"trimType": "auto", "trimType": "auto",
"trimThreshold": 1, "trimThreshold": 1,
"rotated": false, "rotated": false,
...@@ -24,10 +24,10 @@ ...@@ -24,10 +24,10 @@
"offsetY": 0, "offsetY": 0,
"trimX": 0, "trimX": 0,
"trimY": 0, "trimY": 0,
"width": 1080, "width": 649,
"height": 1920, "height": 867,
"rawWidth": 1080, "rawWidth": 649,
"rawHeight": 1920, "rawHeight": 867,
"borderTop": 0, "borderTop": 0,
"borderBottom": 0, "borderBottom": 0,
"borderLeft": 0, "borderLeft": 0,
......
{
"ver": "2.3.7",
"uuid": "112b1a68-50e2-4aed-87ae-37e45a54a3b7",
"importer": "texture",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 2000,
"height": 1747,
"platformSettings": {},
"subMetas": {
"fog-2666": {
"ver": "1.0.6",
"uuid": "af6128c8-5e39-43ac-88d9-87aef1f2058d",
"importer": "sprite-frame",
"rawTextureUuid": "112b1a68-50e2-4aed-87ae-37e45a54a3b7",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 2000,
"height": 1747,
"rawWidth": 2000,
"rawHeight": 1747,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.7",
"uuid": "eb42207e-d039-43d2-aa84-1cfaeafa48b5",
"importer": "texture",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 594,
"height": 752,
"platformSettings": {},
"subMetas": {
"photo_2025-04-27_23-45-28": {
"ver": "1.0.6",
"uuid": "13fedb3e-e14d-42ad-acfd-3708ad20bed3",
"importer": "sprite-frame",
"rawTextureUuid": "eb42207e-d039-43d2-aa84-1cfaeafa48b5",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 594,
"height": 752,
"rawWidth": 594,
"rawHeight": 752,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.7",
"uuid": "3a58b0c7-4dff-4a36-a825-e77609ea181a",
"importer": "texture",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 1080,
"height": 1920,
"platformSettings": {},
"subMetas": {
"4 1": {
"ver": "1.0.6",
"uuid": "9dbb2449-d0bd-437d-842e-4d53c29fedf0",
"importer": "sprite-frame",
"rawTextureUuid": "3a58b0c7-4dff-4a36-a825-e77609ea181a",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 1080,
"height": 1920,
"rawWidth": 1080,
"rawHeight": 1920,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{ {
"ver": "2.0.3", "ver": "2.0.3",
"uuid": "4f4a1f56-3743-4d39-83a3-41c6314e6b4e", "uuid": "a61f36bb-65e5-43e9-82b6-5a8d59050d31",
"importer": "audio-clip", "importer": "audio-clip",
"downloadMode": 0, "downloadMode": 0,
"duration": 30.975397, "duration": 31.033469,
"subMetas": {} "subMetas": {}
} }
\ No newline at end of file
const { ccclass, property } = cc._decorator;
@ccclass
export default class Main extends cc.Component {
private _bg: cc.Sprite = null;
private _x: number = 0;
private _y: number = 0;
private _z: number = 0;
private _count = 0;
private _isShake = false;
protected onLoad(): void {
// this.onSkew();
}
private onSkew() {
this._bg = this.node.getComponentInChildren(cc.Sprite);
function createBottleSpinAnimation(node) {
cc.resources.loadDir("Anim_MB", cc.SpriteFrame, (err, spriteFrames) => {
if (err) {
console.error("Lỗi load ảnh:", err);
return;
}
let clip = cc.AnimationClip.createWithSpriteFrames(spriteFrames, spriteFrames.length);
console.log('spriteFrames.length', spriteFrames.length)
clip.name = "bottleSpin";
clip.wrapMode = cc.WrapMode.Loop; // Lặp vô hạn
clip.speed = 1; // Tốc độ chạy animation (1 giây/lượt)
let animation = node.getComponent(cc.Animation) || node.addComponent(cc.Animation);
animation.addClip(clip);
animation.play("bottleSpin");
});
}
createBottleSpinAnimation(this._bg.node);
}
protected start(): void {
this.scheduleOnce(() => {
this.setShake();
}, 2)
}
private setShake() {
window.addEventListener("devicemotion", (event) => {
if (!event.accelerationIncludingGravity) {
return;
}
const x = event.accelerationIncludingGravity.x;
const y = event.accelerationIncludingGravity.y;
const z = event.accelerationIncludingGravity.z;
if (x - this._x > 5 || y - this._y > 5 || z - this._z > 5) {
if (this._isShake) {
this._count++;
}
}
if (x - this._x < -5 || y - this._y < -5 || z - this._z < -5) {
if (!this._isShake) {
this._count++;
}
}
if (this._count > 0) {
this.scheduleOnce(() => {
this._count = 0;
}, 1.5)
}
if (this._count > 5) {
this._count = 0;
cc.tween(this._bg.node)
.to(0.2, { position: cc.v3(20, 0, 0) })
.to(0.2, { position: cc.v3(-20, 0, 0) })
.to(0.2, { position: cc.v3(20, 0, 0) })
.to(0.2, { position: cc.v3(-20, 0, 0) })
.to(0.2, { position: cc.v3(0, 0, 0) })
.start();
}
this._x = x;
this._y = y;
this._z = z;
});
}
}
const { ccclass, property } = cc._decorator;
@ccclass
export default class Main extends cc.Component {
@property(cc.Prefab)
private startScreenPrefab: cc.Prefab = null;
@property(cc.Prefab)
private gamePlayScreenPrefab: cc.Prefab = null;
@property(cc.Prefab)
private cardPopupPrefab: cc.Prefab = null;
protected start(): void {
this.node.addChild(cc.instantiate(this.startScreenPrefab));
this.node.addChild(cc.instantiate(this.gamePlayScreenPrefab));
this.node.addChild(cc.instantiate(this.cardPopupPrefab));
}
}
{ {
"ver": "1.1.0", "ver": "1.1.0",
"uuid": "5c17d568-04ac-4dfa-8b19-0c4f9c2ba13d", "uuid": "6ea6bfd9-7d62-4e7b-b40d-7fc72135d194",
"importer": "typescript", "importer": "typescript",
"isPlugin": false, "isPlugin": false,
"loadPluginInWeb": true, "loadPluginInWeb": true,
......
{ {
"last-module-event-record-time": 1746606709842 "last-module-event-record-time": 1746606709842,
"group-list": [
"default"
],
"collision-matrix": [
[
true
]
],
"excluded-modules": [
"Dynamic Atlas",
"DragonBones",
"EditBox",
"Geom Utils",
"Layout",
"Label Effect",
"Mesh",
"MotionStreak",
"NodePool",
"Native Socket",
"PageView",
"PageViewIndicator",
"ProgressBar",
"RichText",
"Renderer Texture",
"Slider",
"ScrollBar",
"ScrollView",
"StudioComponent",
"Toggle",
"TiledMap",
"VideoPlayer",
"Widget",
"WebView",
"3D",
"3D Primitive",
"3D Physics/cannon.js",
"3D Physics/Builtin",
"3D Particle",
"SafeArea"
],
"preview-port": 7456,
"design-resolution-width": 960,
"design-resolution-height": 640,
"fit-width": false,
"fit-height": true,
"use-project-simulator-setting": false,
"simulator-orientation": false,
"use-customize-simulator": true,
"simulator-resolution": {
"width": 960,
"height": 640
},
"clear-simulator-cache": true,
"facebook": {
"enable": false,
"appID": "",
"live": {
"enable": false
},
"audience": {
"enable": false
}
}
} }
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