[add] init

This commit is contained in:
2022-03-07 09:15:59 +08:00
commit cbcd795667
421 changed files with 61342 additions and 0 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,7 @@
{
"ver": "1.2.6",
"uuid": "aec53dfe-e702-4258-978a-51e2855d7fac",
"asyncLoadAssets": false,
"autoReleaseAssets": false,
"subMetas": {}
}

View File

@@ -0,0 +1,49 @@
const { ccclass, property } = cc._decorator;
@ccclass
export default class Moving_ghost extends cc.Component {
@property([cc.Sprite])
ghostCanvasList: cc.Sprite[] = [];
@property(cc.Node)
role: cc.Node = null;
@property(cc.Camera)
roleCamera: cc.Camera = null;
onLoad() {
const roleZindex = 10;
this.role.zIndex = roleZindex;
const texture = new cc.RenderTexture();
texture.initWithSize(this.node.width, this.node.height);
const spriteFrame = new cc.SpriteFrame();
spriteFrame.setTexture(texture);
this.roleCamera.targetTexture = texture;
this.ghostCanvasList.forEach((ghost, idx) => {
ghost.node.scaleY = -1;
ghost.node.zIndex = roleZindex - idx;
ghost.node.opacity = 100 - idx * 15;
ghost.spriteFrame = spriteFrame;
});
this.schedule(this.ghostFollow, 0.1, cc.macro.REPEAT_FOREVER);
this.node.on(cc.Node.EventType.TOUCH_MOVE, this.touchMoveEvent, this);
}
touchMoveEvent(evt: cc.Event.EventTouch) {
this.role.x += evt.getDeltaX();
this.role.y += evt.getDeltaY();
}
beforeDestroy() {
this.unschedule(this.ghostFollow);
}
ghostFollow() {
this.ghostCanvasList.forEach((ghost, i) => {
const dis = (ghost.node.position as any).sub(this.role.position).mag();
if (dis < 0.5) return; // 给个误差范围涉及到浮点数dis的计算不可能精准小于0.5就可以认为是静止了
ghost.node.stopAllActions();
ghost.node.runAction(cc.moveTo(i * 0.04 + 0.02, this.role.x, this.role.y));
});
}
}

View File

@@ -0,0 +1,9 @@
{
"ver": "1.0.5",
"uuid": "0dc97648-cf3b-47ec-824c-0d0c0751e888",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}

View File

@@ -0,0 +1,7 @@
{
"ver": "1.0.1",
"uuid": "8435a0d4-52a7-4838-b251-a5d451bb0d8b",
"isSubpackage": false,
"subpackageName": "",
"subMetas": {}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

View File

@@ -0,0 +1,36 @@
{
"ver": "2.3.4",
"uuid": "eeace92a-7054-4d86-81d2-92898c396ad2",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 228,
"height": 159,
"platformSettings": {},
"subMetas": {
"sheep": {
"ver": "1.0.4",
"uuid": "67109cb1-b42f-4731-ace1-98b0e220760a",
"rawTextureUuid": "eeace92a-7054-4d86-81d2-92898c396ad2",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": -3.5,
"offsetY": -0.5,
"trimX": 27,
"trimY": 24,
"width": 167,
"height": 112,
"rawWidth": 228,
"rawHeight": 159,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 B

View File

@@ -0,0 +1,36 @@
{
"ver": "2.3.4",
"uuid": "ad64223a-f067-4df0-9d6a-eee10808d220",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 2,
"height": 2,
"platformSettings": {},
"subMetas": {
"single_color": {
"ver": "1.0.4",
"uuid": "de0de72b-78cf-46f2-aa49-1d8c91cabc69",
"rawTextureUuid": "ad64223a-f067-4df0-9d6a-eee10808d220",
"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": {}
}
}
}