mirror of
https://github.com/Leo501/CocosCreatorTutorial.git
synced 2026-05-31 22:49:23 +08:00
更新代码
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"ver": "2.0.10",
|
||||
"ver": "2.0.14",
|
||||
"importer": "fbx",
|
||||
"imported": true,
|
||||
"uuid": "aade09ee-8f9d-413c-a9e8-8c686ea5e160",
|
||||
@@ -87,7 +87,7 @@
|
||||
"displayName": "",
|
||||
"id": "9787f",
|
||||
"name": "grass.texture",
|
||||
"ver": "1.0.20",
|
||||
"ver": "1.0.21",
|
||||
"imported": true,
|
||||
"files": [
|
||||
".json"
|
||||
@@ -100,7 +100,7 @@
|
||||
"magfilter": "linear",
|
||||
"mipfilter": "none",
|
||||
"premultiplyAlpha": false,
|
||||
"anisotropy": 1,
|
||||
"anisotropy": 0,
|
||||
"isUuid": true,
|
||||
"imageUuidOrDatabaseUri": "aade09ee-8f9d-413c-a9e8-8c686ea5e160@80e0c"
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
"displayName": "grass",
|
||||
"id": "6c48a",
|
||||
"name": "texture",
|
||||
"ver": "1.0.20",
|
||||
"ver": "1.0.21",
|
||||
"imported": true,
|
||||
"files": [
|
||||
".json"
|
||||
@@ -27,7 +27,7 @@
|
||||
"magfilter": "linear",
|
||||
"mipfilter": "linear",
|
||||
"premultiplyAlpha": false,
|
||||
"anisotropy": 1,
|
||||
"anisotropy": 0,
|
||||
"isUuid": true,
|
||||
"imageUuidOrDatabaseUri": "ae18deea-c6e0-4a3d-bf70-ee5533f9ba87"
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"ver": "2.0.10",
|
||||
"ver": "2.0.14",
|
||||
"importer": "fbx",
|
||||
"imported": true,
|
||||
"uuid": "929e58ce-66a4-4e04-9036-4244456a1220",
|
||||
@@ -45,7 +45,7 @@
|
||||
"displayName": "",
|
||||
"id": "d6067",
|
||||
"name": "hdcSky.texture",
|
||||
"ver": "1.0.20",
|
||||
"ver": "1.0.21",
|
||||
"imported": true,
|
||||
"files": [
|
||||
".json"
|
||||
@@ -58,7 +58,7 @@
|
||||
"magfilter": "linear",
|
||||
"mipfilter": "none",
|
||||
"premultiplyAlpha": false,
|
||||
"anisotropy": 1,
|
||||
"anisotropy": 0,
|
||||
"isUuid": true,
|
||||
"imageUuidOrDatabaseUri": "929e58ce-66a4-4e04-9036-4244456a1220@7f40d"
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"ver": "2.0.10",
|
||||
"ver": "2.0.14",
|
||||
"importer": "fbx",
|
||||
"imported": true,
|
||||
"uuid": "0ab3142a-6968-4073-95af-026bc3b23623",
|
||||
@@ -239,11 +239,11 @@
|
||||
"magfilter": "linear",
|
||||
"mipfilter": "none",
|
||||
"premultiplyAlpha": false,
|
||||
"anisotropy": 1,
|
||||
"anisotropy": 0,
|
||||
"isUuid": true,
|
||||
"imageUuidOrDatabaseUri": "0ab3142a-6968-4073-95af-026bc3b23623@baeab"
|
||||
},
|
||||
"ver": "1.0.20",
|
||||
"ver": "1.0.21",
|
||||
"imported": true,
|
||||
"files": [
|
||||
".json"
|
||||
@@ -263,11 +263,11 @@
|
||||
"magfilter": "linear",
|
||||
"mipfilter": "none",
|
||||
"premultiplyAlpha": false,
|
||||
"anisotropy": 1,
|
||||
"anisotropy": 0,
|
||||
"isUuid": true,
|
||||
"imageUuidOrDatabaseUri": "0ab3142a-6968-4073-95af-026bc3b23623@eeccb"
|
||||
},
|
||||
"ver": "1.0.20",
|
||||
"ver": "1.0.21",
|
||||
"imported": true,
|
||||
"files": [
|
||||
".json"
|
||||
@@ -287,11 +287,11 @@
|
||||
"magfilter": "linear",
|
||||
"mipfilter": "none",
|
||||
"premultiplyAlpha": false,
|
||||
"anisotropy": 1,
|
||||
"anisotropy": 0,
|
||||
"isUuid": true,
|
||||
"imageUuidOrDatabaseUri": "0ab3142a-6968-4073-95af-026bc3b23623@3b6f8"
|
||||
},
|
||||
"ver": "1.0.20",
|
||||
"ver": "1.0.21",
|
||||
"imported": true,
|
||||
"files": [
|
||||
".json"
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
"displayName": "seafloor",
|
||||
"id": "6c48a",
|
||||
"name": "texture",
|
||||
"ver": "1.0.20",
|
||||
"ver": "1.0.21",
|
||||
"imported": true,
|
||||
"files": [
|
||||
".json"
|
||||
@@ -27,7 +27,7 @@
|
||||
"magfilter": "linear",
|
||||
"mipfilter": "none",
|
||||
"premultiplyAlpha": false,
|
||||
"anisotropy": 1,
|
||||
"anisotropy": 0,
|
||||
"isUuid": true,
|
||||
"imageUuidOrDatabaseUri": "4f4c4a34-2d08-4a4d-9169-834d7ce82cee"
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
"displayName": "shield",
|
||||
"id": "6c48a",
|
||||
"name": "texture",
|
||||
"ver": "1.0.20",
|
||||
"ver": "1.0.21",
|
||||
"imported": true,
|
||||
"files": [
|
||||
".json"
|
||||
@@ -27,7 +27,7 @@
|
||||
"magfilter": "linear",
|
||||
"mipfilter": "none",
|
||||
"premultiplyAlpha": false,
|
||||
"anisotropy": 1,
|
||||
"anisotropy": 0,
|
||||
"isUuid": true,
|
||||
"imageUuidOrDatabaseUri": "95e5b02a-e338-423c-bdbb-17486db1d9eb"
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
"displayName": "sky",
|
||||
"id": "6c48a",
|
||||
"name": "texture",
|
||||
"ver": "1.0.20",
|
||||
"ver": "1.0.21",
|
||||
"imported": true,
|
||||
"files": [
|
||||
".json"
|
||||
@@ -27,7 +27,7 @@
|
||||
"magfilter": "linear",
|
||||
"mipfilter": "none",
|
||||
"premultiplyAlpha": false,
|
||||
"anisotropy": 1,
|
||||
"anisotropy": 0,
|
||||
"isUuid": true,
|
||||
"imageUuidOrDatabaseUri": "dc4a96c7-321a-48af-81e5-1127ad3ae432"
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"ver": "2.0.10",
|
||||
"ver": "2.0.14",
|
||||
"importer": "fbx",
|
||||
"imported": true,
|
||||
"uuid": "e3553cad-2f15-4293-859a-8f43c780f289",
|
||||
@@ -196,11 +196,11 @@
|
||||
"magfilter": "linear",
|
||||
"mipfilter": "none",
|
||||
"premultiplyAlpha": false,
|
||||
"anisotropy": 1,
|
||||
"anisotropy": 0,
|
||||
"isUuid": false,
|
||||
"imageUuidOrDatabaseUri": "db://assets/model/helloWorld/soldier.png"
|
||||
},
|
||||
"ver": "1.0.20",
|
||||
"ver": "1.0.21",
|
||||
"imported": true,
|
||||
"files": [
|
||||
".json"
|
||||
@@ -220,11 +220,11 @@
|
||||
"magfilter": "linear",
|
||||
"mipfilter": "none",
|
||||
"premultiplyAlpha": false,
|
||||
"anisotropy": 1,
|
||||
"anisotropy": 0,
|
||||
"isUuid": true,
|
||||
"imageUuidOrDatabaseUri": "e3553cad-2f15-4293-859a-8f43c780f289@e94f1"
|
||||
},
|
||||
"ver": "1.0.20",
|
||||
"ver": "1.0.21",
|
||||
"imported": true,
|
||||
"files": [
|
||||
".json"
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
"displayName": "soldier",
|
||||
"id": "6c48a",
|
||||
"name": "texture",
|
||||
"ver": "1.0.20",
|
||||
"ver": "1.0.21",
|
||||
"imported": true,
|
||||
"files": [
|
||||
".json"
|
||||
@@ -27,7 +27,7 @@
|
||||
"magfilter": "linear",
|
||||
"mipfilter": "none",
|
||||
"premultiplyAlpha": false,
|
||||
"anisotropy": 1,
|
||||
"anisotropy": 0,
|
||||
"isUuid": true,
|
||||
"imageUuidOrDatabaseUri": "6f891a7b-5a08-48e6-9841-ddb364ac86b1"
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
"displayName": "stone",
|
||||
"id": "6c48a",
|
||||
"name": "texture",
|
||||
"ver": "1.0.20",
|
||||
"ver": "1.0.21",
|
||||
"imported": true,
|
||||
"files": [
|
||||
".json"
|
||||
@@ -27,7 +27,7 @@
|
||||
"magfilter": "linear",
|
||||
"mipfilter": "none",
|
||||
"premultiplyAlpha": false,
|
||||
"anisotropy": 1,
|
||||
"anisotropy": 0,
|
||||
"isUuid": true,
|
||||
"imageUuidOrDatabaseUri": "0718d996-39bf-4ab4-bb63-496666fef467"
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
"displayName": "tree",
|
||||
"id": "6c48a",
|
||||
"name": "texture",
|
||||
"ver": "1.0.20",
|
||||
"ver": "1.0.21",
|
||||
"imported": true,
|
||||
"files": [
|
||||
".json"
|
||||
@@ -27,7 +27,7 @@
|
||||
"magfilter": "linear",
|
||||
"mipfilter": "none",
|
||||
"premultiplyAlpha": false,
|
||||
"anisotropy": 1,
|
||||
"anisotropy": 0,
|
||||
"isUuid": true,
|
||||
"imageUuidOrDatabaseUri": "c5083e75-ad2e-4ea9-8b33-dee748995b00"
|
||||
}
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
{
|
||||
"ver": "4.0.21",
|
||||
"ver": "4.0.22",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "25e55cbe-4b98-4aa0-85f3-1f379798a490",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
"userData": {
|
||||
"simulateGlobals": []
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
{
|
||||
"ver": "4.0.21",
|
||||
"ver": "4.0.22",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "8d86d36c-9ed5-4f34-b948-d0a234860faa",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
"userData": {
|
||||
"simulateGlobals": []
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
{
|
||||
"ver": "4.0.21",
|
||||
"ver": "4.0.22",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "35bc6dc3-6b28-4e69-885e-23af63d7566b",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
"userData": {
|
||||
"simulateGlobals": []
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
{
|
||||
"ver": "4.0.21",
|
||||
"ver": "4.0.22",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "0281b04b-007d-48fc-b494-a5f3aa2cab6b",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
"userData": {
|
||||
"simulateGlobals": []
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,18 +24,18 @@
|
||||
"isRGBE": false,
|
||||
"imageDatabaseUri": "db://assets/skybox/sunnySkyBox.jpg"
|
||||
},
|
||||
"ver": "1.0.9",
|
||||
"ver": "1.0.10",
|
||||
"imported": true,
|
||||
"files": [
|
||||
".json"
|
||||
],
|
||||
"subMetas": {
|
||||
"7d38f": {
|
||||
"e9a6d": {
|
||||
"importer": "texture-cube-face",
|
||||
"uuid": "5af201b5-5951-4e2c-a81f-ac4aad9132cb@b47c0@7d38f",
|
||||
"uuid": "5af201b5-5951-4e2c-a81f-ac4aad9132cb@b47c0@e9a6d",
|
||||
"displayName": "",
|
||||
"id": "7d38f",
|
||||
"name": "bottom",
|
||||
"id": "e9a6d",
|
||||
"name": "front",
|
||||
"userData": {},
|
||||
"ver": "1.0.0",
|
||||
"imported": true,
|
||||
@@ -60,12 +60,12 @@
|
||||
],
|
||||
"subMetas": {}
|
||||
},
|
||||
"e9a6d": {
|
||||
"bb97f": {
|
||||
"importer": "texture-cube-face",
|
||||
"uuid": "5af201b5-5951-4e2c-a81f-ac4aad9132cb@b47c0@e9a6d",
|
||||
"uuid": "5af201b5-5951-4e2c-a81f-ac4aad9132cb@b47c0@bb97f",
|
||||
"displayName": "",
|
||||
"id": "e9a6d",
|
||||
"name": "front",
|
||||
"id": "bb97f",
|
||||
"name": "top",
|
||||
"userData": {},
|
||||
"ver": "1.0.0",
|
||||
"imported": true,
|
||||
@@ -75,12 +75,12 @@
|
||||
],
|
||||
"subMetas": {}
|
||||
},
|
||||
"bb97f": {
|
||||
"7d38f": {
|
||||
"importer": "texture-cube-face",
|
||||
"uuid": "5af201b5-5951-4e2c-a81f-ac4aad9132cb@b47c0@bb97f",
|
||||
"uuid": "5af201b5-5951-4e2c-a81f-ac4aad9132cb@b47c0@7d38f",
|
||||
"displayName": "",
|
||||
"id": "bb97f",
|
||||
"name": "top",
|
||||
"id": "7d38f",
|
||||
"name": "bottom",
|
||||
"userData": {},
|
||||
"ver": "1.0.0",
|
||||
"imported": true,
|
||||
|
||||
@@ -2,5 +2,8 @@
|
||||
"name": "BezierDemo",
|
||||
"type": "3d",
|
||||
"uuid": "c30b28da-749e-479b-bcb6-cecd8d7be9e3",
|
||||
"version": "3.0.0"
|
||||
"version": "3.1.0",
|
||||
"creator": {
|
||||
"version": "3.1.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
{
|
||||
"__version__": "1.2.6"
|
||||
"__version__": "1.2.8"
|
||||
}
|
||||
|
||||
3
BezierPathsDemo/settings/v2/packages/device.json
Normal file
3
BezierPathsDemo/settings/v2/packages/device.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"__version__": "1.0.1"
|
||||
}
|
||||
3
BezierPathsDemo/settings/v2/packages/program.json
Normal file
3
BezierPathsDemo/settings/v2/packages/program.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"__version__": "1.0.0"
|
||||
}
|
||||
51
TweemDemo/.gitignore
vendored
Normal file
51
TweemDemo/.gitignore
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
#/////////////////////////////////////////////////////////////////////////////
|
||||
# Fireball Projects
|
||||
#/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/library/
|
||||
/temp/
|
||||
/local/
|
||||
/build/
|
||||
|
||||
#/////////////////////////////////////////////////////////////////////////////
|
||||
# npm files
|
||||
#/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
npm-debug.log
|
||||
node_modules/
|
||||
|
||||
#/////////////////////////////////////////////////////////////////////////////
|
||||
# Logs and databases
|
||||
#/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
*.log
|
||||
*.sql
|
||||
*.sqlite
|
||||
|
||||
#/////////////////////////////////////////////////////////////////////////////
|
||||
# files for debugger
|
||||
#/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
*.sln
|
||||
*.pidb
|
||||
*.suo
|
||||
|
||||
#/////////////////////////////////////////////////////////////////////////////
|
||||
# OS generated files
|
||||
#/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
.DS_Store
|
||||
ehthumbs.db
|
||||
Thumbs.db
|
||||
|
||||
#/////////////////////////////////////////////////////////////////////////////
|
||||
# WebStorm files
|
||||
#/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
.idea/
|
||||
|
||||
#//////////////////////////
|
||||
# VS Code files
|
||||
#//////////////////////////
|
||||
|
||||
.vscode/
|
||||
2
TweemDemo/README.md
Normal file
2
TweemDemo/README.md
Normal file
@@ -0,0 +1,2 @@
|
||||
# hello-world
|
||||
Hello world new project template.
|
||||
12
TweemDemo/assets/Scene.meta
Normal file
12
TweemDemo/assets/Scene.meta
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"ver": "1.1.2",
|
||||
"uuid": "29f52784-2fca-467b-92e7-8fd9ef8c57b7",
|
||||
"isBundle": false,
|
||||
"bundleName": "",
|
||||
"priority": 1,
|
||||
"compressionType": {},
|
||||
"optimizeHotUpdate": {},
|
||||
"inlineSpriteFrames": {},
|
||||
"isRemoteBundle": {},
|
||||
"subMetas": {}
|
||||
}
|
||||
1357
TweemDemo/assets/Scene/helloworld.fire
Normal file
1357
TweemDemo/assets/Scene/helloworld.fire
Normal file
File diff suppressed because it is too large
Load Diff
7
TweemDemo/assets/Scene/helloworld.fire.meta
Normal file
7
TweemDemo/assets/Scene/helloworld.fire.meta
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"ver": "1.2.9",
|
||||
"uuid": "2d2f792f-a40c-49bb-a189-ed176a246e49",
|
||||
"asyncLoadAssets": false,
|
||||
"autoReleaseAssets": false,
|
||||
"subMetas": {}
|
||||
}
|
||||
12
TweemDemo/assets/Script.meta
Normal file
12
TweemDemo/assets/Script.meta
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"ver": "1.1.2",
|
||||
"uuid": "4734c20c-0db8-4eb2-92ea-e692f4d70934",
|
||||
"isBundle": false,
|
||||
"bundleName": "",
|
||||
"priority": 1,
|
||||
"compressionType": {},
|
||||
"optimizeHotUpdate": {},
|
||||
"inlineSpriteFrames": {},
|
||||
"isRemoteBundle": {},
|
||||
"subMetas": {}
|
||||
}
|
||||
22
TweemDemo/assets/Script/HelloWorld.js
Normal file
22
TweemDemo/assets/Script/HelloWorld.js
Normal file
@@ -0,0 +1,22 @@
|
||||
cc.Class({
|
||||
extends: cc.Component,
|
||||
|
||||
properties: {
|
||||
label: {
|
||||
default: null,
|
||||
type: cc.Label
|
||||
},
|
||||
// defaults, set visually when attaching this script to the Canvas
|
||||
text: 'Hello, World!'
|
||||
},
|
||||
|
||||
// use this for initialization
|
||||
onLoad: function () {
|
||||
this.label.string = this.text;
|
||||
},
|
||||
|
||||
// called every frame
|
||||
update: function (dt) {
|
||||
|
||||
},
|
||||
});
|
||||
9
TweemDemo/assets/Script/HelloWorld.js.meta
Normal file
9
TweemDemo/assets/Script/HelloWorld.js.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "1.0.8",
|
||||
"uuid": "280c3aec-6492-4a9d-9f51-a9b00b570b4a",
|
||||
"isPlugin": false,
|
||||
"loadPluginInWeb": true,
|
||||
"loadPluginInNative": true,
|
||||
"loadPluginInEditor": false,
|
||||
"subMetas": {}
|
||||
}
|
||||
213
TweemDemo/assets/Script/TweemTest.ts
Normal file
213
TweemDemo/assets/Script/TweemTest.ts
Normal file
@@ -0,0 +1,213 @@
|
||||
|
||||
|
||||
const { ccclass, property } = cc._decorator;
|
||||
|
||||
@ccclass
|
||||
export default class TweemTest extends cc.Component {
|
||||
|
||||
@property({ type: cc.Node, displayName: "测试节点" })
|
||||
public targetNode: cc.Node = null;
|
||||
// LIFE-CYCLE CALLBACKS:
|
||||
private curTw: cc.Tween;
|
||||
|
||||
onLoad() {
|
||||
|
||||
}
|
||||
|
||||
start() {
|
||||
|
||||
}
|
||||
|
||||
onEventClick(event: cc.Touch, custom: string) {
|
||||
if (custom == "1") {
|
||||
this.repeatForeverAction(this.targetNode);
|
||||
} else if (custom == "2") {
|
||||
this.curTw.removeSelf();
|
||||
} else if (custom == "3") {
|
||||
this.tagAction(this.targetNode);
|
||||
} else if (custom == "4") {
|
||||
this.stopByTag(this.targetNode);
|
||||
} else if (custom == "5") {
|
||||
this.easeAction(this.targetNode);
|
||||
} else if (custom == "6") {
|
||||
this.stopAction(this.curTw)
|
||||
} else if (custom == '7') {
|
||||
this.progressAction(this.targetNode);
|
||||
} else if (custom == '8') {
|
||||
this.stopAction(this.curTw)
|
||||
}
|
||||
}
|
||||
|
||||
resetNode(node: cc.Node) {
|
||||
node.position = cc.v3();
|
||||
node.angle = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加一个对属性进行绝对值计算的 action
|
||||
* @param node
|
||||
*/
|
||||
toAction(node: cc.Node) {
|
||||
this.resetNode(node);
|
||||
this.curTw = cc.tween(node).to(0.2, { x: 200 }).start();
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加一个对属性进行相对值计算的 action
|
||||
* @param node
|
||||
*/
|
||||
byAction(node: cc.Node) {
|
||||
this.resetNode(node);
|
||||
this.curTw = cc.tween(node).by(0.2, { x: 200 }).start();
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加一个回调 action
|
||||
* @param node
|
||||
*/
|
||||
callAction(node: cc.Node) {
|
||||
this.resetNode(node);
|
||||
this.curTw = cc.tween(node).call(() => {
|
||||
console.log('callback')
|
||||
}).start();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param node
|
||||
*/
|
||||
delayAction(node: cc.Node) {
|
||||
this.resetNode(node);
|
||||
this.curTw = cc.tween(node).delay(1).start();
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加一个队列 action
|
||||
* @param node
|
||||
*/
|
||||
sequenceAction(node: cc.Node) {
|
||||
this.resetNode(node);
|
||||
this.curTw = cc.tween(node).sequence(
|
||||
cc.tween(node).to(0.2, { x: 110 }),
|
||||
cc.tween(node).to(0.2, { y: 110 })
|
||||
).start();
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加一个并行 action
|
||||
* @param node
|
||||
*/
|
||||
paralletAction(node: cc.Node) {
|
||||
this.resetNode(node);
|
||||
this.curTw = cc.tween(node).parallel(
|
||||
cc.tween(node).to(0.2, { x: 110 }),
|
||||
cc.tween(node).to(0.2, { y: 110 })
|
||||
).start();
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加一个重复 action,这个 action 会将前一个动作作为他的参数。
|
||||
* @param node
|
||||
*/
|
||||
repeatAction(node: cc.Node) {
|
||||
this.resetNode(node);
|
||||
this.curTw = cc.tween(node).sequence(
|
||||
cc.tween(node).to(0.2, { x: 110 }),
|
||||
cc.tween(node).to(0.2, { y: 110 }),
|
||||
cc.tween(node).call(() => {
|
||||
node.position = new cc.Vec3();
|
||||
})
|
||||
).repeat(2).start();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param node
|
||||
*/
|
||||
repeatForeverAction(node: cc.Node) {
|
||||
this.resetNode(node);
|
||||
this.curTw = cc.tween(node).sequence(
|
||||
cc.tween(node).to(0.2, { x: 110 }),
|
||||
cc.tween(node).to(0.2, { y: 110 }),
|
||||
cc.tween(node).call(() => {
|
||||
node.position = new cc.Vec3();
|
||||
})
|
||||
).repeatForever().start();
|
||||
}
|
||||
|
||||
/**
|
||||
* 将之前所有的 action 整合为一个 action。
|
||||
* @param node
|
||||
*/
|
||||
unionAction(node: cc.Node) {
|
||||
this.resetNode(node);
|
||||
this.curTw = cc.tween(node).to(0.2, { x: 110 })
|
||||
.to(0.2, { y: 110 }).call(() => {
|
||||
node.position = new cc.Vec3();
|
||||
}).union().repeatForever().start();
|
||||
}
|
||||
|
||||
/**
|
||||
* 对节点动画关闭
|
||||
* @param tw
|
||||
*/
|
||||
stopAction(tw: cc.Tween) {
|
||||
tw.stop();
|
||||
}
|
||||
|
||||
/**
|
||||
* 对tween添加一个标签
|
||||
* @param node
|
||||
*/
|
||||
tagAction(node: cc.Node) {
|
||||
this.resetNode(node);
|
||||
this.curTw = cc.tween(node).to(0.2, { x: 110 })
|
||||
.to(0.2, { y: 110 }).call(() => {
|
||||
node.position = new cc.Vec3();
|
||||
}).union().tag(11).repeatForever().start();
|
||||
}
|
||||
|
||||
/**
|
||||
* 对节点动画通标签关闭
|
||||
* @param node
|
||||
* @param tag
|
||||
*/
|
||||
stopByTag(node: cc.Node, tag: number = 11) {
|
||||
node.stopActionByTag(tag);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加一个缓动效果
|
||||
* @param node
|
||||
*/
|
||||
easeAction(node: cc.Node) {
|
||||
this.resetNode(node);
|
||||
this.curTw = cc.tween(node)
|
||||
.to(1, { x: 100, y: 100 }, { easing: cc.easing['backIn'] })
|
||||
.to(1, { x: 0, y: 0 }, { easing: "backOut" })
|
||||
.union().repeatForever().start();
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加一个 progress 函数
|
||||
* @param node
|
||||
*/
|
||||
progressAction(node: cc.Node) {
|
||||
this.resetNode(node);
|
||||
this.curTw = cc.tween(node).to(1, { x: 100, y: 100 }, {
|
||||
progress: (start, end, current, time) => {
|
||||
console.log('1111', start, end, current, time);
|
||||
current = start + (end - start) * time;
|
||||
return current;
|
||||
}
|
||||
}).to(1, { x: 0, y: 0 }, {
|
||||
progress: (start, end, current, time) => {
|
||||
console.log('2222', start, end, current, time);
|
||||
current = start + (end - start) * time;
|
||||
return current;
|
||||
}
|
||||
}).union().repeatForever().start();
|
||||
}
|
||||
|
||||
// update (dt) {}
|
||||
}
|
||||
9
TweemDemo/assets/Script/TweemTest.ts.meta
Normal file
9
TweemDemo/assets/Script/TweemTest.ts.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "1.0.8",
|
||||
"uuid": "f6462511-f8c9-4884-8f47-8355bdcb009a",
|
||||
"isPlugin": false,
|
||||
"loadPluginInWeb": true,
|
||||
"loadPluginInNative": true,
|
||||
"loadPluginInEditor": false,
|
||||
"subMetas": {}
|
||||
}
|
||||
12
TweemDemo/assets/Texture.meta
Normal file
12
TweemDemo/assets/Texture.meta
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"ver": "1.1.2",
|
||||
"uuid": "7b81d4e8-ec84-4716-968d-500ac1d78a54",
|
||||
"isBundle": false,
|
||||
"bundleName": "",
|
||||
"priority": 1,
|
||||
"compressionType": {},
|
||||
"optimizeHotUpdate": {},
|
||||
"inlineSpriteFrames": {},
|
||||
"isRemoteBundle": {},
|
||||
"subMetas": {}
|
||||
}
|
||||
BIN
TweemDemo/assets/Texture/HelloWorld.png
Normal file
BIN
TweemDemo/assets/Texture/HelloWorld.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 37 KiB |
36
TweemDemo/assets/Texture/HelloWorld.png.meta
Normal file
36
TweemDemo/assets/Texture/HelloWorld.png.meta
Normal file
@@ -0,0 +1,36 @@
|
||||
{
|
||||
"ver": "2.3.5",
|
||||
"uuid": "6aa0aa6a-ebee-4155-a088-a687a6aadec4",
|
||||
"type": "sprite",
|
||||
"wrapMode": "clamp",
|
||||
"filterMode": "bilinear",
|
||||
"premultiplyAlpha": false,
|
||||
"genMipmaps": false,
|
||||
"packable": true,
|
||||
"width": 195,
|
||||
"height": 270,
|
||||
"platformSettings": {},
|
||||
"subMetas": {
|
||||
"HelloWorld": {
|
||||
"ver": "1.0.4",
|
||||
"uuid": "31bc895a-c003-4566-a9f3-2e54ae1c17dc",
|
||||
"rawTextureUuid": "6aa0aa6a-ebee-4155-a088-a687a6aadec4",
|
||||
"trimType": "auto",
|
||||
"trimThreshold": 1,
|
||||
"rotated": false,
|
||||
"offsetX": 0,
|
||||
"offsetY": 0,
|
||||
"trimX": 0,
|
||||
"trimY": 0,
|
||||
"width": 195,
|
||||
"height": 270,
|
||||
"rawWidth": 195,
|
||||
"rawHeight": 270,
|
||||
"borderTop": 0,
|
||||
"borderBottom": 0,
|
||||
"borderLeft": 0,
|
||||
"borderRight": 0,
|
||||
"subMetas": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
TweemDemo/assets/Texture/singleColor.png
Normal file
BIN
TweemDemo/assets/Texture/singleColor.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 82 B |
36
TweemDemo/assets/Texture/singleColor.png.meta
Normal file
36
TweemDemo/assets/Texture/singleColor.png.meta
Normal file
@@ -0,0 +1,36 @@
|
||||
{
|
||||
"ver": "2.3.5",
|
||||
"uuid": "a8027877-d8d6-4645-97a0-52d4a0123dba",
|
||||
"type": "sprite",
|
||||
"wrapMode": "clamp",
|
||||
"filterMode": "bilinear",
|
||||
"premultiplyAlpha": false,
|
||||
"genMipmaps": false,
|
||||
"packable": true,
|
||||
"width": 2,
|
||||
"height": 2,
|
||||
"platformSettings": {},
|
||||
"subMetas": {
|
||||
"singleColor": {
|
||||
"ver": "1.0.4",
|
||||
"uuid": "410fb916-8721-4663-bab8-34397391ace7",
|
||||
"rawTextureUuid": "a8027877-d8d6-4645-97a0-52d4a0123dba",
|
||||
"trimType": "auto",
|
||||
"trimThreshold": 1,
|
||||
"rotated": false,
|
||||
"offsetX": 0,
|
||||
"offsetY": 0,
|
||||
"trimX": 0,
|
||||
"trimY": 0,
|
||||
"width": 2,
|
||||
"height": 2,
|
||||
"rawWidth": 2,
|
||||
"rawHeight": 2,
|
||||
"borderTop": 0,
|
||||
"borderBottom": 0,
|
||||
"borderLeft": 0,
|
||||
"borderRight": 0,
|
||||
"subMetas": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
32073
TweemDemo/creator.d.ts
vendored
Normal file
32073
TweemDemo/creator.d.ts
vendored
Normal file
File diff suppressed because it is too large
Load Diff
15
TweemDemo/jsconfig.json
Normal file
15
TweemDemo/jsconfig.json
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "es6",
|
||||
"module": "commonjs",
|
||||
"experimentalDecorators": true
|
||||
},
|
||||
"exclude": [
|
||||
"node_modules",
|
||||
".vscode",
|
||||
"library",
|
||||
"local",
|
||||
"settings",
|
||||
"temp"
|
||||
]
|
||||
}
|
||||
8
TweemDemo/project.json
Normal file
8
TweemDemo/project.json
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"engine": "cocos2d-html5",
|
||||
"packages": "packages",
|
||||
"version": "2.4.5",
|
||||
"name": "TweemDemo",
|
||||
"id": "ba792e93-1fbf-41a2-b78f-41af3b404512",
|
||||
"isNew": false
|
||||
}
|
||||
13
TweemDemo/settings/builder.json
Normal file
13
TweemDemo/settings/builder.json
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"excludeScenes": [],
|
||||
"orientation": {
|
||||
"landscapeLeft": true,
|
||||
"landscapeRight": true,
|
||||
"portrait": false,
|
||||
"upsideDown": false
|
||||
},
|
||||
"packageName": "org.cocos2d.helloworld",
|
||||
"startScene": "2d2f792f-a40c-49bb-a189-ed176a246e49",
|
||||
"title": "hello_world",
|
||||
"webOrientation": "auto"
|
||||
}
|
||||
7
TweemDemo/settings/builder.panel.json
Normal file
7
TweemDemo/settings/builder.panel.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"excludeScenes": [],
|
||||
"packageName": "org.cocos2d.helloworld",
|
||||
"platform": "web-mobile",
|
||||
"startScene": "2d2f792f-a40c-49bb-a189-ed176a246e49",
|
||||
"title": "HelloWorld"
|
||||
}
|
||||
23
TweemDemo/settings/project.json
Normal file
23
TweemDemo/settings/project.json
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"collision-matrix": [
|
||||
[
|
||||
true
|
||||
]
|
||||
],
|
||||
"excluded-modules": [],
|
||||
"group-list": [
|
||||
"default"
|
||||
],
|
||||
"start-scene": "2d2f792f-a40c-49bb-a189-ed176a246e49",
|
||||
"design-resolution-width": 960,
|
||||
"design-resolution-height": 640,
|
||||
"fit-width": false,
|
||||
"fit-height": true,
|
||||
"use-project-simulator-setting": false,
|
||||
"simulator-orientation": false,
|
||||
"use-customize-simulator": false,
|
||||
"simulator-resolution": {
|
||||
"width": 960,
|
||||
"height": 640
|
||||
}
|
||||
}
|
||||
6
TweemDemo/settings/services.json
Normal file
6
TweemDemo/settings/services.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"game": {
|
||||
"name": "未知游戏",
|
||||
"appid": "UNKNOW"
|
||||
}
|
||||
}
|
||||
BIN
TweemDemo/template-banner.png
Normal file
BIN
TweemDemo/template-banner.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 23 KiB |
5
TweemDemo/template.json
Normal file
5
TweemDemo/template.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"name": "TEMPLATES.helloworld.name",
|
||||
"desc": "TEMPLATES.helloworld.desc",
|
||||
"banner": "template-banner.png"
|
||||
}
|
||||
19
TweemDemo/tsconfig.json
Normal file
19
TweemDemo/tsconfig.json
Normal file
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [ "es2015", "es2017", "dom" ],
|
||||
"target": "es5",
|
||||
"experimentalDecorators": true,
|
||||
"skipLibCheck": true,
|
||||
"outDir": "temp/vscode-dist",
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"exclude": [
|
||||
"node_modules",
|
||||
"library",
|
||||
"local",
|
||||
"temp",
|
||||
"build",
|
||||
"settings"
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user