main
cuongnm2 2024-04-19 17:49:41 +07:00
commit 136092a623
326 changed files with 641416 additions and 0 deletions

View File

@ -0,0 +1,2 @@
[InternetShortcut]
URL=https://docs.cocos.com/creator/manual/en/scripting/setup.html#custom-script-template

97
.gitignore vendored Normal file
View File

@ -0,0 +1,97 @@
#///////////////////////////
# Cocos Creator 3D Project
#///////////////////////////
library/
temp/
local/
build/
profiles/
native_data/
remote-assets/*
cocos2d-x/*
native/engine/*
!native/engine/ios
!native/engine/common
!native/engine/android
native/engine/android/app/assets
native/engine/android/app/build
native/engine/android/app/release
native/engine/android/app/debug
native/engine/android/instantapp/build
native/engine/android/instantapp/debug
native/engine/android/instantapp/release
#/////////////////////////////////////////////////////////////////////////////
# Logs and databases
#/////////////////////////////////////////////////////////////////////////////
*.log
*.sql
*.sqlite
#/////////////////////////////////////////////////////////////////////////////
# files for debugger
#/////////////////////////////////////////////////////////////////////////////
*.sln
*.csproj
*.pidb
*.unityproj
*.suo
#//////////////////////////
# NPM
#//////////////////////////
node_modules/
#//////////////////////////
# VSCode
#//////////////////////////
.vscode/
node_modules/**
mockServer/node_modules/**
mockServer/package-lock.json
package-lock.json
assets/mock/
assets/mock.meta
node_modules
#//////////////////////////
# WebStorm
#//////////////////////////
.idea/
#/////////////////////////////////////////////////////////////////////////////
# OS generated files
#/////////////////////////////////////////////////////////////////////////////
*.DS_Store
.DS_Store
ehthumbs.db
Thumbs.db
#/////////////////////////////////////////////////////////////////////////////
# exvim files
#/////////////////////////////////////////////////////////////////////////////
*UnityVS.meta
*.err
*.err.meta
*.exvim
*.exvim.meta
*.vimentry
*.vimentry.meta
*.vimproject
*.vimproject.meta
.vimfiles.*/
.exvim.*/
quick_gen_project_*_autogen.bat
quick_gen_project_*_autogen.bat.meta
quick_gen_project_*_autogen.sh
quick_gen_project_*_autogen.sh.meta
.exvim.app

93
README.md Normal file
View File

@ -0,0 +1,93 @@
# super-hero
## Getting started
To make it easy for you to get started with GitLab, here's a list of recommended next steps.
Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)!
## Add your files
- [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files
- [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command:
```
cd existing_repo
git remote add origin https://gitlab.com/mango-pluton/super-hero.git
git branch -M main
git push -uf origin main
```
## Integrate with your tools
- [ ] [Set up project integrations](https://gitlab.com/mango-pluton/super-hero/-/settings/integrations)
## Collaborate with your team
- [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/)
- [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html)
- [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically)
- [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/)
- [ ] [Set auto-merge](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html)
## Test and Deploy
Use the built-in continuous integration in GitLab.
- [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html)
- [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing (SAST)](https://docs.gitlab.com/ee/user/application_security/sast/)
- [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html)
- [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/)
- [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html)
***
# Editing this README
When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thanks to [makeareadme.com](https://www.makeareadme.com/) for this template.
## Suggestions for a good README
Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.
## Name
Choose a self-explaining name for your project.
## Description
Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors.
## Badges
On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.
## Visuals
Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method.
## Installation
Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection.
## Usage
Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README.
## Support
Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.
## Roadmap
If you have ideas for releases in the future, it is a good idea to list them in the README.
## Contributing
State if you are open to contributions and what your requirements are for accepting them.
For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self.
You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser.
## Authors and acknowledgment
Show your appreciation to those who have contributed to the project.
## License
For open source projects, say how it is licensed.
## Project status
If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers.

12
assets/cc-common.meta Normal file
View File

@ -0,0 +1,12 @@
{
"ver": "1.2.0",
"importer": "directory",
"imported": true,
"uuid": "598b7e15-48c8-4351-a9e7-dfddcfd5e83d",
"files": [],
"subMetas": {},
"userData": {
"compressionType": {},
"isRemoteBundle": {}
}
}

View File

@ -0,0 +1,12 @@
{
"ver": "1.2.0",
"importer": "directory",
"imported": true,
"uuid": "8a5893e8-f362-4b7c-97f9-88605348771d",
"files": [],
"subMetas": {},
"userData": {
"compressionType": {},
"isRemoteBundle": {}
}
}

View File

@ -0,0 +1,315 @@
import * as cc from 'cc';
import { Size } from 'cc';
import { Vec3 } from 'cc';
import { Vec2 } from 'cc';
import { Button, Color, Label, log, math, Node, Sprite } from 'cc';
declare module 'cc' {
interface Node {
setPositionX(x: number): void;
setPositionY(y: number): void;
setPositionZ(z: number): void;
changePositionX(x: number): void;
changePositionY(y: number): void;
changePositionZ(z: number): void;
setScaleX(x: number): void;
setScaleY(y: number): void;
setScaleZ(z: number): void;
logColor(title: string, data: any, color: Color): void;
setNodeActive(isActive: boolean): void;
setNodeOpacity(opacity: number): void;
getNodeOpacity(): number;
getNodeTransform(): cc.UITransform;
onFadeTo(time: number, from: number, to: number, callback?: Function): void;
onFadeIn(time: number, opacity: number, callback?: Function): void;
onFadeOut(time: number, callback?: Function): void;
getContentSize(): cc.Size;
setContentSize(size: cc.Size): void;
}
interface Sprite {
setOpacity(a: number): void;
setColor(color: Color): void;
}
interface Button {
setOpacity(a: number): void;
setBtnActive(isActive: boolean): void;
}
interface Label {
setOpacity(a: number): void;
setColor(color: Color): void;
}
interface Vec3 {
toVec2(): Vec2;
}
interface Vec2 {
toVec3(): Vec3;
}
}
Button.prototype.setOpacity = function (a: number): void {
this.node.setNodeOpacity(a);
}
Button.prototype.setBtnActive = function (isActive: boolean): void {
this.node.active = isActive;
}
//NODE
Node.prototype.setNodeActive = function (isActive: boolean): void {
this.active = isActive;
}
Node.prototype.logColor = function (title: string, data: any, color: Color): void {
log(`%c ${title}`, `background: #222; color: #${color.toHEX()}`, data);
}
Node.prototype.setPositionX = function (x: number): void {
this.position = new math.Vec3(x, this.position.y, this.position.z);
}
Node.prototype.setPositionY = function (y: number): void {
this.position = new math.Vec3(this.position.x, y, this.position.z);
}
Node.prototype.setPositionZ = function (z: number): void {
this.position = new math.Vec3(this.position.x, this.position.y, z);
}
Node.prototype.changePositionX = function (x: number): void {
this.position = new math.Vec3(this.position.x + x, this.position.y, this.position.z);
}
Node.prototype.changePositionY = function (y: number): void {
this.position = new math.Vec3(this.position.x, this.position.y + y, this.position.z);
}
Node.prototype.changePositionZ = function (z: number): void {
this.position = new math.Vec3(this.position.x, this.position.y, this.position.z + z);
}
Node.prototype.setScaleX = function (x: number): void {
this.scale = new math.Vec3(x, this.scale.y, this.scale.z);
}
Node.prototype.setScaleY = function (y: number): void {
this.scale = new math.Vec3(this.scale.x, y, this.scale.z);
}
Node.prototype.setScaleZ = function (z: number): void {
this.scale = new math.Vec3(this.scale.x, this.scale.y, z);
}
Node.prototype.setNodeOpacity = function (opacity: number): void {
let uiOpacity = this.getComponent(cc.UIOpacity) as cc.UIOpacity;
if (uiOpacity) {
uiOpacity.opacity = opacity;
}
else {
uiOpacity = this.addComponent(cc.UIOpacity);
uiOpacity.opacity = opacity;
}
}
Node.prototype.getNodeOpacity = function (): number {
let uiOpacity = this.getComponent(cc.UIOpacity) as cc.UIOpacity;
if (uiOpacity) {
return uiOpacity.opacity;
}
else {
this.setNodeOpacity(255);
return 255;
}
}
Node.prototype.getNodeTransform = function (): cc.UITransform {
return this.getComponent(cc.UITransform) as cc.UITransform;
}
Node.prototype.getContentSize = function (): cc.Size {
return this.getNodeTransform().contentSize as cc.Size;
}
Node.prototype.setContentSize = function (size: cc.Size): void {
this.getComponent(cc.UITransform)?.setContentSize(size);
}
Node.prototype.onFadeTo = function (time: number, from: number, to: number, callback?: Function): void {
this.setNodeOpacity(from);
let uiOpacity = this.getComponent(cc.UIOpacity);
cc.tween(uiOpacity).to(time, { opacity: to }).call(() => {
callback?.();
}).start();
}
Node.prototype.onFadeIn = function (time: number, opacity: number, callback?: Function): void {
this.onFadeTo(time, 1, opacity, callback);
}
Node.prototype.onFadeOut = function (time: number, callback?: Function): void {
let opacity = this.getNodeOpacity();
this.onFadeTo(time, opacity, 1, callback);
}
//SPRITE
Sprite.prototype.setOpacity = function (a: number): void {
this.node.setNodeOpacity(a);
}
Sprite.prototype.setColor = function (color: Color): void {
this.color = color;
}
//LABEL
Label.prototype.setOpacity = function (a: number): void {
this.node.setNodeOpacity(a);
}
Label.prototype.setColor = function (color: Color): void {
this.color = color;
}
//------------------------------------------------------------------------------------------------
declare global {
interface Number {
roundDigits(digits: number): number;
trunc(): number;
truncDigits(digits: number): number;
toFixedDown(digits: number): number;
}
interface String {
toInt(): number;
toFloat(): number;
toBoolean(): boolean;
formatWithMaxLength(maxLength: number): string;
isNullOrUndefined(): boolean;
}
interface Array<T> {
shuffleArray(): Array<T>;
toJson(): string;
clearArray(): Array<T>;
cloneArray(): Array<T>;
}
}
Array.prototype.shuffleArray = function () {
for (let i = this.length - 1; i >= 0; i--) {
const randomIndex = Math.floor(Math.random() * (i + 1));
const itemIndex = this[randomIndex];
this[randomIndex] = this[i];
this[i] = itemIndex;
}
return this;
}
Array.prototype.clearArray = function () {
this.splice(0, this.length);
return this;
}
Array.prototype.cloneArray = function () {
return [...this];
}
Array.prototype.toJson = function (): string {
return JSON.stringify(this);
}
String.prototype.toInt = function (): number {
if (String(this) === null || String(this) === undefined) return 0;
let result = Number(String(this));
if (Number.isNaN(result)) return 0;
return Math.trunc(result);
}
String.prototype.toFloat = function (): number {
if (String(this) === null || String(this) === undefined) return 0;
let result = Number(String(this));
if (Number.isNaN(result)) result = 0;
return result;
}
String.prototype.toBoolean = function (): boolean {
return String(this).toLowerCase() == 'true';
}
String.prototype.formatWithMaxLength = function (maxLength: number): string {
if (this == null || this == undefined) return "";
let str = String(this);
if (str.length > maxLength) {
if (str.charAt(maxLength - 1) === " ") {
str = `${str.substring(0, maxLength - 1)}..`;
}
else {
str = `${str.substring(0, maxLength)}..`;
}
}
return str;
}
String.prototype.isNullOrUndefined = function (): boolean {
return String(this) == null || String(this) == undefined;
}
Number.prototype.roundDigits = function (digits: number): number {
return Math.round(Number(this) * Math.pow(10, digits)) / Math.pow(10, digits);
}
Number.prototype.truncDigits = function (digits: number): number {
return digits > 0 ? Number(this).toFixedDown(digits) : (Math.trunc(Number(this) * Math.pow(10, digits)) / Math.pow(10, digits));
}
Number.prototype.trunc = function (): number {
return Math.trunc(Number(this));
}
Number.prototype.toFixedDown = function (digits: number): number {
var re = new RegExp("(\\d+\\.\\d{" + digits + "})(\\d)"),
m = Number(this).toString().match(re);
return m ? parseFloat(m[1]) : Number(this).valueOf();
}
Vec3.prototype.toVec2 = function (): Vec2{
return new Vec2(this.x, this.y);
}
Vec2.prototype.toVec3 = function (): Vec3 {
return new Vec3(this.x, this.y, 0);
}

View File

@ -0,0 +1,9 @@
{
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "7973cb3a-1318-4445-b663-9297df554d8c",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@ -0,0 +1,12 @@
{
"ver": "1.2.0",
"importer": "directory",
"imported": true,
"uuid": "68bdfafd-b48a-491f-93d3-4c4e8b459d89",
"files": [],
"subMetas": {},
"userData": {
"compressionType": {},
"isRemoteBundle": {}
}
}

View File

@ -0,0 +1,219 @@
// Rest API to connect to server
class ServiceRest {
request: any;
constructor() {
this.request = new XMLHttpRequest();
}
encodeQueryData(data) {
return Object.keys(data).map(function(key) {
return [key, data[key]].map(encodeURIComponent).join("=");
}).join("&");
};
get({url = '', params = {}, callback = (data) => {}, apiUrl = '', callbackErr = () => {}}) {
const querystring = '?' + this.encodeQueryData(params);
const fullURL = apiUrl + url + querystring;
const request = new XMLHttpRequest();
request.open("GET", fullURL, true);
request.timeout = 15000;
request.setRequestHeader("Content-Type","application/json;charset=UTF-8");
request.onreadystatechange = function () {
if (request.readyState == 4) {
//get status text
if (callback) {
if (request.responseText) {
callback(JSON.parse(request.responseText));
} else {
callbackErr();
}
}
} else if (request.readyState === 0) {
callbackErr();
}
if (request.status !== 200) {
callbackErr();
}
};
request.ontimeout = function (e) {
callbackErr();
};
request.onerror = (e) => {
callbackErr();
};
request.send();
};
getWithHeader({url = '', params = {}, headers = {}, callback = (data) => {}, apiUrl = '', callbackErr = () => {}}) {
const querystring = '?' + this.encodeQueryData(params);
const fullURL = apiUrl + url + querystring;
const request = new XMLHttpRequest();
request.open("GET", fullURL, true);
request.timeout = 15000;
request.setRequestHeader("Content-Type","application/json;charset=UTF-8");
Object.keys(headers).forEach( (key) => {
request.setRequestHeader(key, headers[key]);
});
request.onreadystatechange = function () {
if (request.readyState == 4) {
//get status text
if (callback) {
if (request.responseText) {
callback(JSON.parse(request.responseText));
} else {
callbackErr();
}
}
} else if (request.readyState === 0) {
callbackErr();
}
if (request.status !== 200) {
callbackErr();
}
};
request.ontimeout = function () {
callbackErr();
};
request.onerror = () => {
callbackErr();
};
request.send();
};
post({url = '', data = {}, callback = (data) => {}, apiUrl = '', callbackErr = () => {}}) {
const dataPost = this.encodeQueryData(data);
const fullURL = apiUrl + url;
const request = new XMLHttpRequest();
request.open('POST', fullURL, true);
request.timeout = 15000;
request.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
request.onreadystatechange = function() {
if(request.readyState == 4) {
if (request.responseText) {
callback({
status: request.status,
data: JSON.parse(request.responseText)
});
} else {
callbackErr();
}
} else if (request.readyState === 0) {
callbackErr();
}
if (request.status !== 200) {
callbackErr();
}
};
request.ontimeout = function (e) {
callbackErr();
};
request.onerror = (e) => {
callbackErr();
};
request.send(dataPost);
};
postWithHeader ({url = '',params = {}, headers = {}, data = {}, callback = (data) => {}, apiUrl = '', callbackErr = () => {}}) {
const dataPost = JSON.stringify(data);
const querystring = '?' + this.encodeQueryData(params);
const fullURL = apiUrl + url + querystring;
const request = new XMLHttpRequest();
request.open('POST', fullURL, true);
request.timeout = 15000;
request.setRequestHeader('Content-type', 'application/json');
Object.keys(headers).forEach( (key) => {
request.setRequestHeader(key, headers[key]);
});
request.onreadystatechange = function() {
if(request.readyState == 4) {
if (request.responseText) {
callback({
status: request.status,
data: JSON.parse(request.responseText)
});
} else {
callbackErr();
}
} else if (request.readyState === 0) {
callbackErr();
}
if (request.status !== 200) {
callbackErr();
}
};
request.ontimeout = function (e) {
callbackErr();
};
request.onerror = (e) => {
callbackErr();
};
request.send(dataPost);
};
postRaw({url = '', data = {}, callback = (data) => {}, apiUrl = '', callbackErr = () => {}}) {
const dataPost = data;
const fullURL = apiUrl + url;
const request = new XMLHttpRequest();
request.open('POST', fullURL, true);
request.timeout = 15000;
request.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
request.onreadystatechange = function() {
if(request.status == 200) {
callback({
status: request.status,
data: request.responseText
});
} else {
callbackErr();
}
};
request.ontimeout = function (e) {
callbackErr();
};
request.onerror = (e) => {
callbackErr();
};
request.send(dataPost);
};
put({url = '', data = {}, callback = (data) => {}, apiUrl = '', callbackErr = () => {}}) {
const dataPost = this.encodeQueryData(data);
const fullURL = apiUrl + url;
const request = new XMLHttpRequest();
request.open('PUT', fullURL, true);
request.timeout = 15000;
request.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
request.onreadystatechange = function() {
if(request.readyState == 4) {
if (request.responseText) {
callback({
status: request.status,
data: JSON.parse(request.responseText)
});
} else {
callbackErr();
}
} else if (request.readyState === 0) {
callbackErr();
}
if (request.status !== 200) {
callbackErr();
}
};
request.ontimeout = function (e) {
callbackErr();
};
request.onerror = (e) => {
callbackErr();
};
request.send(dataPost);
};
};
const apiObject = new ServiceRest();
export default apiObject;

View File

@ -0,0 +1,9 @@
{
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "34b88a2c-4b90-41fb-9853-a9f4b18d7fee",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@ -0,0 +1,12 @@
{
"ver": "1.2.0",
"importer": "directory",
"imported": true,
"uuid": "0e47de47-e00e-4bca-9c0d-f48aa216de33",
"files": [],
"subMetas": {},
"userData": {
"compressionType": {},
"isRemoteBundle": {}
}
}

View File

@ -0,0 +1,76 @@
import { _decorator, CCFloat, Component, game, Game, Node, ProgressBar, tween } from 'cc';
const { ccclass, property } = _decorator;
@ccclass('UmButtonCountdown')
export class UmButtonCountdown extends Component {
@property(ProgressBar) public barCountdown: ProgressBar = null!;
@property(Node) public blockInput: Node = null!;
@property(CCFloat) public TIME_COUNTDOWN = 10;
private _time_available = 0;
private _tween: any = null!;
onLoad() {
game.on(Game.EVENT_SHOW, this._onShowGame, this);
}
onDestroy() {
game.off(Game.EVENT_SHOW, this._onShowGame, this);
}
private _onShowGame() {
this._checkCountdown();
}
onEnable() {
this._checkCountdown();
}
private _checkCountdown() {
this._tween?.stop();
this._tween = null;
let now_time = (new Date()).getTime();
if (now_time >= this._time_available) {
this.barCountdown.progress = 0;
this.blockInput?.setNodeActive(false);
return;
}
this._startCountdown(now_time);
}
private _startCountdown(now_time: number) {
this.blockInput?.setNodeActive(true);
let action_time = this._time_available - now_time;
action_time = action_time / 1000;
this.barCountdown.progress = action_time / this.TIME_COUNTDOWN;
this.tweenBar(action_time);
}
onDisable() {
this._tween?.stop();
this._tween = null;
}
public updateTimeAvailAble() {
let now_time = (new Date()).getTime();
this._time_available = now_time + this.TIME_COUNTDOWN * 1000;
this._startCountdown(now_time);
}
public tweenBar(actionTime: number) {
this._tween = tween(this.barCountdown).to(actionTime, { progress: 0 }).call(() => {
this._tween = null;
if (this.node) {
this.barCountdown.progress = 0;
this.blockInput?.setNodeActive(false);
}
});
this._tween.start();
}
}

View File

@ -0,0 +1,9 @@
{
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "d20cf127-1092-4170-a80d-10bcf1de194a",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@ -0,0 +1,102 @@
import { _decorator, Button, CCFloat, Color, Label, Sprite, Vec3 } from 'cc';
const { ccclass, property } = _decorator;
@ccclass('UmButtonCustom')
export class UmButtonCustom extends Button {
@property(Label) public lbTitle: Label = null!;
@property(Sprite) public spIcon: Sprite = null!;
@property(CCFloat) pressedScale: Number = 0.95;
@property(CCFloat) textPosYChange: Number = 0;
@property(CCFloat) iconPosYChange: Number = 0;
@property(Color) public textColorNormal: Color = new Color(255, 255, 255, 255);
@property(Color) public textColorPressed: Color = new Color(255, 255, 255, 180);
private _state: string = "none";
private _textPosY = -1001;
private _iconPosY = -1001;
start() {
// if (this.lbTitle) {
// this._textOriginY = this.lbTitle.node.position.y;
// HTLog.error("BUTTON CUSTOM ===>>> ", this.lbTitle.string, this._textOriginY);
// }
// if (this.spIcon) {
// this._iconOriginY = this.spIcon.node.position.y;
// }
}
private _updateUINormal() {
if (this.lbTitle) {
this.lbTitle.setColor(this.textColorNormal);
this.lbTitle.node.setScale(Vec3.ONE);
if (this._textPosY < -1000) {
this._textPosY = this.lbTitle.node.position.y;
}
else {
this.lbTitle.node.setPositionY(this._textPosY);
}
}
if (this.spIcon) {
this.spIcon.setColor(this.textColorNormal);
this.spIcon.node.setScale(Vec3.ONE);
if (this._iconPosY < -1000) {
this._iconPosY = this.spIcon.node.position.y;
}
else {
this.spIcon.node.setPositionY(this._iconPosY);
}
}
}
private _updateUIPressed() {
if (this.lbTitle) {
this.lbTitle.setColor(this.textColorPressed);
this.lbTitle.node.setScale(new Vec3(Number(this.pressedScale), Number(this.pressedScale), 1));
// this.lbTitle.node.setPositionY(this.lbTitle.node.position.y - Number(this.textPosY));
if (this._textPosY < -1000) {
this._textPosY = this.lbTitle.node.position.y;
}
this.lbTitle.node.setPositionY(this._textPosY + Number(this.textPosYChange));
}
if (this.spIcon) {
this.spIcon.setColor(this.textColorPressed);
this.spIcon.node.setScale(new Vec3(Number(this.pressedScale), Number(this.pressedScale), 1));
if (this._iconPosY < -1000) {
this._iconPosY = this.spIcon.node.position.y;
}
this.spIcon.node.setPositionY(this._iconPosY + Number(this.iconPosYChange));
}
}
protected _applyTransition(state: string) {
super._applyTransition(state);
if (this._state !== state) {
// HTLog.log("==>ButtonCustom: _updateSpriteTransition = ", state);
if (state === "normal" || state === "hover" || state === "disabled") {
this._updateUINormal();
}
if (state === "pressed") {
this._updateUIPressed();
}
this._state = state;
}
}
}

View File

@ -0,0 +1,9 @@
{
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "671ebd34-be6b-4831-a12d-b24acdb15057",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@ -0,0 +1,14 @@
import { _decorator, CCFloat, Component, tween } from 'cc';
const { ccclass, property } = _decorator;
@ccclass('UmDestroyItem')
export class UmDestroyItem extends Component {
@property(CCFloat) public delayTime = 1;
onLoad() {
tween(this.node).delay(this.delayTime).removeSelf().call(() => {
this.node.destroy();
}).start();
}
}

View File

@ -0,0 +1,9 @@
{
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "64898fb7-c914-4d93-ab8d-d888fe58f811",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@ -0,0 +1,241 @@
import { _decorator, Button, CCBoolean, Component, Sprite, tween, Vec3, view, Widget } from 'cc';
const { ccclass, property } = _decorator;
@ccclass('UmPopupBase')
export class UmPopupBase extends Component {
@property(Button) public bgBlack: Button = null!;
@property(Sprite) public bgPopup: Sprite = null!;
@property(CCBoolean) public isAnimShowHide = true;
_transitions_type: string = "Z";
_is_black_panel: boolean = true;
public popup_pos = Vec3.ZERO;
private OPACITY_BLACK = 150;
DURATION_SHOW_ZOOM = 0.35;
DURATION_HIDE_ZOOM = 0.35;
SCALE_START_SHOW_ZOOM = 0.8;
SCALE_END_HIDE_ZOOM = 0.8;
DURATION_SHOW_MOVE = 0.35;
DURATION_HIDE_MOVE = 0.35;
public static TRANSITIONS_TYPE = {
ZOOM_IN: "Z",
MOVE_IN_TOP: "T",
MOVE_IN_BOTTOM: "B",
MOVE_IN_RIGHT: "R",
MOVE_IN_LEFT: "L",
}
public static MOVE_TYPE = {
BOTTOM: 0,
TOP: 1,
LEFT: 2,
RIGHT: 3,
ORIGIN: 4
}
onLoad() {
if (this.bgBlack) {
this.bgBlack.node.on(Button.EventType.CLICK, this.onBtnCloseClicked, this);
}
}
public show(callback: Function = null!) {
if (this.isAnimShowHide) {
this._fadeInBlackPanel();
if (this.bgPopup) {
this.popup_pos = new Vec3(this.bgPopup.node.position);
this.bgPopup.node.setScale(new Vec3(this.SCALE_START_SHOW_ZOOM, this.SCALE_START_SHOW_ZOOM, 1));
tween(this.bgPopup.node).to(this.DURATION_SHOW_ZOOM, { scale: Vec3.ONE }, { easing: 'backOut' }).call(() => {
if (this.bgBlack) {
this.bgBlack.interactable = true;
}
callback?.();
}).start();
this.bgPopup.node.onFadeIn(this.DURATION_SHOW_ZOOM, 255);
}
}
else {
this.bgBlack?.setOpacity(this.OPACITY_BLACK);
if (this.bgBlack) {
this.bgBlack.interactable = true;
}
callback?.();
}
}
public hide(callback: Function = null!) {
if (this.isAnimShowHide) {
this._fadeOutBlackPanel();
if (this.bgPopup) {
let duration = this.DURATION_HIDE_ZOOM;
tween(this.bgPopup.node).to(duration, { scale: new Vec3(this.SCALE_END_HIDE_ZOOM, this.SCALE_END_HIDE_ZOOM, 1) }, { easing: 'backIn' }).call(() => {
callback?.();
this.node.destroyAllChildren();
this.node.destroy();
}).start();
tween(this.bgPopup.node).delay(0.1).call(() => this.bgPopup.node.onFadeOut(duration)).start();
}
else {
callback?.();
this.node.destroy();
}
}
else {
callback?.();
this.node.destroy();
}
}
private _fadeInBlackPanel() {
if (this.bgBlack) {
this.bgBlack.node.onFadeIn(this.DURATION_SHOW_MOVE, this.OPACITY_BLACK);
}
}
private _fadeOutBlackPanel() {
if (this.bgBlack) {
this.bgBlack.node.onFadeOut(this.DURATION_HIDE_MOVE);
}
}
public showWithTransitions(type: string, isBlackPanel: boolean = true, callback: Function = null!) {
this._transitions_type = type;
this._is_black_panel = isBlackPanel;
if (type === UmPopupBase.TRANSITIONS_TYPE.ZOOM_IN) {
this.show();
}
else {
this.bgPopup.getComponent(Widget)?.updateAlignment();
let pos = new Vec3(this.bgPopup.node.position);
this.popup_pos = pos;
let new_pos = new Vec3();
switch (type) {
case UmPopupBase.TRANSITIONS_TYPE.MOVE_IN_TOP:
{
let value = view.getDesignResolutionSize().y;
new_pos = new Vec3(pos.x, pos.y + value, pos.z);
}
break;
case UmPopupBase.TRANSITIONS_TYPE.MOVE_IN_BOTTOM:
{
let value = view.getDesignResolutionSize().y;
new_pos = new Vec3(pos.x, pos.y - value, pos.z);
}
break;
case UmPopupBase.TRANSITIONS_TYPE.MOVE_IN_RIGHT:
{
let value = view.getDesignResolutionSize().x;
new_pos = new Vec3(pos.x + value, pos.y, pos.z);
}
break;
case UmPopupBase.TRANSITIONS_TYPE.MOVE_IN_LEFT:
{
let value = view.getDesignResolutionSize().x;
new_pos = new Vec3(pos.x - value, pos.y, pos.z);
}
break;
}
this.bgPopup.node.position = new_pos;
let duration = this.DURATION_SHOW_MOVE;
tween(this.bgPopup.node).to(duration, { position: pos }, { easing: 'sineOut' }).call(() => {
if (this.bgBlack) {
this.bgBlack.interactable = true;
}
callback?.();
}).start();
if (isBlackPanel) {
this._fadeInBlackPanel();
}
}
}
public hideWithTransitions(callback: Function = null!) {
if (this._transitions_type === UmPopupBase.TRANSITIONS_TYPE.ZOOM_IN) {
this.hide(callback);
}
else {
let pos = new Vec3(this.bgPopup.node.position);
let new_pos = new Vec3();
switch (this._transitions_type) {
case UmPopupBase.TRANSITIONS_TYPE.MOVE_IN_TOP:
{
let value = view.getDesignResolutionSize().y;
new_pos = new Vec3(pos.x, pos.y + value, pos.z);
}
break;
case UmPopupBase.TRANSITIONS_TYPE.MOVE_IN_BOTTOM:
{
let value = view.getDesignResolutionSize().y;
new_pos = new Vec3(pos.x, pos.y - value, pos.z);
}
break;
case UmPopupBase.TRANSITIONS_TYPE.MOVE_IN_RIGHT:
{
let value = view.getDesignResolutionSize().x;
new_pos = new Vec3(pos.x + value, pos.y, pos.z);
}
break;
case UmPopupBase.TRANSITIONS_TYPE.MOVE_IN_LEFT:
{
let value = view.getDesignResolutionSize().x;
new_pos = new Vec3(pos.x - value, pos.y, pos.z);
}
break;
}
if (this._is_black_panel) {
this._fadeOutBlackPanel();
}
let duration = this.DURATION_HIDE_MOVE;
tween(this.bgPopup.node).to(duration, { position: new_pos }, { easing: 'sineIn' }).call(() => {
if (this.bgBlack) {
this.bgBlack.node.active = false;
}
callback?.();
this.node.destroyAllChildren();
this.node.destroy();
}).start();
}
}
public setTransitionsType(transitions_type: string) {
this._transitions_type = transitions_type;
}
onBtnCloseClicked(button: Button) {
if (button) {
button.interactable = false;
}
this.hideWithTransitions();
}
closePopupWithCallBack(btn: Button, callback: Function) {
if (btn) {
btn.interactable = false;
}
this.hideWithTransitions(callback);
}
public onClosePopupWithAnim(isAnim: boolean = true) {
this.isAnimShowHide = isAnim;
this.hide();
}
}

View File

@ -0,0 +1,9 @@
{
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "7113402c-4fa5-438b-8b98-6ab75db05805",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@ -0,0 +1,19 @@
import { _decorator, Component, Node } from 'cc';
import { UmDeviceInfo } from '../cc-util/UmDeviceInfo';
import { SafeArea } from 'cc';
const { ccclass, property } = _decorator;
@ccclass('UmSafeArena')
export class UmSafeArena extends Component {
start() {
if (!UmDeviceInfo.isNative)
return;
let safeArena = this.node?.getComponent(SafeArea);
if (!safeArena)
return;
safeArena.enabled = true;
}
}

View File

@ -0,0 +1,9 @@
{
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "a20a2692-fa76-4dd1-b7df-af5e8eefb11d",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@ -0,0 +1,31 @@
import { _decorator, Color, EventTouch, Slider, Sprite } from 'cc';
const { ccclass, property } = _decorator;
@ccclass('UmSliderCustom')
export class UmSliderCustom extends Slider {
public onTouchEnded: ((event?: EventTouch) => void) | undefined;
public onTouchCancelled: ((event?: EventTouch) => void) | undefined;
@property(Sprite) public bg: Sprite = null!;
_onTouchEnded(event?: EventTouch) {
super._onTouchEnded(event);
this.onTouchEnded?.(event);
}
protected _onTouchCancelled(event?: EventTouch) {
super._onTouchCancelled(event);
this.onTouchCancelled?.(event);
}
public setOpacity(opacity: number) {
this.handle?.setOpacity(opacity);
this.bg?.setOpacity(opacity);
}
public setColor(color: Color) {
this.bg?.setColor(color);
this.handle?.getComponent(Sprite)?.setColor(color);
}
}

View File

@ -0,0 +1,9 @@
{
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "56e819f4-f5b2-485d-802d-9fa9a53930e2",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@ -0,0 +1,67 @@
import { _decorator, Button, CCFloat, Color, Label, Node, Sprite, SpriteFrame, tween, Vec3 } from 'cc';
const { ccclass, property } = _decorator;
@ccclass('UmSwitchButton')
export class UmSwitchButton extends Button {
@property(CCFloat) public animTime = 0.1;
@property(Sprite) public dot: Sprite = null!;
@property(Label) public title: Label = null!;
@property(SpriteFrame) public spf_off: SpriteFrame = null!;
@property(SpriteFrame) public spf_on: SpriteFrame = null!;
@property(SpriteFrame) public spf_dot_off: SpriteFrame = null!;
@property(SpriteFrame) public spf_dot_on: SpriteFrame = null!;
@property(Node) public listTargetPos: Node[] = [];
public status: boolean = true;
public onSwitched: ((status: boolean) => void) | undefined;
setInitStatus(status: boolean) {
this.status = status;
this.dot.node.position = this.getDotTarget(this.status);
this.setSpriteFrame(status);
}
onClicked(btn: Button) {
this.interactable = false;
this.status = !this.status;
tween(this.dot.node).to(this.animTime, { position: this.getDotTarget(this.status) }).call(() => {
this.interactable = true;
this.setSpriteFrame(this.status);
}).start();
this.onSwitched?.(this.status);
}
getDotTarget(status: boolean): Vec3 {
return status ? this.listTargetPos[1].position : this.listTargetPos[0].position;
}
setSpriteFrame(status: boolean) {
if (status) {
this.normalSprite = this.spf_on;
this.dot.spriteFrame = this.spf_dot_on;
this.title.string = "ON";
this.title.node.setPositionX(-20.5);
this.title.setColor(new Color(83, 251, 255));
}
else {
this.normalSprite = this.spf_off;
this.dot.spriteFrame = this.spf_dot_off;
this.title.string = "OFF";
this.title.node.setPositionX(20.5);
this.title.setColor(new Color(105, 119, 150));
}
}
public updateTitle() {
this.title.string = this.status ? "ON" : "OFF";
}
}

View File

@ -0,0 +1,9 @@
{
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "9c2cc841-bc92-4119-b61a-ae5dc2dfaf1a",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@ -0,0 +1,12 @@
{
"ver": "1.2.0",
"importer": "directory",
"imported": true,
"uuid": "de4d2832-8795-40f8-b5c4-5addee1ed310",
"files": [],
"subMetas": {},
"userData": {
"compressionType": {},
"isRemoteBundle": {}
}
}

View File

@ -0,0 +1,110 @@
import { _decorator, Component, Node } from 'cc';
import { GameDefine } from '../../cc-game/scripts/config/GameDefine';
import { UmLog } from './UmLog';
import { UmNativeBridge } from './UmNativeBridge';
import { UmClientEvent } from './UmOneToMultiListener';
import { UmDeviceInfo } from './UmDeviceInfo';
const { ccclass, property } = _decorator;
@ccclass('UmAdsManager')
export class UmAdsManager extends Component {
public static Instance: UmAdsManager = null;
interstitialAdCallback: any = null;
rewardAdCallback: any = null;
//Event
EVENT_BANNER_AD = "EVENT_BANNER_AD";
EVENT_SHOW_INTERSTITIAL_AD = "EVENT_SHOW_INTERSTITIAL_AD";
EVENT_SHOW_REWARD_AD = "EVENT_SHOW_REWARD_AD";
EVENT_BANNER_AD_POSITION = "EVENT_BANNER_AD_POSITION";
//Action
SHOW_ACTION_KEY = "show";
HIDE_ACTION_KEY = "hide";
//Banner Position
public static BANNER_POSITION = {
"BANNER_BOTTOM_LEFT": "BOTTOM_LEFT",
"BANNER_BOTTOM_CENTER": "BOTTOM_CENTER",
"BANNER_BOTTOM_RIGHT": "BOTTOM_RIGHT",
"BANNER_TOP_LEFT":"TOP_LEFT",
"BANNER_TOP_CENTER": "TOP_CENTER",
"BANNER_TOP_RIGHT": "TOP_RIGHT",
}
public static ADS_RESULT = {
"SUCCESS": "success",
"FAIL": "fail",
}
onLoad(): void {
UmAdsManager.Instance = this;
UmClientEvent.on(this.EVENT_SHOW_INTERSTITIAL_AD, this.onInterstitialAdCallback.bind(this));
UmClientEvent.on(this.EVENT_SHOW_REWARD_AD, this.onRewardCallback.bind(this));
}
onDestroy(): void {
UmClientEvent.off(this.EVENT_SHOW_INTERSTITIAL_AD, this.onInterstitialAdCallback.bind(this));
UmClientEvent.off(this.EVENT_SHOW_REWARD_AD, this.onRewardCallback.bind(this));
}
//BANNER_ADS
public showBanner()
{
if (!UmDeviceInfo.isMobile) return;
UmNativeBridge.instance.onCallNative(this.EVENT_BANNER_AD, this.SHOW_ACTION_KEY);
}
public hideBanner()
{
if (!UmDeviceInfo.isMobile) return;
UmNativeBridge.instance.onCallNative(this.EVENT_BANNER_AD, this.HIDE_ACTION_KEY);
}
public setBannerPosition(position: string)
{
if (!UmDeviceInfo.isMobile) return;
UmNativeBridge.instance.onCallNative(this.EVENT_BANNER_AD_POSITION, position);
}
//INTERSTITIAL_ADS
public showInterstitialAd(callback: any)
{
this.interstitialAdCallback = callback;
if (!UmDeviceInfo.isMobile)
{
this.onInterstitialAdCallback("success");
return;
}
UmNativeBridge.instance.onCallNative(this.EVENT_SHOW_INTERSTITIAL_AD);
}
public onInterstitialAdCallback(params: string)
{
UmLog.log("onInterstitialAdCallback => ", params);
let callback = this.interstitialAdCallback;
callback?.(params);
this.interstitialAdCallback = null;
}
//REWARD_ADS
public showRewardAd(callback: any)
{
this.rewardAdCallback = callback;
if (!UmDeviceInfo.isMobile) {
this.onRewardCallback("success");
return;
}
UmNativeBridge.instance.onCallNative(this.EVENT_SHOW_REWARD_AD);
}
public onRewardCallback(params: string) {
UmLog.log("onRewardCallback => ", params);
let callback = this.rewardAdCallback;
callback?.(params);
this.rewardAdCallback = null;
}
}

View File

@ -0,0 +1,9 @@
{
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "ccfa1329-9b5c-44b1-a1cb-f02138b705f5",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@ -0,0 +1,14 @@
import { _decorator, Component, Node } from 'cc';
import { BUILD_MODE, DEBUG_MODE, UmConfig } from './UmConfig';
import { UmDeviceInfo } from './UmDeviceInfo';
const { ccclass, property } = _decorator;
@ccclass('UmBuildConfig')
export class UmBuildConfig extends Component {
onLoad(): void {
UmConfig.BUILD_MODE = BUILD_MODE.DEBUG;
if (UmDeviceInfo.isAndroid)
UmConfig.debugMode = DEBUG_MODE.CONSOLE;
}
}

View File

@ -0,0 +1,9 @@
{
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "880de110-e7f2-46ea-9b7d-d73a93531ccb",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@ -0,0 +1,78 @@
import { sys } from 'cc';
import { view, ResolutionPolicy, log } from 'cc';
import { _decorator, Component, Node } from 'cc';
import * as cc from 'cc';
import { UmLog } from './UmLog';
import { UmClientEvent } from './UmOneToMultiListener';
import { UmConfig } from './UmConfig';
const { ccclass, property } = _decorator;
@ccclass('UmCanvasResize')
export class UmCanvasResize extends Component {
public static startFit: number = ResolutionPolicy.SHOW_ALL;
public static currentFit: number = ResolutionPolicy.FIXED_WIDTH;
onLoad() {
if (UmCanvasResize.isListenerCanvasResize()) {// && !document.getElementById('GameDiv')
window.addEventListener('resize', this._onEventCanvasResized);
UmCanvasResize.currentFit = Number(view.getResolutionPolicy);
}
}
onDestroy() {
UmCanvasResize.resetFitCanvasSize();
}
_onEventCanvasResized() {
UmLog.log("[Canvas] => _onEventCanvasResized");
UmCanvasResize.updateFitCanvasSize();
}
public static isListenerCanvasResize(): boolean {
if (sys.isBrowser) {
if (sys.isMobile) return true;
if (UmConfig.isModeDebug) {
let url = window.location.href;
if (url?.length > 0 && url.includes("http://localhost:")) {
return true;
}
}
}
return false;
}
public static updateFitCanvasSize() {
const viewSize = cc.screen.windowSize;
const designSize = view.getDesignResolutionSize();
let windowWidth = viewSize.width;
let windowHeight = viewSize.height;
let windowRatio = windowWidth * 1.0 / windowHeight;
const designRatio = designSize.width * 1.0 / designSize.height;
let height = designSize.height;
if (windowRatio <= designRatio) {
height = designSize.width / viewSize.width * viewSize.height;
UmCanvasResize.currentFit = ResolutionPolicy.FIXED_WIDTH;
log("[Canvas] => updateFitCanvasSize ==> ", designSize.width, height, " ==> FIT_WIDTH");
}
else {
UmCanvasResize.currentFit = ResolutionPolicy.SHOW_ALL
log("[Canvas] => updateFitCanvasSize ==> ", designSize.width, height, " ==> FIT_SHOW_ALL");
}
view.setResolutionPolicy(UmCanvasResize.currentFit);
UmClientEvent.dispatchEvent("canvas-resize");
}
public static updateCurrentFitCanvasSize() {
log("[Canvas] => updateCurrentFitCanvasSize");
view.setResolutionPolicy(UmCanvasResize.currentFit);
}
public static resetFitCanvasSize() {
if (UmCanvasResize.isListenerCanvasResize()) {
view.setResolutionPolicy(UmCanvasResize.startFit);
}
}
}

View File

@ -0,0 +1,9 @@
{
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "7f0739c2-588e-4e1c-891f-9fa62e6a6e21",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@ -0,0 +1,70 @@
import { sys } from "cc";
export enum BUILD_MODE {
DEBUG = 0,
RELEASE = 1
}
export enum DEBUG_MODE {
NONE = 0,
CC = 1,
CONSOLE = 2,
}
export class UmConfig {
private static DEBUG_MODE: number = DEBUG_MODE.CC;
public static BUILD_MODE: number = BUILD_MODE.DEBUG;
static CLIENT_VERSION: string = "0.0.1";
public static get platform(): string {
let platform_name = "";
if (sys.isBrowser) {
platform_name = "web";
}
else if (sys.OS.ANDROID == sys.os) {
platform_name = "android";
}
else if (sys.OS.IOS == sys.os) {
platform_name = "ios";
}
else if (sys.OS.WINDOWS == sys.os) {
platform_name = "windows";
}
else if (sys.OS.OSX == sys.os) {
platform_name = "macintosh";
}
return platform_name;
}
public static get debugMode(): DEBUG_MODE {
switch (this.DEBUG_MODE) {
case 0:
return DEBUG_MODE.NONE;
case 1:
return DEBUG_MODE.CC;
case 2:
return DEBUG_MODE.CONSOLE;
}
return DEBUG_MODE.NONE;
}
public static set debugMode(value: DEBUG_MODE)
{
if (this.BUILD_MODE == BUILD_MODE.RELEASE)
this.DEBUG_MODE = DEBUG_MODE.NONE;
else
this.DEBUG_MODE = value;
}
public static get isRoundMoney(): boolean {
return true;
}
public static get digitRound(): number {
return 0;
}
public static get isModeDebug(): boolean {
return this.debugMode != DEBUG_MODE.NONE;
}
}

View File

@ -0,0 +1,9 @@
{
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "eaffae53-cf12-483c-9bd6-c5430cac3a6b",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@ -0,0 +1,123 @@
import * as cc from 'cc';
import { sys } from 'cc';
import { UmUtil } from './UmUtil';
export class UmDeviceInfo {
public static safeArenaViewSize: cc.Size = cc.Size.ZERO;
public static DEVICE_INFO = {
os: sys.os,
osVersion: sys.osVersion,
platform: sys.platform,
browser: sys.browserType,
browserVersion: sys.browserVersion,
language: sys.language,
ssid: UmUtil.uuid(),
model: UmDeviceInfo.getModel(),
manufactor: UmDeviceInfo.getManufactor()
};
public static get device_info() {
return UmDeviceInfo.DEVICE_INFO;
}
public static getUUID(): string {
return UmUtil.uuid();
}
public static getModel(): string {
let result = "";
if (!sys.isBrowser) {
if (sys.os == sys.OS.ANDROID) {
result = cc.native.reflection.callStaticMethod("com/cocos/game/AppActivity", "getModel", "()Ljava/lang/String;");
}
else if (sys.os == sys.OS.IOS) {
result = cc.native.reflection.callStaticMethod("NativeBridge", "GetModel:", "0");
}
}
// console.log("getModel ==> ", result);
return result;
}
public static getManufactor(): string {
let result = "";
if (!sys.isBrowser) {
if (sys.os == sys.OS.ANDROID) {
result = cc.native.reflection.callStaticMethod("com/cocos/game/AppActivity", "getManufactor", "()Ljava/lang/String;");
}
else if (sys.os == sys.OS.IOS) {
result = "apple";
}
}
// console.log("getManufactor ==> ", result);
return result;
}
public static setSafeArenaViewSize(size: cc.Size) {
UmDeviceInfo.safeArenaViewSize = size;
}
public static get isMobile(): boolean {
return cc.sys.isMobile;
}
public static get isAndroid(): boolean {
return cc.sys.os == cc.sys.OS.ANDROID;
}
public static get isIos(): boolean {
return cc.sys.os == cc.sys.OS.IOS;
}
public static get isBrowser(): boolean {
return cc.sys.isBrowser;
}
public static get isNative(): boolean {
return !this.isBrowser;
}
public static get isIosNative(): boolean {
return this.isNative && this.isIos;
}
public static get isAndroidNative(): boolean {
return this.isNative && this.isAndroid;
}
public static get isDesktopBrowser(): boolean {
return this.isBrowser && !this.isMobile;
}
public static get isMobileBrowser(): boolean {
return this.isBrowser && this.isMobile;
}
public static get isAndroidBrowser(): boolean {
return this.isBrowser && this.isAndroid;
}
public static get isIosBrowser(): boolean {
return this.isBrowser && this.isIos;
}
public static get isCanVibrate() {
if (this.isMobile) {
if (this.isBrowser && this.isIos) {
return false;
}
else {
return true;
}
}
return false;
}
public static get browserType(): string {
return cc.sys.browserType.toString().toLocaleLowerCase();
}
public static get isBrowserSafari(): boolean {
return this.isBrowser && this.browserType == 'safari';
}
}

View File

@ -0,0 +1,9 @@
{
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "01b1b287-2fc9-482e-806c-33e7f274599e",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@ -0,0 +1,56 @@
import { debug, error, log, warn } from "cc";
import { UmConfig, DEBUG_MODE } from "./UmConfig";
export class UmLog {
public static log(message?: any, ...optionalParams: any[]): void {
switch (UmConfig.debugMode) {
case DEBUG_MODE.NONE:
break;
case DEBUG_MODE.CC:
log(message, ...optionalParams);
break;
case DEBUG_MODE.CONSOLE:
console.log(message, ...optionalParams);
break;
}
}
public static error(message?: any, ...optionalParams: any[]): void {
switch (UmConfig.debugMode) {
case DEBUG_MODE.NONE:
break;
case DEBUG_MODE.CC:
error(message, ...optionalParams);
break;
case DEBUG_MODE.CONSOLE:
console.error(message, ...optionalParams);
break;
}
}
public static warn(message?: any, ...optionalParams: any[]): void {
switch (UmConfig.debugMode) {
case DEBUG_MODE.NONE:
break;
case DEBUG_MODE.CC:
warn(message, ...optionalParams);
break;
case DEBUG_MODE.CONSOLE:
console.warn(message, ...optionalParams);
break;
}
}
public static debug(message?: any, ...optionalParams: any[]): void {
switch (UmConfig.debugMode) {
case DEBUG_MODE.NONE:
break;
case DEBUG_MODE.CC:
debug(message, ...optionalParams);
break;
case DEBUG_MODE.CONSOLE:
console.debug(message, ...optionalParams);
break;
}
}
}

View File

@ -0,0 +1,9 @@
{
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "fa9c8741-326d-40b2-811d-ab100ea26862",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@ -0,0 +1,98 @@
import { UmConfig } from './UmConfig';
declare global {
interface Number {
toMoneyKMB(digits: number): string;
toStringWithPlusSymbol(isPlusZero?: boolean): string;
formatMoney(): string;
formatInt(): string;
formatNumberLessThan10(): string;
formatMoneyKMB(): string;
formatMoneyInTable(): string;
pformatMoneyWC(): string;
}
}
Number.prototype.toMoneyKMB = function (digits: number): string {
var si = [
{ value: 1, symbol: "" },
{ value: 1E3, symbol: "K" },
{ value: 1E6, symbol: "M" },
{ value: 1E9, symbol: "B" },
{ value: 1E12, symbol: "T" },
{ value: 1E15, symbol: "P" },
{ value: 1E18, symbol: "E" }
];
var rx = /\.0+$|(\.[0-9]*[1-9])0+$/;
var i;
let number = Number(this);
let abs_number = Math.abs(number);
for (i = si.length - 1; i > 0; i--) {
if (abs_number >= si[i].value) {
break;
}
}
return (number / si[i].value).truncDigits(digits).toString().replace(rx, "$1") + si[i].symbol;
}
Number.prototype.toStringWithPlusSymbol = function (isPlusZero?: boolean): string {
if (isPlusZero) {
return this >= 0 ? `+${this.formatMoneyInTable()}` : this.formatMoneyInTable();
}
else {
return this > 0 ? `+${this.formatMoneyInTable()}` : this.formatMoneyInTable();
}
}
Number.prototype.formatMoney = function (): string {
// let format = Number(this).truncDigits(4).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
let str = Number(this).truncDigits(UmConfig.digitRound).toString();
let regx = /(\d{1,3})(\d{3}(?:,|$))/;
let currStr;
do {
currStr = (currStr || str.split(`.`)[0]).replace(regx, `$1,$2`)
} while (currStr.match(regx)) //Stop when there's no match & null's returned
return (str.split(`.`)[1]) ? currStr.concat(`.`, str.split(`.`)[1]) : currStr;
}
Number.prototype.formatInt = function (): string {
return Number(this).roundDigits(0).toLocaleString('en-US');
}
Number.prototype.formatNumberLessThan10 = function (): string {
return ('0' + Number(this)).slice(-2);
}
Number.prototype.formatMoneyKMB = function (): string {
if (UmConfig.isRoundMoney) {
return Number(this).toMoneyKMB(1);
}
else {
return Number(this).formatMoney();
}
}
Number.prototype.formatMoneyInTable = function (): string {
let number = Number(this);
if (UmConfig.isRoundMoney) {
if (Math.abs(number) < 10000) {
return number.formatMoney();
}
else {
return number.toMoneyKMB(1);
}
}
else {
if (Math.abs(number) < 1000) {
return number.formatMoney();
}
else {
return number.toMoneyKMB(1);
}
}
}
Number.prototype.pformatMoneyWC = function (): string {
return Number(this).formatMoney();
}

View File

@ -0,0 +1,9 @@
{
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "60cdf1b9-fb63-400b-b752-d1c1913f9eca",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@ -0,0 +1,80 @@
import * as cc from 'cc';
import { _decorator, Component } from 'cc';
import { UmDeviceInfo } from './UmDeviceInfo';
import { UmClientEvent } from './UmOneToMultiListener';
const { ccclass, property } = _decorator;
@ccclass('UmNativeBridge')
export class UmNativeBridge extends Component {
static _instance: UmNativeBridge;
static get instance() {
if (UmNativeBridge._instance) {
return UmNativeBridge._instance;
}
UmNativeBridge._instance = new UmNativeBridge();
return UmNativeBridge._instance;
}
public vibrate() {
//check web desktop
if (UmDeviceInfo.isDesktopBrowser)
return;
//check mobile browser (ios can not vibrate in browser)
if (UmDeviceInfo.isMobileBrowser && !UmDeviceInfo.isIos) {
navigator?.vibrate([500]);
return;
}
//check native
if (!UmDeviceInfo.isNative)
return;
//android native
if (UmDeviceInfo.isAndroid) {
cc.native.reflection.callStaticMethod("com/cocos/game/AppActivity", "vibrate", "(I)V", 600);
return;
}
//ios native
if (UmDeviceInfo.isIos) {
cc.native.reflection.callStaticMethod("NativeBridge", "VibrateWithIntensity:", "0.5");
return;
}
}
public getTokenFromDeepLink(): string {
if (UmDeviceInfo.isAndroidNative) {
return cc.native.reflection.callStaticMethod("com/cocos/game/AppActivity", "getTokenFromDeepLink", "()Ljava/lang/String;");
}
if (UmDeviceInfo.isIosNative) {
return cc.native.reflection.callStaticMethod("NativeBridge", "GetTokenFromDeepLink:", "0");
}
return "";
}
public onCallNative(evt: string, content: string = "") {
if (UmDeviceInfo.isAndroidNative) {
return cc.native.reflection.callStaticMethod("com/cocos/game/AppActivity", "onCallFromJavascript", "(Ljava/lang/String;Ljava/lang/String;)V", evt, content);
}
// if (UmDeviceInfo.isIosNative) {
// return cc.native.reflection.callStaticMethod("NativeBridge", "GetTokenFromDeepLink:", "0");
// }
}
public onNativeCallJS(evt: string, params: string)
{
UmClientEvent.dispatchEvent(evt, params);
}
}
window.NativeCallJS = (evt: string, params: string) => {
console.log('NativeCallJS------------------------> EVT ' + typeof evt + ' = ' + evt + " ==>> " + params);
UmNativeBridge.instance.onNativeCallJS(evt, params);
}

View File

@ -0,0 +1,9 @@
{
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "4bdd59f4-01a6-4c68-ab32-c199366aae2f",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@ -0,0 +1,101 @@
// Learn cc.Class:
// - [Chinese] http://docs.cocos.com/creator/manual/zh/scripting/class.html
// - [English] http://www.cocos2d-x.org/docs/creator/en/scripting/class.html
// Learn Attribute:
// - [Chinese] http://docs.cocos.com/creator/manual/zh/scripting/reference/attributes.html
// - [English] http://www.cocos2d-x.org/docs/creator/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
// - [Chinese] http://docs.cocos.com/creator/manual/zh/scripting/life-cycle-callbacks.html
// - [English] http://www.cocos2d-x.org/docs/creator/en/scripting/life-cycle-callbacks.html
import { _decorator, error } from "cc";
const { ccclass } = _decorator;
@ccclass("UmOneToMultiListener")
export class UmOneToMultiListener {
static handlers: { [name: string]: { handler: Function, target: any }[] };
static supportEvent: { [name: string]: string };
public static on(eventName: string, handler: Function, target?: any) {
const objHandler = { handler: handler, target: target };
let handlerList = this.handlers[eventName];
if (!handlerList) {
handlerList = [];
this.handlers[eventName] = handlerList;
}
for (var i = 0; i < handlerList.length; i++) {
if (!handlerList[i]) {
handlerList[i] = objHandler;
return i;
}
}
handlerList.push(objHandler);
return handlerList.length;
};
public static off(eventName: string, handler: Function, target?: any) {
const handlerList = this.handlers[eventName];
if (!handlerList) {
return;
}
for (let i = 0; i < handlerList.length; i++) {
const oldObj = handlerList[i];
if (oldObj.handler === handler && (!target || target === oldObj.target)) {
handlerList.splice(i, 1);
break;
}
}
};
public static offAll() {
this.handlers = {};
}
public static dispatchEvent(eventName: string, ...args: any[]) {
const handlerList = this.handlers[eventName];
const params = [];
let i;
for (i = 1; i < arguments.length; i++) {
params.push(arguments[i]);
}
if (!handlerList) {
return;
}
for (i = 0; i < handlerList.length; i++) {
const objHandler = handlerList[i];
if (objHandler.handler) {
objHandler.handler.apply(objHandler.target, args);
}
}
};
public static setSupportEventList(arrSupportEvent: string[]) {
if (!(arrSupportEvent instanceof Array)) {
error("supportEvent was not array");
return false;
}
this.supportEvent = {};
for (let i in arrSupportEvent) {
const eventName = arrSupportEvent[i];
this.supportEvent[eventName] = i;
}
return true;
};
}
@ccclass("clientEventUm")
export class UmClientEvent extends UmOneToMultiListener {
static handlers = {};
}

View File

@ -0,0 +1,9 @@
{
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "a92f3f99-339e-4b5f-b6ee-bcab5df4aa36",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@ -0,0 +1,99 @@
import { _decorator, Component } from 'cc';
const { ccclass, property } = _decorator;
@ccclass('UmStorageManager')
export class UmStorageManager extends Component {
static _instance: UmStorageManager;
private _user_id: string = "";
static get instance() {
if (UmStorageManager._instance) {
return UmStorageManager._instance;
}
UmStorageManager._instance = new UmStorageManager();
UmStorageManager._instance.initData();
return UmStorageManager._instance;
}
initData() {
this._user_id = this.getUserId();
}
getNumberByKey(key: string, default_value: number = 0, isUser: boolean = false): number {
key = this._convertKey(key, isUser);
let result = localStorage.getItem(key);
return result ? Number(result) : default_value;
}
public setNumberByKey(key: string, value: number, isUser: boolean = false) {
key = this._convertKey(key, isUser);
localStorage.setItem(key, value.toString());
}
public getStringByKey(key: string, default_value: string = "", isUser: boolean = false): string {
key = this._convertKey(key, isUser);
let result = localStorage.getItem(key);
return result ? result : default_value;
}
public setStringByKey(key: string, value: string, isUser: boolean = false) {
key = this._convertKey(key, isUser);
localStorage.setItem(key, value);
}
public getBooleanByKey(key: string, default_value: boolean = false, isUser: boolean = false): boolean {
key = this._convertKey(key, isUser);
let result = localStorage.getItem(key);
if (result) {
return result === "true" ? true : false;
}
else {
return default_value;
}
}
public setBooleanByKey(key: string, value: boolean, isUser: boolean = true) {
key = this._convertKey(key, isUser);
localStorage.setItem(key, value ? "true" : "false");
}
public removeKey(key: string)
{
localStorage.removeItem(key);
}
public removeAllKey()
{
localStorage.clear();
}
private _convertKey(key: string, isUser: boolean): string {
key = "pkz" + key;
if (isUser) {
key = this._user_id + key;
}
return key;
}
public encrypt(input: string): string {
return input?.length > 0 ? btoa(new TextEncoder().encode(input).toString()) : "";
}
public decrypt(input: string): string {
return input?.length > 0 ? new TextDecoder().decode(new Uint8Array(atob(input).split(',').map((s: string) => { return Number(s) }))).toString() : "";
}
//------- USER ID ----------------------------------
public setUserId(userId: string) {
this._user_id = userId;
localStorage.setItem("user_id", userId);
}
public getUserId(): string {
let result = localStorage.getItem("user_id");
return result ? result : "";
}
}

View File

@ -0,0 +1,9 @@
{
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "1a710ebb-0de5-45e0-938a-c40324678c94",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@ -0,0 +1,753 @@
import * as cc from "cc";
import { Vec2 } from "cc";
import { Color } from "cc";
import { _decorator, ITweenOption, Node, sp, Tween, tween, UIOpacity, UITransform, Vec3 } from "cc";
const { ccclass, property } = _decorator;
declare const pako: any;
@ccclass("UmUtil")
export class UmUtil {
/**
* !#zh object
*/
public static clone(sObj: any) {
if (sObj === null || typeof sObj !== "object") {
return sObj;
}
let s: any = {};
if (sObj.constructor === Array) {
s = [];
}
for (const i in sObj) {
if (sObj.hasOwnProperty(i)) {
s[i] = this.clone(sObj[i]);
}
}
return s;
}
/**
* object
*/
public static objectToArray(srcObj: any) {
const resultArr = [];
// to array
for (let key in srcObj) {
if (!srcObj.hasOwnProperty(key)) {
continue;
}
resultArr.push(srcObj[key]);
}
return resultArr;
}
/**
* !#zh object
*/
public static arrayToObject(srcObj: any, objectKey: any) {
const resultObj: any = {};
// to object
for (let key in srcObj) {
if (!srcObj.hasOwnProperty(key) || !srcObj[key][objectKey]) {
continue;
}
resultObj[srcObj[key][objectKey]] = srcObj[key];
}
return resultObj;
}
// 根据权重,计算随机内容
public static getWeightRandIndex(weightArr: any, totalWeight: number) {
const randWeight = Math.floor(Math.random() * totalWeight);
let sum = 0;
let weightIndex = 0;
for (weightIndex; weightIndex < weightArr.length; weightIndex++) {
sum += weightArr[weightIndex];
if (randWeight < sum) {
break;
}
}
return weightIndex;
}
/**
* nm
* @param {Number} n
* @param {Number} m
* @returns {Array} array
*/
public static getRandomNFromM(n: number, m: number) {
const array: number[] = [];
let intRd = 0;
let count = 0;
while (count < m) {
if (count >= n + 1) {
break;
}
intRd = this.getRandomInt(0, n);
let flag = 0;
for (let i = 0; i < count; i++) {
if (array[i] === intRd) {
flag = 1;
break;
}
}
if (flag === 0) {
array[count] = intRd;
count++;
}
}
return array;
}
public static getRandomInt(min: number, max: number) {
const r = Math.random();
const rr = r * (max - min + 1) + min;
return Math.floor(rr);
}
public static getStringLength(render: string) {
const strArr = render;
let len = 0;
for (let i = 0, n = strArr.length; i < n; i++) {
const val = strArr.charCodeAt(i);
if (val <= 255) {
len = len + 1;
}
else {
len = len + 2;
}
}
return Math.ceil(len / 2);
}
/**
* Objectundefinedfalse
* @param obj
*/
public static isEmptyObject(obj: any) {
let result = true;
if (obj && obj.constructor === Object) {
for (const key in obj) {
if (obj.hasOwnProperty(key)) {
result = false;
break;
}
}
}
else {
result = false;
}
return result;
}
public static formatNum(num: number) {
// 0 和负数均返回 NaN。特殊处理。
if (num <= 0) {
return '0';
}
const k = 1000;
const sizes = ['', '', 'K', 'M', 'B'];
const i = Math.round(Math.log(num) / Math.log(k));
return parseInt((num / (Math.pow(k, i - 1 < 0 ? 0 : i - 1))).toString(), 10) + sizes[i];
}
public static formatMoneyWithFraction(num: number, fraction?: number) {
return num.toFixed(fraction).replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}
/**
*
* @param {Object|Number} dateValue todo MessageCenter pve Date
* @returns {boolean}
*/
public static isNewDay(dateValue: any) {
// todo是否需要判断时区
const oldDate = new Date(dateValue);
const curDate = new Date();
const oldYear = oldDate.getFullYear();
const oldMonth = oldDate.getMonth();
const oldDay = oldDate.getDate();
const curYear = curDate.getFullYear();
const curMonth = curDate.getMonth();
const curDay = curDate.getDate();
if (curYear > oldYear) {
return true;
}
else {
if (curMonth > oldMonth) {
return true;
}
else {
if (curDay > oldDay) {
return true;
}
}
}
return false;
}
public static getPropertyCount(o: Object) {
let n, count = 0;
for (n in o) {
if (o.hasOwnProperty(n)) {
count++;
}
}
return count;
}
/**
* arraydiff
* @param array
* @param diff
*/
public static difference(array: any, diff: any) {
const result: number[] = [];
if (array.constructor !== Array || diff.constructor !== Array) {
return result;
}
const length = array.length;
for (let i = 0; i < length; i++) {
if (diff.indexOf(array[i]) === -1) {
result.push(array[i]);
}
}
return result;
}
// 模拟传msg的uuid
public static simulationUUID() {
function s4() {
return Math.floor((1 + Math.random()) * 0x10000)
.toString(16)
.substring(1);
}
return s4() + s4() + '-' + s4() + '-' + s4() + '-' +
s4() + '-' + s4() + s4() + s4();
}
public static trim(str: string) {
return str.replace(/(^\s*)|(\s*$)/g, "");
}
/**
*
* @param {String|Number} start
* @param {String|Number} end
*/
public static isNowValid(start: string | number, end: string | number) {
const startTime = new Date(start);
const endTime = new Date(end);
let result = false;
if (startTime.getDate() + '' !== 'NaN' && endTime.getDate() + '' !== 'NaN') {
const curDate = new Date();
result = curDate < endTime && curDate > startTime;
}
return result;
}
public static getDeltaDays(start: string | number, end: string | number) {
const startData = new Date(start);
const endData = new Date(end);
const startYear = startData.getFullYear();
const startMonth = startData.getMonth() + 1;
const startDate = startData.getDate();
const endYear = endData.getFullYear();
const endMonth = endData.getMonth() + 1;
const endDate = endData.getDate();
start = new Date(startYear + '/' + startMonth + '/' + startDate + ' GMT+0800').getTime();
end = new Date(endYear + '/' + endMonth + '/' + endDate + ' GMT+0800').getTime();
const deltaTime = end - start;
return Math.floor(deltaTime / (24 * 60 * 60 * 1000));
}
public static getMin(array: any) {
let result = 0;
if (array.constructor === Array) {
const length = array.length;
for (let i = 0; i < length; i++) {
if (i === 0) {
result = Number(array[0]);
}
else {
result = result > Number(array[i]) ? Number(array[i]) : result;
}
}
}
return result;
}
public static formatTwoDigits(time: number) {
return (Array(2).join('0') + time).slice(-2);
}
public static formatDate(date: Date, fmt: string) {
const o: { [name: string]: number } = {
"M+": date.getMonth() + 1, //月份
"d+": date.getDate(), //日
"h+": date.getHours(), //小时
"m+": date.getMinutes(), //分
"s+": date.getSeconds(), //秒
"q+": Math.floor((date.getMonth() + 3) / 3), //季度
"S": date.getMilliseconds() //毫秒
};
if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (date.getFullYear() + "").substr(4 - RegExp.$1.length));
for (const k in o)
if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (`${o[k]}`) : ((`00${o[k]}`).substr(("" + o[k]).length)));
return fmt;
}
/**
*
*/
public static getDay(time: number, splitChar: string = '-') {
const date = new Date(time);
return date.getDate() + splitChar + (date.getMonth() + 1) + splitChar + date.getFullYear();
}
public static getTime(): number
{
return (new Date()).getTime();
}
/**
* 10000 10K 10000K 10M
*/
public static formatMoney(money: number) {
const arrUnit = ['', 'K', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y', 'B', 'N', 'D'];
let strValue = '';
for (let idx = 0; idx < arrUnit.length; idx++) {
if (money >= 10000) {
money /= 1000;
}
else {
strValue = Math.floor(money) + arrUnit[idx];
break;
}
}
if (strValue === '') {
strValue = Math.floor(money) + 'U'; //超过最大值就加个U
}
return strValue;
}
/**
* HH:MM:SS
* @param {Number} leftSec
*/
public static formatTimeForSecond(leftSec: number) {
let timeStr = '';
const sec = leftSec % 60;
let leftMin = Math.floor(leftSec / 60);
leftMin = leftMin < 0 ? 0 : leftMin;
const hour = Math.floor(leftMin / 60);
const min = leftMin % 60;
if (hour > 0) {
timeStr += hour > 9 ? hour.toString() : '0' + hour;
timeStr += ':';
}
timeStr += min > 9 ? min.toString() : '0' + min;
timeStr += ':';
timeStr += sec > 9 ? sec.toString() : '0' + sec;
return timeStr;
}
/**
* HH:MM:SS
*
* @param {Number} ms
*/
public static formatTimeForMillisecond(ms: number) {
let second = Math.floor(ms / 1000 % 60);
let minute = Math.floor(ms / 1000 / 60 % 60);
let hour = Math.floor(ms / 1000 / 60 / 60);
let strSecond = second < 10 ? '0' + second : second;
let strMinute = minute < 10 ? '0' + minute : minute;
let strHour = hour < 10 ? '0' + hour : hour;
return `${strSecond}:${strMinute}:${strHour}`;
}
/**
* TODO pako使
*
* @param {String} str
*/
public static zip(str: string) {
const binaryString = pako.gzip(encodeURIComponent(str), { to: 'string' });
// @ts-ignore
return this.base64encode(binaryString);
}
public static rand(arr: any) {
let arrClone = this.clone(arr);
// 首先从最大的数开始遍历,之后递减
for (let i = arrClone.length - 1; i >= 0; i--) {
// 随机索引值randomIndex是从0-arrClone.length中随机抽取的
const randomIndex = Math.floor(Math.random() * (i + 1));
// 下面三句相当于把从数组中随机抽取到的值与当前遍历的值互换位置
const itemIndex = arrClone[randomIndex];
arrClone[randomIndex] = arrClone[i];
arrClone[i] = itemIndex;
}
// 每一次的遍历都相当于把从数组中随机抽取不重复的一个元素放到数组的最后面索引顺序为len-1,len-2,len-3......0
return arrClone;
}
public static randRange(min: any, max: any) {
return Math.floor(Math.random() * (max - min + 1)) + min;
}
public static getPostionNodeInOtherNode(spaceNode: any, targetNode: any) {
if (targetNode.parent == null) {
return null;
}
let pos = new Vec3(0, 0, 0);
const targetNodeComponent = targetNode.parent.getComponent(UITransform);
const spaceNodeComponent = spaceNode.getComponent(UITransform);
if (!targetNodeComponent) {
targetNode.parent.addComponent(UITransform);
}
if (!spaceNodeComponent) {
spaceNode.addComponent(UITransform);
}
pos = targetNodeComponent.convertToWorldSpaceAR(targetNode.getPosition());
return spaceNodeComponent ? spaceNodeComponent.convertToNodeSpaceAR(pos) : pos;
}
public static getPointInNodeFromWorldPoint(worldPoint: Vec3, node: Node) {
return node.getComponent(UITransform)?.convertToNodeSpaceAR(worldPoint);
}
public static validURL(str: string) {
var pattern = new RegExp('^(https?:\\/\\/)?' + // protocol
'((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|' + // domain name
'((\\d{1,3}\\.){3}\\d{1,3}))' + // OR ip (v4) address
'(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*' + // port and path
'(\\?[;&a-z\\d%_.~+=-]*)?' + // query string
'(\\#[-a-z\\d_]*)?$', 'i'); // fragment locator
return !!pattern.test(str);
}
public static deepEqual(object1: any, object2: any) {
const keys1 = Object.keys(object1);
const keys2 = Object.keys(object2);
if (keys1.length !== keys2.length) {
return false;
}
for (const key of keys1) {
const val1 = object1[key];
const val2 = object2[key];
const areObjects = this.isObject(val1) && this.isObject(val2);
if (
areObjects && !this.deepEqual(val1, val2) ||
!areObjects && val1 !== val2
) {
return false;
}
}
return true;
}
public static isObject(object: any) {
return object != null && typeof object === 'object';
}
public static getKeyObject(obj: any, value: any) {
let result: string = "";
for (let [key, val] of Object.entries(obj)) {
if (value === val) {
result = key;
break;
}
}
return result;
}
public static getHighestSiblingIndexOfChild(parentNode: Node): number {
let highestSiblingIndex: number = 0;
parentNode.children.forEach((child: Node, index: number) => {
const siblingIndex = child.getSiblingIndex();
if (highestSiblingIndex < siblingIndex) {
highestSiblingIndex = siblingIndex;
}
});
return highestSiblingIndex;
}
public static fadeTo(target: Node, duration: number, opacity: number, options?: ITweenOption, callback?: Function): Tween<object> {
let uiOpacity = target.getComponent(UIOpacity)!;
if (uiOpacity === null) uiOpacity = target.addComponent(UIOpacity);
let spine: sp.Skeleton = target.getComponent(sp.Skeleton)!;
options = options || {};
if (spine) {
if (options.onUpdate) {
let _onUpdate = options.onUpdate;
options.onUpdate = function () {
UmUtil.setAlphaSpine(spine, uiOpacity.opacity);
_onUpdate && _onUpdate();
}
}
else {
options.onUpdate = function () {
UmUtil.setAlphaSpine(spine, uiOpacity.opacity);
}
}
}
let tweenFade = tween(uiOpacity);
tweenFade.to(duration, { opacity }, options).start();
(target as any).tweenFade = tweenFade;
return tweenFade;
}
public static fadeIn(target: Node, duration: number, options?: ITweenOption): Tween<Node> {
return UmUtil.fadeTo(target, duration, 255, options);
}
public static fadeOut(target: Node, duration: number, options?: ITweenOption): Tween<Node> {
return UmUtil.fadeTo(target, duration, 0, options);
}
public static uuid() {
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);
return v.toString(16);
});
};
public static getWindowSize(): cc.Size {
return cc.screen.windowSize;
}
public static getCanvasSize(): cc.Size {
const viewSize = cc.screen.windowSize;
const designSize = cc.view.getDesignResolutionSize();
let windowWidth = viewSize.width;
let windowHeight = viewSize.height;
let windowRatio = windowWidth * 1.0 / windowHeight;
const designRatio = designSize.width * 1.0 / designSize.height;
let height = designSize.height;
if (windowRatio <= designRatio) {
// let cHeight = Math.floor(designSize.width / windowRatio);
height = designSize.width / viewSize.width * viewSize.height;
}
cc.log("getCanvasSize ==> ", designSize.width, height);
return new cc.Size(designSize.width, height);
}
public static multiplicationExact(numb1: number, numb2: number) {
let digit1 = Number(numb1.toString().split('.')[1]?.length);
if (Number.isNaN(digit1)) digit1 = 0;
let digit2 = Number(numb2.toString().split('.')[1]?.length);
if (Number.isNaN(digit2)) digit2 = 0;
let maxDigit = digit1 + digit2;
for (let i = 0; i < 7; i++) {
let factor = Math.pow(10, i);
let result = ((numb1 / factor) * (numb2 / factor)) * factor * factor;
let digit_check = Number(result.toString().split('.')[1]?.length);
if (Number.isNaN(digit_check) || Number(digit_check) <= maxDigit) {
// cc.log(" multipl1 ===> digit = ", digit_check, " | pow = 10^", i);
return result;
}
}
for (let i = 0; i < 7; i++) {
let factor = Math.pow(10, i);
let result = ((numb1 / factor) * (numb2 / factor)) * Math.pow(factor, 2);
let digit_check = Number(result.toString().split('.')[1]?.length);
if (Number.isNaN(digit_check) || Number(digit_check) <= maxDigit) {
// cc.log(" multipl2 ===> digit_check = ", digit_check, " | pow = 10^", i);
return result;
}
}
// cc.log("RESULT ==> ", result);
return numb1 * numb2;
}
public static setLabelSubStringByMaxWidth(label: cc.Label, maxWidth: number) {
label.updateRenderData();
let transform = label.getComponent(UITransform)!;
if (transform.width > maxWidth) {
while (transform.width > maxWidth) {
label.string = label.string.slice(0, -1);
label.updateRenderData();
}
label.string += "...";
}
}
public static PlusExact(numb1: number, numb2: number) {
let digit1 = Number(numb1.toString().split('.')[1]?.length);
if (Number.isNaN(digit1)) digit1 = 0;
let digit2 = Number(numb2.toString().split('.')[1]?.length);
if (Number.isNaN(digit2)) digit2 = 0;
let maxDigit = Math.max(digit1, digit2);
for (let i = 0; i < 7; i++) {
let factor = Math.pow(10, i);
let result = ((numb1 / factor) + (numb2 / factor)) * factor * factor;
let digit_check = Number(result.toString().split('.')[1]?.length);
if (Number.isNaN(digit_check) || Number(digit_check) <= maxDigit) {
// cc.log(" multipl1 ===> digit = ", digit_check, " | pow = 10^", i);
return result;
}
}
for (let i = 0; i < 7; i++) {
let factor = Math.pow(10, i);
let result = ((numb1 / factor) + (numb2 / factor)) * Math.pow(factor, 2);
let digit_check = Number(result.toString().split('.')[1]?.length);
if (Number.isNaN(digit_check) || Number(digit_check) <= maxDigit) {
// cc.log(" multipl2 ===> digit_check = ", digit_check, " | pow = 10^", i);
return result;
}
}
// cc.log("RESULT ==> ", result);
return numb1 + numb2;
}
public static setAlphaSpine(spine: sp.Skeleton, alpha: number) {
let color: Color = Color.clone(spine.color);
color.a = alpha;
spine.color = color;
}
public static moveTo(obj: Node, pointTo: Vec3, duration: number, delayTime?: number, callback?: Function, tag = UmUtil.TWEEN_TAG) {
if (!obj) return;
tween(obj).delay(delayTime).to(duration, { position: pointTo }).call(() => callback?.()).tag(tag).start();
}
public static worldMoveTo(obj: Node, worldPointTo: Vec3, duration: number, delayTime?: number, callback?: Function, tag = UmUtil.TWEEN_TAG) {
if (!obj) return;
tween(obj).delay(delayTime).to(duration, { worldPosition: worldPointTo }).call(() => callback?.()).tag(tag).start();
}
public static scaleTo(obj: Node, scaleTo: Vec3, duration: number, delayTime?: number, callback?: Function, tag = UmUtil.TWEEN_TAG) {
if (!obj) return;
tween(obj).delay(delayTime).to(duration, { scale: scaleTo }).call(() => callback?.()).tag(tag).start();
}
public static delay(obj: Node, delayTime: number, callback: Function, tag = UmUtil.TWEEN_TAG) {
tween(obj).delay(delayTime).call(() => {
if (obj?.active) {
callback?.();
}
}).tag(tag).start();
}
public static rotateBy(obj: Node, angle: number, duration: number, delayTime?: number, callback?: Function, tag = UmUtil.TWEEN_TAG) {
if (!obj) return;
tween(obj).delay(delayTime).by(duration, { angle: angle }).call(() => callback?.()).tag(tag).start();
}
public static tweenValue(from, to, duration, updateCallback = null, completeCallback = null)
{
const _target = { value: from };
var tweenValue = tween(_target)
.to(duration, { value: to }, {
'onStart': () => {
},
'onUpdate': () => {
updateCallback?.(_target.value);
},
'onComplete': () => {
completeCallback?.();
}
});
tweenValue.start();
return tweenValue;
}
public static TWEEN_TAG = 2003;
public static stopAllTweenTarget(obj: Node)
{
Tween.stopAllByTarget(obj);
}
public static stopAllTweenTag(tag: number) {
Tween.stopAllByTag(tag);
}
public static plusTwoVector3(a: Vec3, b: Vec3)
{
var result = new Vec3();
Vec3.add(result, a, b);
return result;
}
public static subtractTwoVector3(a: Vec3, b: Vec3) {
var result = new Vec3();
Vec3.subtract(result, a, b);
return result;
}
public static scaleVector3(a: Vec3, b: number) {
return new Vec3(a.x * b, a.y * b, a.z * b);
}
// public static subtractTwoVector3(a: Vec3, b: Vec3) {
// var result = new Vec3();
// Vec3.subtract(result, a, b);
// return result;
// }
}

View File

@ -0,0 +1,9 @@
{
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "a1649dba-2b39-4bc6-bba8-ce0f44c03741",
"files": [],
"subMetas": {},
"userData": {}
}

12
assets/cc-game.meta Normal file
View File

@ -0,0 +1,12 @@
{
"ver": "1.2.0",
"importer": "directory",
"imported": true,
"uuid": "dcb35788-4cf3-4fcf-ac26-1703585b43b1",
"files": [],
"subMetas": {},
"userData": {
"compressionType": {},
"isRemoteBundle": {}
}
}

9
assets/cc-game/Test.meta Normal file
View File

@ -0,0 +1,9 @@
{
"ver": "1.2.0",
"importer": "directory",
"imported": true,
"uuid": "c2b242bc-18c8-4663-b7b3-6df51641ff05",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@ -0,0 +1,87 @@
import { _decorator, Component, Node } from 'cc';
import { NodeBase } from '../scripts/base/NodeBase';
import { Vec3, EventTouch } from 'cc';
import { UmUtil } from '../../cc-common/cc-util/UmUtil';
import { HeroMove } from '../scripts/game_play/hero/HeroMove';
import { GameGlobalData } from '../scripts/global/GameGlobalData';
import { UmLog } from '../../cc-common/cc-util/UmLog';
import { UmClientEvent } from '../../cc-common/cc-util/UmOneToMultiListener';
import { GameDefine } from '../scripts/config/GameDefine';
const { ccclass, property } = _decorator;
@ccclass('JoyStick')
export class JoyStick extends NodeBase {
@property(HeroMove) objectMove: HeroMove = null!;
@property(Node) handle: Node = null!;
originPoint: Vec3 = Vec3.ZERO;
joyStickSpeed: Number = 5;
handleMaxDistance: number;
start() {
this.enableTouch();
this.handleMaxDistance = (this.node.getNodeTransform().width - this.handle.getNodeTransform().width) / 2;
}
protected onTouchStart(event: EventTouch) {
if (!GameGlobalData.Instance.isStatePlay()) return;
this.originPoint = new Vec3(this.node.position);
this.joyStickSpeed = GameGlobalData.Instance.heroControlConfig.joyStickSpeed;
let newPoint = this.getTouchPointInParentNode(event.getUILocation());
let direction = UmUtil.subtractTwoVector3(newPoint, this.originPoint);
this.setHandlePosition(newPoint, new Vec3(direction));
UmClientEvent.dispatchEvent(GameDefine.EVENT_START_JOYSTICK);
}
protected onTouchEnd(event: EventTouch) {
if (!GameGlobalData.Instance.isStatePlay()) return;
this.objectMove.isTouchEnable = false;
this.handle.position = Vec3.ZERO;
this.objectMove.directionVec3 = Vec3.ZERO;
if (GameGlobalData.Instance.isStatePlay())
UmClientEvent.dispatchEvent(GameDefine.EVENT_END_JOYSTICK);
}
protected onTouchCancel(event: EventTouch) {
if (!GameGlobalData.Instance.isStatePlay()) return;
this.objectMove.isTouchEnable = false;
this.handle.position = Vec3.ZERO;
this.objectMove.directionVec3 = Vec3.ZERO;
if (GameGlobalData.Instance.isStatePlay())
UmClientEvent.dispatchEvent(GameDefine.EVENT_END_JOYSTICK);
}
protected onTouchMove(event: EventTouch) {
if (!GameGlobalData.Instance.isStatePlay()) return;
let newPoint = this.getTouchPointInParentNode(event.getUILocation());
let direction = UmUtil.subtractTwoVector3(newPoint, this.originPoint);
direction.normalize();
direction = UmUtil.scaleVector3(direction, 5);
this.objectMove.isTouchEnable = true;
this.objectMove.directionVec3 = direction;
GameGlobalData.Instance.lastHeroMoveDirection = direction;
// UmLog.log(newPoint.toString());
// this.currentPoint = new Vec3(newPoint);
this.setHandlePosition(newPoint, new Vec3(direction));
}
setHandlePosition(newPoint, direction) {
var distance = Vec3.distance(newPoint, this.originPoint);
if (distance > this.handleMaxDistance) {
direction = UmUtil.scaleVector3(direction.normalize(), this.handleMaxDistance);
newPoint = UmUtil.plusTwoVector3(this.originPoint, direction);
}
this.handle.worldPosition = this.node?.parent.getNodeTransform().convertToWorldSpaceAR(newPoint);
}
getTouchPointInParentNode(touchPoint): Vec3 {
return this.node.parent?.getNodeTransform().convertToNodeSpaceAR(touchPoint.toVec3());
}
}

View File

@ -0,0 +1,9 @@
{
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "0e282282-101a-4cf2-a672-3ac6fc718270",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@ -0,0 +1,105 @@
import { _decorator, CCInteger, Collider2D, Component, Contact2DType, EventTouch, IPhysics2DContact, log, Node, PhysicsSystem2D, Sprite, Vec3 } from 'cc';
import { RigidBody2D } from 'cc';
import { NodeBase } from '../scripts/base/NodeBase';
import { EPhysics2DDrawFlags } from 'cc';
import { director } from 'cc';
import { UmUtil } from '../../cc-common/cc-util/UmUtil';
import { Vec2 } from 'cc';
const { ccclass, property } = _decorator;
@ccclass('PhysicTest')
export class PhysicTest extends NodeBase {
@property(Sprite)
sprite: Sprite = null!;
@property(CCInteger)
deltaX: number = 0;
rigiBody: RigidBody2D;
start() {
this.rigiBody = this.node.getComponent(RigidBody2D);
// Registering callback functions for a single collider
let collider = this.getComponent(Collider2D);
PhysicsSystem2D.instance.debugDrawFlags = EPhysics2DDrawFlags.Shape;
if (collider) {
collider.on(Contact2DType.BEGIN_CONTACT, this.onBeginContact, this);
collider.on(Contact2DType.END_CONTACT, this.onEndContact, this);
// collider.on(Contact2DType.PRE_SOLVE, this.onPreSolve, this);
// collider.on(Contact2DType.POST_SOLVE, this.onPostSolve, this);
}
this.enableTouch();
UmUtil.delay(this.node, 2, () => {
this.rigiBody.applyLinearImpulseToCenter(new Vec2(0, 75), false);
});
// Registering global contact callback functions
// if (PhysicsSystem2D.instance) {
// PhysicsSystem2D.instance.on(Contact2DType.BEGIN_CONTACT, this.onBeginContact, this);
// PhysicsSystem2D.instance.on(Contact2DType.END_CONTACT, this.onEndContact, this);
// PhysicsSystem2D.instance.on(Contact2DType.PRE_SOLVE, this.onPreSolve, this);
// PhysicsSystem2D.instance.on(Contact2DType.POST_SOLVE, this.onPostSolve, this);
// }
}
onBeginContact(selfCollider: Collider2D, otherCollider: Collider2D, contact: IPhysics2DContact | null) {
// will be called once when two colliders begin to contact
console.log('onBeginContact');
// director.loadScene("Test");
// selfCollider.node.destroy();
}
onEndContact(selfCollider: Collider2D, otherCollider: Collider2D, contact: IPhysics2DContact | null) {
// will be called once when the contact between two colliders just about to end.
console.log('onEndContact');
}
onPreSolve(selfCollider: Collider2D, otherCollider: Collider2D, contact: IPhysics2DContact | null) {
// will be called every time collider contact should be resolved
console.log('onPreSolve');
}
onPostSolve(selfCollider: Collider2D, otherCollider: Collider2D, contact: IPhysics2DContact | null) {
// will be called every time collider contact should be resolved
console.log('onPostSolve');
}
update(deltaTime: number) {
// log('test');
if (!this.isTouchEnable) return;
// this.node.position = UmUtil.plusTwoVector3(this.node.position, this.directionVec3);
// this.rigiBody.applyForceToCenter(new Vec2(10, 40), true);
}
directionVec3: Vec3 = Vec3.ZERO;
isTouchEnable = true;
currentPoint: Vec3 = Vec3.ZERO;
protected onTouchStart(event: EventTouch) {
this.currentPoint = new Vec3(this.node.position);
// let point = this.getTouchPointInParentNode(event.getUILocation());
}
protected onTouchEnd(event: EventTouch) { }
protected onTouchCancel(event: EventTouch) { }
protected onTouchMove(event: EventTouch) {
let newPoint = this.getTouchPointInParentNode(event.getUILocation());
this.node.position = newPoint;
// let direction = UmUtil.subtractTwoVector3(newPoint, this.currentPoint);
// direction.normalize();
// direction = UmUtil.scaleVector3(direction, 30);
// this.node.position = UmUtil.plusTwoVector3(this.currentPoint, direction);
// this.currentPoint = this.node.position;
// // this.rigiBody.
// // UmLog.log(`onTouchMove: ${event.getLocation()}`);
// // this.node.worldPosition = event.getLocation().toVec3();
}
getTouchPointInParentNode(touchPoint): Vec3 {
return this.node.parent?.getNodeTransform().convertToNodeSpaceAR(touchPoint.toVec3());
}
}

View File

@ -0,0 +1,9 @@
{
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "34887606-9d45-43d5-846b-643ada88d926",
"files": [],
"subMetas": {},
"userData": {}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,11 @@
{
"ver": "1.1.50",
"importer": "scene",
"imported": true,
"uuid": "641dfdac-ab3c-4690-8fd1-b6de7d248493",
"files": [
".json"
],
"subMetas": {},
"userData": {}
}

12
assets/cc-game/res.meta Normal file
View File

@ -0,0 +1,12 @@
{
"ver": "1.2.0",
"importer": "directory",
"imported": true,
"uuid": "7642a20b-c7b1-4661-ba00-bcc7626ef83a",
"files": [],
"subMetas": {},
"userData": {
"compressionType": {},
"isRemoteBundle": {}
}
}

View File

@ -0,0 +1,12 @@
{
"ver": "1.2.0",
"importer": "directory",
"imported": true,
"uuid": "543784a7-a87a-4ce1-a1f1-f3472572493c",
"files": [],
"subMetas": {},
"userData": {
"compressionType": {},
"isRemoteBundle": {}
}
}

View File

@ -0,0 +1,3 @@
{
"__type__": "cc.SpriteAtlas"
}

View File

@ -0,0 +1,36 @@
{
"ver": "1.0.8",
"importer": "auto-atlas",
"imported": true,
"uuid": "e6240776-1785-4dda-a0e4-24f8e23d7564",
"files": [
".json"
],
"subMetas": {},
"userData": {
"maxWidth": 1024,
"maxHeight": 1024,
"padding": 2,
"allowRotation": true,
"forceSquared": false,
"powerOfTwo": false,
"algorithm": "MaxRects",
"format": "png",
"quality": 80,
"contourBleed": true,
"paddingBleed": true,
"filterUnused": true,
"removeTextureInBundle": true,
"removeImageInBundle": true,
"removeSpriteAtlasInBundle": true,
"compressSettings": {},
"textureSetting": {
"wrapModeS": "repeat",
"wrapModeT": "repeat",
"minfilter": "linear",
"magfilter": "linear",
"mipfilter": "none",
"anisotropy": 0
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

View File

@ -0,0 +1,134 @@
{
"ver": "1.0.26",
"importer": "image",
"imported": true,
"uuid": "c0f4d665-1de6-45d1-96fd-fafb5812e913",
"files": [
".json",
".png"
],
"subMetas": {
"6c48a": {
"importer": "texture",
"uuid": "c0f4d665-1de6-45d1-96fd-fafb5812e913@6c48a",
"displayName": "bg",
"id": "6c48a",
"name": "texture",
"userData": {
"wrapModeS": "clamp-to-edge",
"wrapModeT": "clamp-to-edge",
"minfilter": "linear",
"magfilter": "linear",
"mipfilter": "none",
"anisotropy": 0,
"isUuid": true,
"imageUuidOrDatabaseUri": "c0f4d665-1de6-45d1-96fd-fafb5812e913",
"visible": false
},
"ver": "1.0.22",
"imported": true,
"files": [
".json"
],
"subMetas": {}
},
"f9941": {
"importer": "sprite-frame",
"uuid": "c0f4d665-1de6-45d1-96fd-fafb5812e913@f9941",
"displayName": "bg",
"id": "f9941",
"name": "spriteFrame",
"userData": {
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 100,
"height": 100,
"rawWidth": 100,
"rawHeight": 100,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"packable": true,
"pixelsToUnit": 100,
"pivotX": 0.5,
"pivotY": 0.5,
"meshType": 0,
"vertices": {
"rawPosition": [
-50,
-50,
0,
50,
-50,
0,
-50,
50,
0,
50,
50,
0
],
"indexes": [
0,
1,
2,
2,
1,
3
],
"uv": [
0,
100,
100,
100,
0,
0,
100,
0
],
"nuv": [
0,
0,
1,
0,
0,
1,
1,
1
],
"minPos": [
-50,
-50,
0
],
"maxPos": [
50,
50,
0
]
},
"isUuid": true,
"imageUuidOrDatabaseUri": "c0f4d665-1de6-45d1-96fd-fafb5812e913@6c48a",
"atlasUuid": ""
},
"ver": "1.0.12",
"imported": true,
"files": [
".json"
],
"subMetas": {}
}
},
"userData": {
"hasAlpha": true,
"type": "sprite-frame",
"fixAlphaTransparencyArtifacts": false,
"redirect": "c0f4d665-1de6-45d1-96fd-fafb5812e913@f9941"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

View File

@ -0,0 +1,134 @@
{
"ver": "1.0.26",
"importer": "image",
"imported": true,
"uuid": "35e48152-8b86-4023-b87c-f745b261b992",
"files": [
".json",
".png"
],
"subMetas": {
"6c48a": {
"importer": "texture",
"uuid": "35e48152-8b86-4023-b87c-f745b261b992@6c48a",
"displayName": "hex",
"id": "6c48a",
"name": "texture",
"userData": {
"wrapModeS": "clamp-to-edge",
"wrapModeT": "clamp-to-edge",
"imageUuidOrDatabaseUri": "35e48152-8b86-4023-b87c-f745b261b992",
"isUuid": true,
"visible": false,
"minfilter": "linear",
"magfilter": "linear",
"mipfilter": "none",
"anisotropy": 0
},
"ver": "1.0.22",
"imported": true,
"files": [
".json"
],
"subMetas": {}
},
"f9941": {
"importer": "sprite-frame",
"uuid": "35e48152-8b86-4023-b87c-f745b261b992@f9941",
"displayName": "hex",
"id": "f9941",
"name": "spriteFrame",
"userData": {
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 262,
"height": 228,
"rawWidth": 262,
"rawHeight": 228,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"packable": true,
"pixelsToUnit": 100,
"pivotX": 0.5,
"pivotY": 0.5,
"meshType": 0,
"vertices": {
"rawPosition": [
-131,
-114,
0,
131,
-114,
0,
-131,
114,
0,
131,
114,
0
],
"indexes": [
0,
1,
2,
2,
1,
3
],
"uv": [
0,
228,
262,
228,
0,
0,
262,
0
],
"nuv": [
0,
0,
1,
0,
0,
1,
1,
1
],
"minPos": [
-131,
-114,
0
],
"maxPos": [
131,
114,
0
]
},
"isUuid": true,
"imageUuidOrDatabaseUri": "35e48152-8b86-4023-b87c-f745b261b992@6c48a",
"atlasUuid": ""
},
"ver": "1.0.12",
"imported": true,
"files": [
".json"
],
"subMetas": {}
}
},
"userData": {
"type": "sprite-frame",
"hasAlpha": true,
"fixAlphaTransparencyArtifacts": false,
"redirect": "35e48152-8b86-4023-b87c-f745b261b992@f9941"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

View File

@ -0,0 +1,134 @@
{
"ver": "1.0.26",
"importer": "image",
"imported": true,
"uuid": "b7e6e9ea-fe4c-4fdf-b1eb-641187340165",
"files": [
".json",
".png"
],
"subMetas": {
"6c48a": {
"importer": "texture",
"uuid": "b7e6e9ea-fe4c-4fdf-b1eb-641187340165@6c48a",
"displayName": "penta",
"id": "6c48a",
"name": "texture",
"userData": {
"wrapModeS": "clamp-to-edge",
"wrapModeT": "clamp-to-edge",
"imageUuidOrDatabaseUri": "b7e6e9ea-fe4c-4fdf-b1eb-641187340165",
"isUuid": true,
"visible": false,
"minfilter": "linear",
"magfilter": "linear",
"mipfilter": "none",
"anisotropy": 0
},
"ver": "1.0.22",
"imported": true,
"files": [
".json"
],
"subMetas": {}
},
"f9941": {
"importer": "sprite-frame",
"uuid": "b7e6e9ea-fe4c-4fdf-b1eb-641187340165@f9941",
"displayName": "penta",
"id": "f9941",
"name": "spriteFrame",
"userData": {
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 262,
"height": 249,
"rawWidth": 262,
"rawHeight": 249,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"packable": true,
"pixelsToUnit": 100,
"pivotX": 0.5,
"pivotY": 0.5,
"meshType": 0,
"vertices": {
"rawPosition": [
-131,
-124.5,
0,
131,
-124.5,
0,
-131,
124.5,
0,
131,
124.5,
0
],
"indexes": [
0,
1,
2,
2,
1,
3
],
"uv": [
0,
249,
262,
249,
0,
0,
262,
0
],
"nuv": [
0,
0,
1,
0,
0,
1,
1,
1
],
"minPos": [
-131,
-124.5,
0
],
"maxPos": [
131,
124.5,
0
]
},
"isUuid": true,
"imageUuidOrDatabaseUri": "b7e6e9ea-fe4c-4fdf-b1eb-641187340165@6c48a",
"atlasUuid": ""
},
"ver": "1.0.12",
"imported": true,
"files": [
".json"
],
"subMetas": {}
}
},
"userData": {
"type": "sprite-frame",
"hasAlpha": true,
"fixAlphaTransparencyArtifacts": false,
"redirect": "b7e6e9ea-fe4c-4fdf-b1eb-641187340165@f9941"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

View File

@ -0,0 +1,42 @@
{
"ver": "1.0.26",
"importer": "image",
"imported": true,
"uuid": "ef41a02d-5043-4abe-b2ae-df4a5db5f619",
"files": [
".json",
".png"
],
"subMetas": {
"6c48a": {
"importer": "texture",
"uuid": "ef41a02d-5043-4abe-b2ae-df4a5db5f619@6c48a",
"displayName": "sparkle",
"id": "6c48a",
"name": "texture",
"userData": {
"wrapModeS": "repeat",
"wrapModeT": "repeat",
"minfilter": "linear",
"magfilter": "linear",
"mipfilter": "none",
"anisotropy": 1,
"isUuid": true,
"imageUuidOrDatabaseUri": "ef41a02d-5043-4abe-b2ae-df4a5db5f619",
"visible": false
},
"ver": "1.0.22",
"imported": true,
"files": [
".json"
],
"subMetas": {}
}
},
"userData": {
"hasAlpha": true,
"type": "texture",
"redirect": "ef41a02d-5043-4abe-b2ae-df4a5db5f619@6c48a",
"fixAlphaTransparencyArtifacts": false
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

@ -0,0 +1,134 @@
{
"ver": "1.0.26",
"importer": "image",
"imported": true,
"uuid": "8e630326-6185-4c58-b643-b895520b94a6",
"files": [
".json",
".png"
],
"subMetas": {
"6c48a": {
"importer": "texture",
"uuid": "8e630326-6185-4c58-b643-b895520b94a6@6c48a",
"displayName": "transparent_0",
"id": "6c48a",
"name": "texture",
"userData": {
"wrapModeS": "clamp-to-edge",
"wrapModeT": "clamp-to-edge",
"minfilter": "linear",
"magfilter": "linear",
"mipfilter": "none",
"anisotropy": 0,
"isUuid": true,
"imageUuidOrDatabaseUri": "8e630326-6185-4c58-b643-b895520b94a6",
"visible": false
},
"ver": "1.0.22",
"imported": true,
"files": [
".json"
],
"subMetas": {}
},
"f9941": {
"importer": "sprite-frame",
"uuid": "8e630326-6185-4c58-b643-b895520b94a6@f9941",
"displayName": "transparent_0",
"id": "f9941",
"name": "spriteFrame",
"userData": {
"trimType": "none",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 30,
"height": 30,
"rawWidth": 30,
"rawHeight": 30,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"packable": true,
"isUuid": true,
"imageUuidOrDatabaseUri": "8e630326-6185-4c58-b643-b895520b94a6@6c48a",
"atlasUuid": "",
"pixelsToUnit": 100,
"pivotX": 0.5,
"pivotY": 0.5,
"meshType": 0,
"vertices": {
"rawPosition": [
-15,
-15,
0,
15,
-15,
0,
-15,
15,
0,
15,
15,
0
],
"indexes": [
0,
1,
2,
2,
1,
3
],
"uv": [
0,
30,
30,
30,
0,
0,
30,
0
],
"nuv": [
0,
0,
1,
0,
0,
1,
1,
1
],
"minPos": [
-15,
-15,
0
],
"maxPos": [
15,
15,
0
]
}
},
"ver": "1.0.12",
"imported": true,
"files": [
".json"
],
"subMetas": {}
}
},
"userData": {
"hasAlpha": true,
"type": "sprite-frame",
"redirect": "8e630326-6185-4c58-b643-b895520b94a6@f9941",
"fixAlphaTransparencyArtifacts": false
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

@ -0,0 +1,134 @@
{
"ver": "1.0.26",
"importer": "image",
"imported": true,
"uuid": "1bdf5de9-6127-4ebe-a44d-9d02a1ef45db",
"files": [
".json",
".png"
],
"subMetas": {
"6c48a": {
"importer": "texture",
"uuid": "1bdf5de9-6127-4ebe-a44d-9d02a1ef45db@6c48a",
"displayName": "transparent_1",
"id": "6c48a",
"name": "texture",
"userData": {
"wrapModeS": "clamp-to-edge",
"wrapModeT": "clamp-to-edge",
"minfilter": "linear",
"magfilter": "linear",
"mipfilter": "none",
"anisotropy": 0,
"isUuid": true,
"imageUuidOrDatabaseUri": "1bdf5de9-6127-4ebe-a44d-9d02a1ef45db",
"visible": false
},
"ver": "1.0.22",
"imported": true,
"files": [
".json"
],
"subMetas": {}
},
"f9941": {
"importer": "sprite-frame",
"uuid": "1bdf5de9-6127-4ebe-a44d-9d02a1ef45db@f9941",
"displayName": "transparent_1",
"id": "f9941",
"name": "spriteFrame",
"userData": {
"trimType": "none",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 30,
"height": 30,
"rawWidth": 30,
"rawHeight": 30,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"packable": true,
"isUuid": true,
"imageUuidOrDatabaseUri": "1bdf5de9-6127-4ebe-a44d-9d02a1ef45db@6c48a",
"atlasUuid": "",
"pixelsToUnit": 100,
"pivotX": 0.5,
"pivotY": 0.5,
"meshType": 0,
"vertices": {
"rawPosition": [
-15,
-15,
0,
15,
-15,
0,
-15,
15,
0,
15,
15,
0
],
"indexes": [
0,
1,
2,
2,
1,
3
],
"uv": [
0,
30,
30,
30,
0,
0,
30,
0
],
"nuv": [
0,
0,
1,
0,
0,
1,
1,
1
],
"minPos": [
-15,
-15,
0
],
"maxPos": [
15,
15,
0
]
}
},
"ver": "1.0.12",
"imported": true,
"files": [
".json"
],
"subMetas": {}
}
},
"userData": {
"hasAlpha": true,
"type": "sprite-frame",
"redirect": "1bdf5de9-6127-4ebe-a44d-9d02a1ef45db@f9941",
"fixAlphaTransparencyArtifacts": false
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@ -0,0 +1,134 @@
{
"ver": "1.0.26",
"importer": "image",
"imported": true,
"uuid": "a83e7186-eb86-4d87-a7a3-3a32ae3a58dc",
"files": [
".json",
".png"
],
"subMetas": {
"6c48a": {
"importer": "texture",
"uuid": "a83e7186-eb86-4d87-a7a3-3a32ae3a58dc@6c48a",
"displayName": "white",
"id": "6c48a",
"name": "texture",
"userData": {
"wrapModeS": "clamp-to-edge",
"wrapModeT": "clamp-to-edge",
"minfilter": "linear",
"magfilter": "linear",
"mipfilter": "none",
"anisotropy": 1,
"isUuid": true,
"imageUuidOrDatabaseUri": "a83e7186-eb86-4d87-a7a3-3a32ae3a58dc",
"visible": false
},
"ver": "1.0.22",
"imported": true,
"files": [
".json"
],
"subMetas": {}
},
"f9941": {
"importer": "sprite-frame",
"uuid": "a83e7186-eb86-4d87-a7a3-3a32ae3a58dc@f9941",
"displayName": "white",
"id": "f9941",
"name": "spriteFrame",
"userData": {
"trimType": "none",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 100,
"height": 100,
"rawWidth": 100,
"rawHeight": 100,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"packable": true,
"isUuid": true,
"imageUuidOrDatabaseUri": "a83e7186-eb86-4d87-a7a3-3a32ae3a58dc@6c48a",
"atlasUuid": "",
"pixelsToUnit": 100,
"pivotX": 0.5,
"pivotY": 0.5,
"meshType": 0,
"vertices": {
"rawPosition": [
-50,
-50,
0,
50,
-50,
0,
-50,
50,
0,
50,
50,
0
],
"indexes": [
0,
1,
2,
2,
1,
3
],
"uv": [
0,
100,
100,
100,
0,
0,
100,
0
],
"nuv": [
0,
0,
1,
0,
0,
1,
1,
1
],
"minPos": [
-50,
-50,
0
],
"maxPos": [
50,
50,
0
]
}
},
"ver": "1.0.12",
"imported": true,
"files": [
".json"
],
"subMetas": {}
}
},
"userData": {
"hasAlpha": false,
"type": "sprite-frame",
"redirect": "a83e7186-eb86-4d87-a7a3-3a32ae3a58dc@f9941",
"fixAlphaTransparencyArtifacts": false
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

View File

@ -0,0 +1,134 @@
{
"ver": "1.0.26",
"importer": "image",
"imported": true,
"uuid": "b6dcb91e-b683-404d-b438-a612a036c0cd",
"files": [
".json",
".png"
],
"subMetas": {
"6c48a": {
"importer": "texture",
"uuid": "b6dcb91e-b683-404d-b438-a612a036c0cd@6c48a",
"displayName": "white_circle",
"id": "6c48a",
"name": "texture",
"userData": {
"wrapModeS": "clamp-to-edge",
"wrapModeT": "clamp-to-edge",
"minfilter": "linear",
"magfilter": "linear",
"mipfilter": "none",
"anisotropy": 1,
"isUuid": true,
"imageUuidOrDatabaseUri": "b6dcb91e-b683-404d-b438-a612a036c0cd",
"visible": false
},
"ver": "1.0.22",
"imported": true,
"files": [
".json"
],
"subMetas": {}
},
"f9941": {
"importer": "sprite-frame",
"uuid": "b6dcb91e-b683-404d-b438-a612a036c0cd@f9941",
"displayName": "white_circle",
"id": "f9941",
"name": "spriteFrame",
"userData": {
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 1,
"trimY": 1,
"width": 98,
"height": 98,
"rawWidth": 100,
"rawHeight": 100,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"packable": true,
"isUuid": true,
"imageUuidOrDatabaseUri": "b6dcb91e-b683-404d-b438-a612a036c0cd@6c48a",
"atlasUuid": "",
"pixelsToUnit": 100,
"pivotX": 0.5,
"pivotY": 0.5,
"meshType": 0,
"vertices": {
"rawPosition": [
-49,
-49,
0,
49,
-49,
0,
-49,
49,
0,
49,
49,
0
],
"indexes": [
0,
1,
2,
2,
1,
3
],
"uv": [
1,
99,
99,
99,
1,
1,
99,
1
],
"nuv": [
0.01,
0.01,
0.99,
0.01,
0.01,
0.99,
0.99,
0.99
],
"minPos": [
-49,
-49,
0
],
"maxPos": [
49,
49,
0
]
}
},
"ver": "1.0.12",
"imported": true,
"files": [
".json"
],
"subMetas": {}
}
},
"userData": {
"hasAlpha": true,
"type": "sprite-frame",
"redirect": "b6dcb91e-b683-404d-b438-a612a036c0cd@f9941",
"fixAlphaTransparencyArtifacts": false
}
}

View File

@ -0,0 +1,12 @@
{
"ver": "1.2.0",
"importer": "directory",
"imported": true,
"uuid": "d36d3e28-9b63-4b9e-bce3-c7e07f9528f6",
"files": [],
"subMetas": {},
"userData": {
"compressionType": {},
"isRemoteBundle": {}
}
}

Binary file not shown.

View File

@ -0,0 +1,12 @@
{
"ver": "1.0.1",
"importer": "ttf-font",
"imported": true,
"uuid": "aae5a0d7-a157-432b-b885-97f48c7601cc",
"files": [
".json",
"Lato-Bold.ttf"
],
"subMetas": {},
"userData": {}
}

Binary file not shown.

View File

@ -0,0 +1,12 @@
{
"ver": "1.0.1",
"importer": "ttf-font",
"imported": true,
"uuid": "d382989a-143b-4cbe-8a18-f64881da439c",
"files": [
".json",
"Lato-Light.ttf"
],
"subMetas": {},
"userData": {}
}

Binary file not shown.

View File

@ -0,0 +1,12 @@
{
"ver": "1.0.1",
"importer": "ttf-font",
"imported": true,
"uuid": "be17a517-02da-4d56-99f9-1cc429333390",
"files": [
".json",
"Lato-LightItalic.ttf"
],
"subMetas": {},
"userData": {}
}

Binary file not shown.

View File

@ -0,0 +1,12 @@
{
"ver": "1.0.1",
"importer": "ttf-font",
"imported": true,
"uuid": "58653509-a870-4d06-9bb5-f440f92ec6b2",
"files": [
".json",
"Lato-Regular.ttf"
],
"subMetas": {},
"userData": {}
}

Binary file not shown.

View File

@ -0,0 +1,12 @@
{
"ver": "1.0.1",
"importer": "ttf-font",
"imported": true,
"uuid": "170ab989-f262-4899-91ed-c03ff95fd671",
"files": [
".json",
"Lato-RegularItalic.ttf"
],
"subMetas": {},
"userData": {}
}

View File

@ -0,0 +1,12 @@
{
"ver": "1.2.0",
"importer": "directory",
"imported": true,
"uuid": "791fccf6-28e9-4151-b3f1-1c0b092d0656",
"files": [],
"subMetas": {},
"userData": {
"compressionType": {},
"isRemoteBundle": {}
}
}

View File

@ -0,0 +1,121 @@
[
{
"__type__": "cc.Prefab",
"_name": "ActiveSkill1",
"_objFlags": 0,
"__editorExtras__": {},
"_native": "",
"data": {
"__id__": 1
},
"optimizationPolicy": 0,
"persistent": false
},
{
"__type__": "cc.Node",
"_name": "ActiveSkill1",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": null,
"_children": [],
"_active": true,
"_components": [
{
"__id__": 2
},
{
"__id__": 4
}
],
"_prefab": {
"__id__": 6
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 5,
"z": 1
},
"_mobility": 0,
"_layer": 33554432,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": ""
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 3
},
"_contentSize": {
"__type__": "cc.Size",
"width": 20,
"height": 50
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "6cq8SHzBZKS7Ola1L1I+VS"
},
{
"__type__": "dc247zLSm5KGa+Ip1zpVBZg",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 5
},
"theme": null,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "11aAMHyh9CUqQup3celw3Q"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "745CurHClF+5UY+WLp6BUf",
"instance": null,
"targetOverrides": null
}
]

View File

@ -0,0 +1,13 @@
{
"ver": "1.1.50",
"importer": "prefab",
"imported": true,
"uuid": "506ecffb-06c4-4000-b5a9-415944f7484d",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "ActiveSkill1"
}
}

View File

@ -0,0 +1,245 @@
[
{
"__type__": "cc.Prefab",
"_name": "ActiveSkill2",
"_objFlags": 0,
"__editorExtras__": {},
"_native": "",
"data": {
"__id__": 1
},
"optimizationPolicy": 0,
"persistent": false
},
{
"__type__": "cc.Node",
"_name": "ActiveSkill2",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": null,
"_children": [],
"_active": true,
"_components": [
{
"__id__": 2
},
{
"__id__": 4
},
{
"__id__": 6
},
{
"__id__": 8
},
{
"__id__": 10
}
],
"_prefab": {
"__id__": 12
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 5,
"z": 1
},
"_mobility": 0,
"_layer": 33554432,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": ""
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 3
},
"_contentSize": {
"__type__": "cc.Size",
"width": 20,
"height": 50
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "6cq8SHzBZKS7Ola1L1I+VS"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 5
},
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 0,
"g": 255,
"b": 61,
"a": 255
},
"_spriteFrame": {
"__uuid__": "a83e7186-eb86-4d87-a7a3-3a32ae3a58dc@f9941",
"__expectedType__": "cc.SpriteFrame"
},
"_type": 0,
"_fillType": 0,
"_sizeMode": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_useGrayscale": false,
"_atlas": null,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "7cG0kVl5BDir6IE3etvJ90"
},
{
"__type__": "cc.BoxCollider2D",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 7
},
"tag": 0,
"_group": 128,
"_density": 1,
"_sensor": true,
"_friction": 0.2,
"_restitution": 0,
"_offset": {
"__type__": "cc.Vec2",
"x": 0,
"y": 25
},
"_size": {
"__type__": "cc.Size",
"width": 20,
"height": 50
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "7626QdV0BOequctoISB5xD"
},
{
"__type__": "cc.RigidBody2D",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 9
},
"enabledContactListener": true,
"bullet": false,
"awakeOnLoad": true,
"_group": 128,
"_type": 1,
"_allowSleep": true,
"_gravityScale": 1,
"_linearDamping": 0,
"_angularDamping": 0,
"_linearVelocity": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_angularVelocity": 0,
"_fixedRotation": true,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "75Y1w6iCBHloVrqNvPejBe"
},
{
"__type__": "88fb6shQ61BrKllEFws1VsB",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 11
},
"theme": {
"__id__": 4
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "f82WM3q4tHML39QDkOmEK8"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "745CurHClF+5UY+WLp6BUf",
"instance": null,
"targetOverrides": null
}
]

View File

@ -0,0 +1,13 @@
{
"ver": "1.1.50",
"importer": "prefab",
"imported": true,
"uuid": "e45498c9-376f-4420-9fd1-3c91ebf140b8",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "ActiveSkill2"
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,13 @@
{
"ver": "1.1.50",
"importer": "prefab",
"imported": true,
"uuid": "6636bb41-505d-4634-9b1f-12006254d850",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "ActiveSkill3"
}
}

View File

@ -0,0 +1,809 @@
[
{
"__type__": "cc.Prefab",
"_name": "Boss",
"_objFlags": 0,
"__editorExtras__": {},
"_native": "",
"data": {
"__id__": 1
},
"optimizationPolicy": 0,
"persistent": false
},
{
"__type__": "cc.Node",
"_name": "Boss",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": null,
"_children": [
{
"__id__": 2
},
{
"__id__": 12
},
{
"__id__": 22
}
],
"_active": true,
"_components": [
{
"__id__": 28
},
{
"__id__": 30
},
{
"__id__": 36
},
{
"__id__": 34
},
{
"__id__": 9
},
{
"__id__": 32
},
{
"__id__": 19
}
],
"_prefab": {
"__id__": 38
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 481.819,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_mobility": 0,
"_layer": 33554432,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": ""
},
{
"__type__": "cc.Node",
"_name": "boss_body",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 1
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 3
},
{
"__id__": 5
},
{
"__id__": 7
}
],
"_prefab": {
"__id__": 11
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_mobility": 0,
"_layer": 524288,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": ""
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 2
},
"_enabled": true,
"__prefab": {
"__id__": 4
},
"_contentSize": {
"__type__": "cc.Size",
"width": 262,
"height": 228
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "80zy/5XMdNBYA3JVuyKiTV"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 2
},
"_enabled": true,
"__prefab": {
"__id__": 6
},
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 124,
"g": 77,
"b": 173,
"a": 255
},
"_spriteFrame": {
"__uuid__": "35e48152-8b86-4023-b87c-f745b261b992@f9941",
"__expectedType__": "cc.SpriteFrame"
},
"_type": 0,
"_fillType": 0,
"_sizeMode": 1,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_useGrayscale": false,
"_atlas": null,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "eccLHQRKRC44JNQtNG4ccC"
},
{
"__type__": "a6e0131Rh1MNJxyVdQsH7Fc",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 2
},
"_enabled": true,
"__prefab": {
"__id__": 8
},
"colliderComponent": {
"__id__": 9
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "e1g+dwt+VGp6sw1GvtETkf"
},
{
"__type__": "cc.PolygonCollider2D",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 10
},
"tag": 0,
"_group": 2,
"_density": 1,
"_sensor": false,
"_friction": 0.2,
"_restitution": 0,
"_offset": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_points": [
{
"__type__": "cc.Vec2",
"x": -66,
"y": 114
},
{
"__type__": "cc.Vec2",
"x": -131.6,
"y": 0.7
},
{
"__type__": "cc.Vec2",
"x": -66,
"y": -114
},
{
"__type__": "cc.Vec2",
"x": 65,
"y": -114
},
{
"__type__": "cc.Vec2",
"x": 131,
"y": -0.4
},
{
"__type__": "cc.Vec2",
"x": 65.5,
"y": 113.7
}
],
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "6dp5MclCpIpLVAsiUxQox9"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "91grAJVaBME50cGCvEAjH6",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{
"__type__": "cc.Node",
"_name": "boss_sensor",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 1
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 13
},
{
"__id__": 15
},
{
"__id__": 17
}
],
"_prefab": {
"__id__": 21
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 2,
"y": 2,
"z": 1
},
"_mobility": 0,
"_layer": 524288,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": ""
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 12
},
"_enabled": true,
"__prefab": {
"__id__": 14
},
"_contentSize": {
"__type__": "cc.Size",
"width": 2000,
"height": 2000
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "aa25EtLfFCUY0kgjTkwqfU"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 12
},
"_enabled": true,
"__prefab": {
"__id__": 16
},
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 207,
"g": 255,
"b": 201,
"a": 0
},
"_spriteFrame": {
"__uuid__": "b6dcb91e-b683-404d-b438-a612a036c0cd@f9941",
"__expectedType__": "cc.SpriteFrame"
},
"_type": 0,
"_fillType": 0,
"_sizeMode": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_useGrayscale": false,
"_atlas": null,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "39k8UF0NdC2p3zh0DnQlRV"
},
{
"__type__": "a6e0131Rh1MNJxyVdQsH7Fc",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 12
},
"_enabled": true,
"__prefab": {
"__id__": 18
},
"colliderComponent": {
"__id__": 19
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "86wUci5HNFPL4ForOZkuH9"
},
{
"__type__": "cc.CircleCollider2D",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 20
},
"tag": 0,
"_group": 32,
"_density": 1,
"_sensor": true,
"_friction": 0.2,
"_restitution": 0,
"_offset": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_radius": 1000,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "0c0v+1GG9Ef4FelG8+9n0l"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "03G7Z1+shKLr6gshNp0iCC",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{
"__type__": "cc.Node",
"_name": "Label",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 1
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 23
},
{
"__id__": 25
}
],
"_prefab": {
"__id__": 27
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_mobility": 0,
"_layer": 33554432,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": ""
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 22
},
"_enabled": true,
"__prefab": {
"__id__": 24
},
"_contentSize": {
"__type__": "cc.Size",
"width": 138.17495727539062,
"height": 110.8
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "84Z7NXmrFAe4toRCB76ptQ"
},
{
"__type__": "cc.Label",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 22
},
"_enabled": true,
"__prefab": {
"__id__": 26
},
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 0,
"g": 0,
"b": 0,
"a": 255
},
"_string": "BOSS",
"_horizontalAlign": 1,
"_verticalAlign": 1,
"_actualFontSize": 50,
"_fontSize": 50,
"_fontFamily": "Arial",
"_lineHeight": 80,
"_overflow": 0,
"_enableWrapText": true,
"_font": {
"__uuid__": "aae5a0d7-a157-432b-b885-97f48c7601cc",
"__expectedType__": "cc.TTFFont"
},
"_isSystemFontUsed": false,
"_spacingX": 0,
"_isItalic": false,
"_isBold": false,
"_isUnderline": false,
"_underlineHeight": 2,
"_cacheMode": 0,
"_enableOutline": true,
"_outlineColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_outlineWidth": 5,
"_enableShadow": false,
"_shadowColor": {
"__type__": "cc.Color",
"r": 0,
"g": 0,
"b": 0,
"a": 255
},
"_shadowOffset": {
"__type__": "cc.Vec2",
"x": 2,
"y": 2
},
"_shadowBlur": 2,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "78CE7wZe1PPa0p+lSVhx6d"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "d5Z7/dVsJHbIOwUNT+NnWq",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 29
},
"_contentSize": {
"__type__": "cc.Size",
"width": 100,
"height": 100
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "b0ftB4ythIwKl83iYHN4s7"
},
{
"__type__": "71e6ax1PZRP058pzOl35Zqi",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 31
},
"colliderObject": {
"__id__": 7
},
"sensor": {
"__id__": 17
},
"rigibodyComponent": {
"__id__": 32
},
"theme": {
"__id__": 5
},
"shooting": {
"__id__": 34
},
"enemyType": 1,
"attackType": 1,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "8bxV2dB45F3Zo7eAiPq0FD"
},
{
"__type__": "cc.RigidBody2D",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": false,
"__prefab": {
"__id__": 33
},
"enabledContactListener": true,
"bullet": false,
"awakeOnLoad": true,
"_group": 2,
"_type": 2,
"_allowSleep": false,
"_gravityScale": 0,
"_linearDamping": 0,
"_angularDamping": 0,
"_linearVelocity": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_angularVelocity": 0,
"_fixedRotation": true,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "02x7FcGvNOG61STre+rimt"
},
{
"__type__": "db994levvJOsbS2C6KysVib",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 35
},
"bulletPrefab": {
"__uuid__": "81b5f5bc-3c41-46c7-96ef-ef076f4f15f3",
"__expectedType__": "cc.Prefab"
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "998XVf4NtC5bvlNsUDhDGd"
},
{
"__type__": "ff574WLC6NPlbe7t2a3Q+0z",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 37
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "5eYhhErDdDp5Bmtwoa/UVu"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "5c32r0OAZC/pXh3pgykwmX",
"instance": null,
"targetOverrides": null
}
]

View File

@ -0,0 +1,13 @@
{
"ver": "1.1.50",
"importer": "prefab",
"imported": true,
"uuid": "d8613e9c-fe71-4034-96d1-bd8e04da8087",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "Boss"
}
}

View File

@ -0,0 +1,458 @@
[
{
"__type__": "cc.Prefab",
"_name": "Bullet1",
"_objFlags": 0,
"__editorExtras__": {},
"_native": "",
"data": {
"__id__": 1
},
"optimizationPolicy": 0,
"persistent": false
},
{
"__type__": "cc.Node",
"_name": "Bullet1",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": null,
"_children": [
{
"__id__": 2
}
],
"_active": true,
"_components": [
{
"__id__": 14
},
{
"__id__": 16
}
],
"_prefab": {
"__id__": 18
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_mobility": 0,
"_layer": 33554432,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": ""
},
{
"__type__": "cc.Node",
"_name": "body",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 1
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 3
},
{
"__id__": 5
},
{
"__id__": 7
},
{
"__id__": 9
},
{
"__id__": 11
}
],
"_prefab": {
"__id__": 13
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_mobility": 0,
"_layer": 524288,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": ""
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 2
},
"_enabled": true,
"__prefab": {
"__id__": 4
},
"_contentSize": {
"__type__": "cc.Size",
"width": 30,
"height": 30
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "7ffotd5PJBaYcUlADo8SFc"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 2
},
"_enabled": true,
"__prefab": {
"__id__": 6
},
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 245,
"b": 0,
"a": 255
},
"_spriteFrame": {
"__uuid__": "b6dcb91e-b683-404d-b438-a612a036c0cd@f9941",
"__expectedType__": "cc.SpriteFrame"
},
"_type": 0,
"_fillType": 0,
"_sizeMode": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_useGrayscale": false,
"_atlas": null,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "95ExwnMoJNaagH4D1YVTiz"
},
{
"__type__": "a6e0131Rh1MNJxyVdQsH7Fc",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 2
},
"_enabled": true,
"__prefab": {
"__id__": 8
},
"colliderComponent": null,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "ceoEsSAo1H6Zj8dN/JZ8jb"
},
{
"__type__": "cc.PolygonCollider2D",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 2
},
"_enabled": true,
"__prefab": {
"__id__": 10
},
"tag": 0,
"_group": 8,
"_density": 1,
"_sensor": true,
"_friction": 0.2,
"_restitution": 0,
"_offset": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_points": [
{
"__type__": "cc.Vec2",
"x": -4.285714285714285,
"y": 15
},
{
"__type__": "cc.Vec2",
"x": -7.346938775510204,
"y": 13.775510204081634
},
{
"__type__": "cc.Vec2",
"x": -7.653061224489796,
"y": 13.163265306122451
},
{
"__type__": "cc.Vec2",
"x": -10.10204081632653,
"y": 11.938775510204081
},
{
"__type__": "cc.Vec2",
"x": -13.46938775510204,
"y": 7.95918367346939
},
{
"__type__": "cc.Vec2",
"x": -15,
"y": 4.285714285714285
},
{
"__type__": "cc.Vec2",
"x": -15,
"y": -4.285714285714285
},
{
"__type__": "cc.Vec2",
"x": -13.16326530612245,
"y": -8.26530612244898
},
{
"__type__": "cc.Vec2",
"x": -10.10204081632653,
"y": -11.938775510204081
},
{
"__type__": "cc.Vec2",
"x": -3.979591836734693,
"y": -15
},
{
"__type__": "cc.Vec2",
"x": 4.897959183673471,
"y": -14.693877551020408
},
{
"__type__": "cc.Vec2",
"x": 8.26530612244898,
"y": -13.16326530612245
},
{
"__type__": "cc.Vec2",
"x": 12.244897959183675,
"y": -9.489795918367346
},
{
"__type__": "cc.Vec2",
"x": 15,
"y": -3.979591836734693
},
{
"__type__": "cc.Vec2",
"x": 15,
"y": 3.979591836734695
},
{
"__type__": "cc.Vec2",
"x": 14.387755102040817,
"y": 5.816326530612244
},
{
"__type__": "cc.Vec2",
"x": 12.551020408163264,
"y": 9.183673469387756
},
{
"__type__": "cc.Vec2",
"x": 9.183673469387756,
"y": 12.551020408163264
},
{
"__type__": "cc.Vec2",
"x": 3.979591836734695,
"y": 15
}
],
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "d9wYYD7mNHHYlOd3YOvZld"
},
{
"__type__": "cc.RigidBody2D",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 2
},
"_enabled": true,
"__prefab": {
"__id__": 12
},
"enabledContactListener": true,
"bullet": false,
"awakeOnLoad": true,
"_group": 8,
"_type": 1,
"_allowSleep": true,
"_gravityScale": 1,
"_linearDamping": 0,
"_angularDamping": 0,
"_linearVelocity": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_angularVelocity": 0,
"_fixedRotation": true,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "13vjOSFkpJ2Lz3qmdnCebQ"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "4dDjvSxWZCAa8saCjpYLwT",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 15
},
"_contentSize": {
"__type__": "cc.Size",
"width": 100,
"height": 100
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "0b5kUvKddPn5lAD/QKVRDa"
},
{
"__type__": "9544bN9qANLQqrWtqsaLUed",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 17
},
"colliderObject": {
"__id__": 7
},
"rigibodyComponent": {
"__id__": 11
},
"theme": {
"__id__": 5
},
"bulletType": 0,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "37AQBkqTFGTphmjaTQPIGa"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "8fbRDcEpZM+L7E5Wp9mp/M",
"instance": null,
"targetOverrides": null
}
]

View File

@ -0,0 +1,13 @@
{
"ver": "1.1.50",
"importer": "prefab",
"imported": true,
"uuid": "00fe22d2-9262-49f6-b949-50802b47f579",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "Bullet1"
}
}

View File

@ -0,0 +1,458 @@
[
{
"__type__": "cc.Prefab",
"_name": "Bullet2",
"_objFlags": 0,
"__editorExtras__": {},
"_native": "",
"data": {
"__id__": 1
},
"optimizationPolicy": 0,
"persistent": false
},
{
"__type__": "cc.Node",
"_name": "Bullet2",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": null,
"_children": [
{
"__id__": 2
}
],
"_active": true,
"_components": [
{
"__id__": 14
},
{
"__id__": 16
}
],
"_prefab": {
"__id__": 18
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_mobility": 0,
"_layer": 33554432,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": ""
},
{
"__type__": "cc.Node",
"_name": "body",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 1
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 3
},
{
"__id__": 5
},
{
"__id__": 7
},
{
"__id__": 9
},
{
"__id__": 11
}
],
"_prefab": {
"__id__": 13
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 1.5,
"y": 1.5,
"z": 1
},
"_mobility": 0,
"_layer": 524288,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": ""
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 2
},
"_enabled": true,
"__prefab": {
"__id__": 4
},
"_contentSize": {
"__type__": "cc.Size",
"width": 30,
"height": 30
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "7ffotd5PJBaYcUlADo8SFc"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 2
},
"_enabled": true,
"__prefab": {
"__id__": 6
},
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 7,
"b": 7,
"a": 255
},
"_spriteFrame": {
"__uuid__": "b6dcb91e-b683-404d-b438-a612a036c0cd@f9941",
"__expectedType__": "cc.SpriteFrame"
},
"_type": 0,
"_fillType": 0,
"_sizeMode": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_useGrayscale": false,
"_atlas": null,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "95ExwnMoJNaagH4D1YVTiz"
},
{
"__type__": "a6e0131Rh1MNJxyVdQsH7Fc",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 2
},
"_enabled": true,
"__prefab": {
"__id__": 8
},
"colliderComponent": null,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "ceoEsSAo1H6Zj8dN/JZ8jb"
},
{
"__type__": "cc.PolygonCollider2D",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 2
},
"_enabled": true,
"__prefab": {
"__id__": 10
},
"tag": 0,
"_group": 16,
"_density": 1,
"_sensor": true,
"_friction": 0.2,
"_restitution": 0,
"_offset": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_points": [
{
"__type__": "cc.Vec2",
"x": -4.285714285714285,
"y": 15
},
{
"__type__": "cc.Vec2",
"x": -7.346938775510204,
"y": 13.775510204081634
},
{
"__type__": "cc.Vec2",
"x": -7.653061224489796,
"y": 13.163265306122451
},
{
"__type__": "cc.Vec2",
"x": -10.10204081632653,
"y": 11.938775510204081
},
{
"__type__": "cc.Vec2",
"x": -13.46938775510204,
"y": 7.95918367346939
},
{
"__type__": "cc.Vec2",
"x": -15,
"y": 4.285714285714285
},
{
"__type__": "cc.Vec2",
"x": -15,
"y": -4.285714285714285
},
{
"__type__": "cc.Vec2",
"x": -13.16326530612245,
"y": -8.26530612244898
},
{
"__type__": "cc.Vec2",
"x": -10.10204081632653,
"y": -11.938775510204081
},
{
"__type__": "cc.Vec2",
"x": -3.979591836734693,
"y": -15
},
{
"__type__": "cc.Vec2",
"x": 4.897959183673471,
"y": -14.693877551020408
},
{
"__type__": "cc.Vec2",
"x": 8.26530612244898,
"y": -13.16326530612245
},
{
"__type__": "cc.Vec2",
"x": 12.244897959183675,
"y": -9.489795918367346
},
{
"__type__": "cc.Vec2",
"x": 15,
"y": -3.979591836734693
},
{
"__type__": "cc.Vec2",
"x": 15,
"y": 3.979591836734695
},
{
"__type__": "cc.Vec2",
"x": 14.387755102040817,
"y": 5.816326530612244
},
{
"__type__": "cc.Vec2",
"x": 12.551020408163264,
"y": 9.183673469387756
},
{
"__type__": "cc.Vec2",
"x": 9.183673469387756,
"y": 12.551020408163264
},
{
"__type__": "cc.Vec2",
"x": 3.979591836734695,
"y": 15
}
],
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "d9wYYD7mNHHYlOd3YOvZld"
},
{
"__type__": "cc.RigidBody2D",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 2
},
"_enabled": true,
"__prefab": {
"__id__": 12
},
"enabledContactListener": true,
"bullet": false,
"awakeOnLoad": true,
"_group": 16,
"_type": 1,
"_allowSleep": true,
"_gravityScale": 0,
"_linearDamping": 0,
"_angularDamping": 0,
"_linearVelocity": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_angularVelocity": 0,
"_fixedRotation": true,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "25SGFb8+ZIEJSS+o35Rgun"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "4dDjvSxWZCAa8saCjpYLwT",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 15
},
"_contentSize": {
"__type__": "cc.Size",
"width": 100,
"height": 100
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "0b5kUvKddPn5lAD/QKVRDa"
},
{
"__type__": "9544bN9qANLQqrWtqsaLUed",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 17
},
"colliderObject": {
"__id__": 7
},
"rigibodyComponent": {
"__id__": 11
},
"theme": {
"__id__": 5
},
"bulletType": 2,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "37AQBkqTFGTphmjaTQPIGa"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "8fbRDcEpZM+L7E5Wp9mp/M",
"instance": null,
"targetOverrides": null
}
]

View File

@ -0,0 +1,13 @@
{
"ver": "1.1.50",
"importer": "prefab",
"imported": true,
"uuid": "81b5f5bc-3c41-46c7-96ef-ef076f4f15f3",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "Bullet2"
}
}

Some files were not shown because too many files have changed in this diff Show More