Skip to content
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

Merged
merged 8 commits into from
Feb 3, 2021

Conversation

Gusinuhe
Copy link
Contributor

@Gusinuhe Gusinuhe commented Feb 3, 2021

Description

This PR generates a new [XR_Setup_Simulator] (if it does not exist) and place it in the XR 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

  • New feature (non-breaking change which adds functionality)

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 multiple Trainees.

Editor/SceneSetup/XRSimulatorImporter.cs Outdated Show resolved Hide resolved
Runtime/Rigs/XRSimulatorSetup.cs Outdated Show resolved Hide resolved
internal class XRSimulatorImporter
{
public string SimulatorRigPath = null;
public string SimulatorPathKey = null;
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the PathKey?

Copy link
Contributor Author

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);
Copy link
Contributor

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?

Copy link
Contributor Author

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)
Copy link
Contributor

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

Copy link
Contributor Author

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.

Editor/SceneSetup/XRSimulatorImporter.cs Outdated Show resolved Hide resolved
Co-authored-by: Thomas W. <tomwim@users.noreply.github.com>
@tomwim
Copy link
Contributor

tomwim commented Feb 3, 2021

Simulator as shitty to use as always, but I am able to use it :D

@Gusinuhe Gusinuhe requested a review from tomwim February 3, 2021 16:41
@Gusinuhe Gusinuhe dismissed SimonTheSourcerer’s stale review February 3, 2021 17:14

This review is blocking the testing version, the changes are already addressed.

@Gusinuhe Gusinuhe merged commit e62af5d into develop Feb 3, 2021
@Gusinuhe Gusinuhe deleted the hotfix/add-simulator-to-xr-rig-list-TRNG-1398 branch February 3, 2021 17:15
@ci-innoactive
Copy link
Collaborator

🎉 This PR is included in version 1.7.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants