Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
middleLayer_for_NJ_lite
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
template admin
middleLayer_for_NJ_lite
Commits
1382cf18
Commit
1382cf18
authored
Sep 27, 2022
by
limingzhe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: debug 清缓存
parent
7ce080df
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
9 deletions
+19
-9
middleLayerBase.ts
assets/middleLayer_for_NJ_lite/script/middleLayerBase.ts
+16
-9
creator.d.ts
creator.d.ts
+3
-0
No files found.
assets/middleLayer_for_NJ_lite/script/middleLayerBase.ts
View file @
1382cf18
...
@@ -450,16 +450,10 @@ export abstract class middleLayerBase extends cc.Component {
...
@@ -450,16 +450,10 @@ export abstract class middleLayerBase extends cc.Component {
console
.
log
(
'
asset_uuid:
'
,
asset
.
_uuid
);
console
.
log
(
'
asset_uuid:
'
,
asset
.
_uuid
);
console
.
log
(
'
asset:
'
,
asset
);
console
.
log
(
'
asset:
'
,
asset
);
try
{
// asset.decRef();
while
(
asset
?.
refCount
>
0
)
{
while
(
asset
?.
refCount
>
0
)
{
asset
.
decRef
();
asset
.
decRef
();
}
}
cc
.
assetManager
.
releaseAsset
(
asset
);
asset
.
destroy
();
}
catch
(
error
)
{
console
.
log
(
'
try catch error:
'
,
error
);
}
// asset.decRef();
// asset.decRef();
// cc.assetManager.releaseAsset(asset);
// cc.assetManager.releaseAsset(asset);
...
@@ -478,9 +472,22 @@ export abstract class middleLayerBase extends cc.Component {
...
@@ -478,9 +472,22 @@ export abstract class middleLayerBase extends cc.Component {
while
(
texture
?.
refCount
>
0
)
{
while
(
texture
?.
refCount
>
0
)
{
texture
.
decRef
();
texture
.
decRef
();
}
}
});
});
[
...
this
.
assetList
].
forEach
(
asset
=>
{
console
.
log
(
'
asset_uuid:
'
,
asset
.
_uuid
);
console
.
log
(
'
asset:
'
,
asset
);
cc
.
assetManager
.
releaseUnusedAssets
();
// asset.decRef();
// cc.assetManager.releaseAsset(asset);
// asset.destroy();
});
// this.atlasList.length = this.assetList.length = this.nodeList.length = this.textureList.length = 1;
// this.atlasList.length = this.assetList.length = this.nodeList.length = this.textureList.length = 1;
...
...
creator.d.ts
View file @
1382cf18
...
@@ -5914,6 +5914,9 @@ declare namespace cc {
...
@@ -5914,6 +5914,9 @@ declare namespace cc {
释放所有资源。详细信息请参考 {{#crossLink "AssetManager/releaseAsset:method"}}{{/crossLink}}
释放所有资源。详细信息请参考 {{#crossLink "AssetManager/releaseAsset:method"}}{{/crossLink}}
*/
*/
releaseAll
():
void
;
releaseAll
():
void
;
releaseUnusedAssets
():
void
}
}
/** `cc.loader` is deprecated, please backup your project and upgrade to {{#crossLink "AssetManager"}}{{/crossLink}} */
/** `cc.loader` is deprecated, please backup your project and upgrade to {{#crossLink "AssetManager"}}{{/crossLink}} */
export
class
loader
{
export
class
loader
{
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment