-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add simulator to xr rig list TRNG-1398 #82
Add simulator to xr rig list TRNG-1398 #82
Conversation
internal class XRSimulatorImporter | ||
{ | ||
public string SimulatorRigPath = null; | ||
public string SimulatorPathKey = null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the PathKey?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is a key used to save and retrieve the path to the XR Rig Simulator prefab in EditorPrefs
.
simulator.transform.SetParent(actionRig.transform); | ||
GameObject prefab = PrefabUtility.SaveAsPrefabAsset(actionRig, simulatorRigPath); | ||
|
||
EditorPrefs.SetString(SimulatorPathKey, simulatorRigPath); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Editor Prefs are for the editor not the project. Is this on purpose?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this only meant to use if the XR Simulator is not existing and the user sets a training scene from the innoactive menu.
string filter = $"t:Prefab {prefabName}"; | ||
string[] prefabsGUIDs = AssetDatabase.FindAssets(filter, new[] {$"Assets/{searchFolder}"}); | ||
|
||
foreach (string prefabGUID in prefabsGUIDs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this a foreach, when this loop is only used for one object anyway
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
potato, patata
I could just use a (Linq) First method but I would need to validate if the result is not null, I can do it if makes sense to keep it more transparent.
Simulator as shitty to use as always, but I am able to use it :D |
This review is blocking the testing version, the changes are already addressed.
🎉 This PR is included in version 1.7.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Description
This PR generates a new
[XR_Setup_Simulator]
(if it does not exist) and place it in theXR Interaction Component
´s Resources folder, it also enables a new dynamic XR Rig for the simulator and validates when can be used.Type of change
How Has This Been Tested?
Use the set up as a training scene and try the
XR Simulator
.Known issues
There might be error messages when importing the
[XR_Setup_Simulator]
:RuntimeConfgurator
is missing or there are multipleTrainees
.