chore
parent
28deead76e
commit
e73cf76c00
Binary file not shown.
After Width: | Height: | Size: 26 KiB |
|
@ -0,0 +1,134 @@
|
|||
{
|
||||
"ver": "1.0.26",
|
||||
"importer": "image",
|
||||
"imported": true,
|
||||
"uuid": "ae013165-2a49-46cb-a7f4-af4e251970c2",
|
||||
"files": [
|
||||
".json",
|
||||
".png"
|
||||
],
|
||||
"subMetas": {
|
||||
"6c48a": {
|
||||
"importer": "texture",
|
||||
"uuid": "ae013165-2a49-46cb-a7f4-af4e251970c2@6c48a",
|
||||
"displayName": "Arrow",
|
||||
"id": "6c48a",
|
||||
"name": "texture",
|
||||
"userData": {
|
||||
"wrapModeS": "clamp-to-edge",
|
||||
"wrapModeT": "clamp-to-edge",
|
||||
"imageUuidOrDatabaseUri": "ae013165-2a49-46cb-a7f4-af4e251970c2",
|
||||
"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": "ae013165-2a49-46cb-a7f4-af4e251970c2@f9941",
|
||||
"displayName": "Arrow",
|
||||
"id": "f9941",
|
||||
"name": "spriteFrame",
|
||||
"userData": {
|
||||
"trimType": "auto",
|
||||
"trimThreshold": 1,
|
||||
"rotated": false,
|
||||
"offsetX": 0,
|
||||
"offsetY": 0,
|
||||
"trimX": 0,
|
||||
"trimY": 0,
|
||||
"width": 141,
|
||||
"height": 261,
|
||||
"rawWidth": 141,
|
||||
"rawHeight": 261,
|
||||
"borderTop": 0,
|
||||
"borderBottom": 0,
|
||||
"borderLeft": 0,
|
||||
"borderRight": 0,
|
||||
"packable": true,
|
||||
"pixelsToUnit": 100,
|
||||
"pivotX": 0.5,
|
||||
"pivotY": 0.5,
|
||||
"meshType": 0,
|
||||
"vertices": {
|
||||
"rawPosition": [
|
||||
-70.5,
|
||||
-130.5,
|
||||
0,
|
||||
70.5,
|
||||
-130.5,
|
||||
0,
|
||||
-70.5,
|
||||
130.5,
|
||||
0,
|
||||
70.5,
|
||||
130.5,
|
||||
0
|
||||
],
|
||||
"indexes": [
|
||||
0,
|
||||
1,
|
||||
2,
|
||||
2,
|
||||
1,
|
||||
3
|
||||
],
|
||||
"uv": [
|
||||
0,
|
||||
261,
|
||||
141,
|
||||
261,
|
||||
0,
|
||||
0,
|
||||
141,
|
||||
0
|
||||
],
|
||||
"nuv": [
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
1
|
||||
],
|
||||
"minPos": [
|
||||
-70.5,
|
||||
-130.5,
|
||||
0
|
||||
],
|
||||
"maxPos": [
|
||||
70.5,
|
||||
130.5,
|
||||
0
|
||||
]
|
||||
},
|
||||
"isUuid": true,
|
||||
"imageUuidOrDatabaseUri": "ae013165-2a49-46cb-a7f4-af4e251970c2@6c48a",
|
||||
"atlasUuid": ""
|
||||
},
|
||||
"ver": "1.0.12",
|
||||
"imported": true,
|
||||
"files": [
|
||||
".json"
|
||||
],
|
||||
"subMetas": {}
|
||||
}
|
||||
},
|
||||
"userData": {
|
||||
"type": "sprite-frame",
|
||||
"hasAlpha": true,
|
||||
"fixAlphaTransparencyArtifacts": false,
|
||||
"redirect": "ae013165-2a49-46cb-a7f4-af4e251970c2@f9941"
|
||||
}
|
||||
}
|
Binary file not shown.
|
@ -1,12 +0,0 @@
|
|||
{
|
||||
"ver": "1.0.1",
|
||||
"importer": "*",
|
||||
"imported": true,
|
||||
"uuid": "2a2eb382-a66a-4f42-873d-da2fb052204b",
|
||||
"files": [
|
||||
".db",
|
||||
".json"
|
||||
],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -1,6 +1,5 @@
|
|||
import { _decorator, Collider2D, Component, Contact2DType, Node } from 'cc';
|
||||
import { GameManager } from '../Manager/GameManager';
|
||||
import ObjectPool from '../Pool/ObjectPool';
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass('Outer')
|
||||
|
@ -13,7 +12,7 @@ export class Outer extends Component {
|
|||
}
|
||||
|
||||
private onBeginContact(selfCollider: Collider2D, otherCollider: Collider2D) {
|
||||
ObjectPool.release(otherCollider.node);
|
||||
otherCollider.node.releaseToPool();
|
||||
GameManager.instance.ballOut();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { _decorator, Component, director, instantiate, Node, Prefab } from 'cc';
|
||||
import { _decorator, Component, director, instantiate, Node, Prefab, RigidBody, RigidBody2D } from 'cc';
|
||||
import IPoolable from './IPoolable';
|
||||
|
||||
export default class ObjectPool {
|
||||
|
@ -91,7 +91,6 @@ export default class ObjectPool {
|
|||
obj = this._actives.shift();
|
||||
obj.removeFromParent();
|
||||
}
|
||||
|
||||
obj.setParent(parent);
|
||||
this._actives.push(obj);
|
||||
// Invoke pool handler
|
||||
|
@ -132,6 +131,12 @@ export default class ObjectPool {
|
|||
(handler as unknown as IPoolable)?.onRelease();
|
||||
}
|
||||
// Remove from parent, but don't cleanup
|
||||
if (RigidBody2D) {
|
||||
node.getComponent(RigidBody2D)?.sleep();
|
||||
}
|
||||
if (RigidBody) {
|
||||
node.getComponent(RigidBody)?.sleep();
|
||||
}
|
||||
node.removeFromParent();
|
||||
return true;
|
||||
}
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 25 KiB |
|
@ -0,0 +1,134 @@
|
|||
{
|
||||
"ver": "1.0.26",
|
||||
"importer": "image",
|
||||
"imported": true,
|
||||
"uuid": "2ad48e79-9d16-46f9-b2eb-2dae4d6d440f",
|
||||
"files": [
|
||||
".json",
|
||||
".png"
|
||||
],
|
||||
"subMetas": {
|
||||
"6c48a": {
|
||||
"importer": "texture",
|
||||
"uuid": "2ad48e79-9d16-46f9-b2eb-2dae4d6d440f@6c48a",
|
||||
"displayName": "p4p_tile",
|
||||
"id": "6c48a",
|
||||
"name": "texture",
|
||||
"userData": {
|
||||
"wrapModeS": "clamp-to-edge",
|
||||
"wrapModeT": "clamp-to-edge",
|
||||
"imageUuidOrDatabaseUri": "2ad48e79-9d16-46f9-b2eb-2dae4d6d440f",
|
||||
"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": "2ad48e79-9d16-46f9-b2eb-2dae4d6d440f@f9941",
|
||||
"displayName": "p4p_tile",
|
||||
"id": "f9941",
|
||||
"name": "spriteFrame",
|
||||
"userData": {
|
||||
"trimType": "auto",
|
||||
"trimThreshold": 1,
|
||||
"rotated": false,
|
||||
"offsetX": 0,
|
||||
"offsetY": 0,
|
||||
"trimX": 0,
|
||||
"trimY": 0,
|
||||
"width": 400,
|
||||
"height": 400,
|
||||
"rawWidth": 400,
|
||||
"rawHeight": 400,
|
||||
"borderTop": 0,
|
||||
"borderBottom": 0,
|
||||
"borderLeft": 0,
|
||||
"borderRight": 0,
|
||||
"packable": true,
|
||||
"pixelsToUnit": 100,
|
||||
"pivotX": 0.5,
|
||||
"pivotY": 0.5,
|
||||
"meshType": 0,
|
||||
"vertices": {
|
||||
"rawPosition": [
|
||||
-200,
|
||||
-200,
|
||||
0,
|
||||
200,
|
||||
-200,
|
||||
0,
|
||||
-200,
|
||||
200,
|
||||
0,
|
||||
200,
|
||||
200,
|
||||
0
|
||||
],
|
||||
"indexes": [
|
||||
0,
|
||||
1,
|
||||
2,
|
||||
2,
|
||||
1,
|
||||
3
|
||||
],
|
||||
"uv": [
|
||||
0,
|
||||
400,
|
||||
400,
|
||||
400,
|
||||
0,
|
||||
0,
|
||||
400,
|
||||
0
|
||||
],
|
||||
"nuv": [
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
1
|
||||
],
|
||||
"minPos": [
|
||||
-200,
|
||||
-200,
|
||||
0
|
||||
],
|
||||
"maxPos": [
|
||||
200,
|
||||
200,
|
||||
0
|
||||
]
|
||||
},
|
||||
"isUuid": true,
|
||||
"imageUuidOrDatabaseUri": "2ad48e79-9d16-46f9-b2eb-2dae4d6d440f@6c48a",
|
||||
"atlasUuid": ""
|
||||
},
|
||||
"ver": "1.0.12",
|
||||
"imported": true,
|
||||
"files": [
|
||||
".json"
|
||||
],
|
||||
"subMetas": {}
|
||||
}
|
||||
},
|
||||
"userData": {
|
||||
"type": "sprite-frame",
|
||||
"hasAlpha": false,
|
||||
"fixAlphaTransparencyArtifacts": false,
|
||||
"redirect": "2ad48e79-9d16-46f9-b2eb-2dae4d6d440f@f9941"
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue