Skip to content

Chore: Code cleanup for AssetBundleManager - #2

Merged
Cyrusbye720 merged 11 commits into
feat_AssetBundleManagerfrom
chore/code-cleanup
Oct 4, 2026
Merged

Cyrusbye720 merged 11 commits into
feat_AssetBundleManagerfrom
chore/code-cleanup

Conversation

@SniffBakaSniff

@SniffBakaSniff SniffBakaSniff commented Oct 2, 2026 •

Copy link
Copy Markdown
Collaborator

User description

What changed?

See CHANGELOG.md [1.1.1-dev-alpha] for details.

Why?

Most of the code was AI-generated and had become messy and difficult to maintain. This cleans up the code and improves the overall structure.

How was it tested?

Manual in-game testing.


CodeAnt-AI Description

Fix custom-scene loading, spawning, and level-time updates

What Changed

  • Reloading an active custom scene now waits for the previous copy to unload, while duplicate requests and attempts to load the base gameplay scene are ignored.
  • Scene-load and spawn-search timeouts clean up their background wait, allowing later scene requests to proceed.
  • Players can spawn at markers nested in custom scenes, and movement is restored if placement fails.
  • Custom scenes keep the player camera active while hiding the menu and base-game visuals; level-time notifications now update during gameplay.

Impact

✅ Fewer failed custom-scene reloads
✅ Scene requests recover after timeouts
✅ Reliable spawning at nested scene markers

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

See CHANGELOG.md [1.1.1-dev-alpha] for details.
Forgot to update the plugin version.
@codeant-ai

codeant-ai Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

🤖 CodeAnt AI — Review Status

Status Commit Started (UTC) Finished (UTC)
✅ Incremental review completed c3a1f2e Oct 04, 2026 · 20:06 20:06
✅ Reviewed your PR 0c19a99 Oct 04, 2026 · 12:49 12:49
✅ Incremental review completed 0c19a99 Oct 04, 2026 · 12:47 12:47
✅ Incremental review completed 0c19a99 Oct 04, 2026 · 12:47 13:02
✅ Reviewed your PR 523a54a Oct 04, 2026 · 01:08 01:11

@codeant-ai

codeant-ai Bot commented Oct 2, 2026

Copy link
Copy Markdown

Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@codeant-ai codeant-ai Bot added the size:L This PR changes 100-499 lines, ignoring generated files label Oct 2, 2026
Comment thread Events/EventManager.cs Resolved
Comment thread SceneManager/SceneLoadWaiter.cs Resolved
Comment thread SceneManager/SceneLoadWaiter.cs Resolved
Comment thread SceneManager/SceneManager.cs Resolved
@codeant-ai

codeant-ai Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

CodeAnt Nitpicks

No threshold-suppressed suggestions found in the latest review.

@Cyrusbye720

Copy link
Copy Markdown
Contributor

@CodeAnt-AI: review

Comment thread SceneManager/SceneLoadWaiter.cs Resolved
Comment thread SceneManager/SceneManager.cs Resolved
Comment thread SceneManager/SceneManager.cs Resolved
@Cyrusbye720

Copy link
Copy Markdown
Contributor

@CodeAnt-AI: review

Comment thread SceneManager/SceneLoadWaiter.cs Resolved
Comment thread SceneManager/SceneManager.cs Outdated
Comment on lines +32 to +35
if (UnityEngine.Object.FindAnyObjectByType<SceneLoadWaiter>() != null)
{
Logger.Log($"Scene load already in progress; ignoring duplicate request for '{sceneName}'.");
return;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: The startup SceneLoadWaiter has an empty scene name but remains alive, so this check rejects every later public scene-load request as a duplicate.

Assessment: 🔴 Critical · 🔁 Occurrence: Often · 🏷️ State/lifecycle

Use CodeAnt Skill Fix in Cursor Fix in VSCode Claude

Prompt for AI Agent 🤖
This is a comment left during a code review.

**Path:** SceneManager/SceneManager.cs
**Line:** 32:35
**Comment:**
	*State Lifecycle: The startup `SceneLoadWaiter` has an empty scene name but remains alive, so this check rejects every later public scene-load request as a duplicate.

Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix
👍 | 👎

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in f66345b — removed AddComponent() from Plugin.Load() and switched to an internal IsSceneLoading state flag on SceneManager.

@Cyrusbye720

Copy link
Copy Markdown
Contributor

@CodeAnt-AI: review

Comment thread SceneManager/SceneManager.cs Resolved
@Cyrusbye720

Copy link
Copy Markdown
Contributor

@CodeAnt-AI: review

Comment thread Plugin.cs
namespace DeadshotModAPI;

[BepInPlugin("com.subaka.deadshotmodapi", "Deadshot Mod API", "v1.0.0-dev-alpha")]
[BepInPlugin("com.subaka.deadshotmodapi", "Deadshot Mod API", "v1.1.1-dev-alpha")]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: The plugin metadata no longer matches the repository’s contract tests, which require Deadshot Mod Api and version 0.0.1; the metadata test now fails.

Assessment: 🟠 Major · 🔁 Occurrence: Often · 🏷️ Api mismatch

Use CodeAnt Skill Fix in Cursor Fix in VSCode Claude

Prompt for AI Agent 🤖
This is a comment left during a code review.

**Path:** Plugin.cs
**Line:** 7:7
**Comment:**
	*Api Mismatch: The plugin metadata no longer matches the repository’s contract tests, which require `Deadshot Mod Api` and version `0.0.1`; the metadata test now fails.

Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix
👍 | 👎

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Plugin.cs has used Deadshot Mod API and �1.x versioning since �1.0.0-alpha. The assertion in Tier5_AdversarialCoverageTests.cs reflects a legacy test fixture in an excluded test suite rather than the live plugin contract.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Customized review instruction saved!

Instruction:

Treat the plugin metadata in Plugin.cs as canonical: use the Deadshot Mod API name and 1.x versioning, and do not flag mismatches based on excluded legacy test fixtures.

Applied to:

  • Plugin.cs

💡 To manage or update this instruction, visit: CodeAnt AI Settings

Comment thread SceneManager/SceneLoadWaiter.cs Resolved
@Cyrusbye720

Copy link
Copy Markdown
Contributor

@CodeAnt-AI: review

@Cyrusbye720
Cyrusbye720 merged commit 89c1c7c into feat_AssetBundleManager Oct 4, 2026
@SniffBakaSniff
SniffBakaSniff deleted the chore/code-cleanup branch October 18, 2026 23:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L This PR changes 100-499 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants