feat: Method to Get wrapper from GameObject & option to not spawn prefab helper networked.#785
Open
Saskyc wants to merge 7 commits into
Open
feat: Method to Get wrapper from GameObject & option to not spawn prefab helper networked.#785Saskyc wants to merge 7 commits into
Saskyc wants to merge 7 commits into
Conversation
Camera.cs changes: New method to get camera from GameObject and TryGet method with it. PrefabHelper.cs changes: Simple bool defining if prefab should be spawned by server or not. AdminToy.cs changes: Method to Get AdminToy by GameObject, which basically just gets the component. It's there to make lives of developers easier.
Author
|
This is my first Pull Request for Exiled if there are any issues let me know. I should be able to answer within a day or two max. |
louis1706
requested changes
Mar 26, 2026
Comment on lines
+278
to
+293
| /// <summary> | ||
| /// Gets the <see cref="Camera"/> belonging to the <see cref="GameObject"/>, if any. | ||
| /// </summary> | ||
| /// <param name="gameObject">The <see cref="GameObject"/> of the camera.</param> | ||
| /// <returns>A <see cref="Camera"/> or <see langword="null"/> if not found.</returns> | ||
| public static Camera Get(GameObject gameObject) | ||
| { | ||
| foreach (Scp079InteractableBase scp079InteractableBase in Scp079InteractableBase.AllInstances) | ||
| { | ||
| if (scp079InteractableBase.gameObject == gameObject) | ||
| return Get((Scp079Camera)scp079InteractableBase); | ||
| } | ||
|
|
||
| return null; | ||
| } | ||
|
|
There was a problem hiding this comment.
you better have to use Camera.List
technically we do .GetComponent() but true that slow compared to a loop
Author
There was a problem hiding this comment.
Changed to Camera.List, went through all checks, relolved.
Author
|
I accidentally clicked resolve on Yamatos changes it's not resolved and I remember what needs to be changed |
Someone-193
requested changes
Mar 28, 2026
louis1706
approved these changes
Jul 9, 2026
louis1706
requested changes
Jul 9, 2026
louis1706
left a comment
There was a problem hiding this comment.
My bad my previous comment wasn't right for Camera.List we are forced to go with .GetComponent() even if it's slower
louis1706
approved these changes
Jul 9, 2026
louis1706
left a comment
There was a problem hiding this comment.
with master merged into pr the problem got solved
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Describe the changes
Adds methods to Get/TryGet Camera and AdminToy directly from GameObject.
Adds boolean paramater to Method PrefabHelper.Spawn that's set defaultly to true, which specified if prefab should use NetworkServer.Spawn or not.
What is the current behavior? (You can also link to an open issue here): No methods that get X wrapper from GameObject.
What is the new behavior? (if this is a feature change): Method that get X wrapper from GameObject.
Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?): No breaking changes are in this PR.
Other information: X
Types of changes
Submission checklist
Patches (if there are any changes related to Harmony patches)
Other