feat: Method to Get wrapper from GameObject & option to not spawn prefab helper networked.#785
feat: Method to Get wrapper from GameObject & option to not spawn prefab helper networked.#785Saskyc wants to merge 8 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.
|
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. |
|
I accidentally clicked resolve on Yamatos changes it's not resolved and I remember what needs to be changed |
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
left a comment
There was a problem hiding this comment.
with master merged into pr the problem got solved
| /// <returns>Returns the <see cref="GameObject"/> instantied.</returns> | ||
| public static GameObject Spawn(PrefabType prefabType, Vector3 position = default, Quaternion? rotation = null) | ||
| // TOOD: Only keep this method for Exiled 10 | ||
| public static GameObject Spawn(PrefabType prefabType, Vector3 position /*= default*/, Quaternion? rotation /*= null*/, bool spawn /*= true*/) |
There was a problem hiding this comment.
nvm, didn't see new param
There was a problem hiding this comment.
nvm nvm, didn't see the method re-added. I'm gonna commit some changes though
Someone-193
left a comment
There was a problem hiding this comment.
Considering I just pushed what I think the PR should be like, of course I'd approve it :P
Do keep in mind that this PR should technically not be merged until the poll I made for this fully finishes, but it's currently 33 to 7 so I figured I'd push my changes anyways
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