Skip to content
This repository has been archived by the owner on Aug 11, 2024. It is now read-only.

Feature - Platform System #416

Merged
merged 53 commits into from
Apr 1, 2020
Merged

Feature - Platform System #416

merged 53 commits into from
Apr 1, 2020

Conversation

StephenHodgson
Copy link
Contributor

@StephenHodgson StephenHodgson commented Dec 16, 2019

Added required classes, profiles, and inspectors

XRTK - Mixed Reality Toolkit Change Request

Overview

The platform system aims to solve the problems we're having with multiple build targets on a single hardware platform.

Target of the change:

Is this enhancement for:

  • Core (core framework, interfaces and definitions)

Changes

Added required classes, profiles, and inspectors
@StephenHodgson StephenHodgson added Enhancement New feature or request In Progress PR currently still being developed labels Dec 16, 2019
@StephenHodgson
Copy link
Contributor Author

Looks like the Unit Tests didn't like this change. Gotta look into that later.

@SimonDarksideJ
Copy link
Contributor

Seems fair, but not clear on how a platform declares itself yet

@StephenHodgson
Copy link
Contributor Author

Seems fair, but not clear on how a platform declares itself yet

Getting there, ideally I think we want each upm package to register itself automagically when it's included/imported

@SimonDarksideJ
Copy link
Contributor

That I agree with, however we do need at least one example to compare, I'd prefer it to be Android based but Standalone should be sufficient to test

@StephenHodgson StephenHodgson changed the title Introduction of the Platform System Feature - Platform System Jan 6, 2020
@StephenHodgson StephenHodgson marked this pull request as ready for review March 31, 2020 15:04
@StephenHodgson StephenHodgson added Ready for review PR finished primary development, open for review and removed In Progress PR currently still being developed labels Mar 31, 2020
@StephenHodgson StephenHodgson requested a review from FejZa March 31, 2020 18:53
Copy link
Contributor

@FejZa FejZa left a comment

Choose a reason for hiding this comment

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

Changes look good to me. Honestly it currently mostly looks like a different approach to the enum based SupportedPlatforms implementation that XRTK had so far. I can definitely see how it's adding way more flexibility though.

private SupportedPlatforms runtimePlatform;
private RuntimePlatformEntry platformEntries = new RuntimePlatformEntry();

[NonSerialized]
Copy link
Contributor

Choose a reason for hiding this comment

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

Private fields are non serialized by default, aren't they?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Correct, but the object value doesn't get cleared when the editor recompiles and leaves the last object value from the prev domain reload event. Adding the NonSerialized attribute here makes sure that value is cleared on each domain reload.

/// <summary>
/// Used by the XRTK to signal that the feature is available on the Android platform.
/// </summary>
public class AndroidPlatform : BasePlatform
Copy link
Contributor

Choose a reason for hiding this comment

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

I see AndroidPlatform is defined in Core but LuminPlatform in the Lumin module. Wouldn't it make sense to define all the possible XRTK platforms in Core?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's actually the benefit of this change so we don't have to define everything in the core

/// <summary>
/// Used by the XRTK to signal that the feature is available on the iOS platform.
/// </summary>
public class IOSPlatform : BasePlatform
Copy link
Contributor

Choose a reason for hiding this comment

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

See comment above. It's kind of random that most platforms are defined in Core and some not.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We might move these out as we get platform specific sdks. I thought it was fine for now since we don't have an iOS submodule

@StephenHodgson StephenHodgson merged commit 6f67d23 into development Apr 1, 2020
@StephenHodgson StephenHodgson deleted the feature/platforms branch April 1, 2020 14:53
XRTK-Build-Bot pushed a commit that referenced this pull request Apr 1, 2020
* First pass at Platform System

Added required classes, profiles, and inspectors

* revert the active profile null check in the static accessors

* Fixed unit tests

* fixed inspector for platform system profile

* Made the platform profile abstract and to be used as a base profile

updated the naming of the properties in platform configuration

* updated namespaces a bit

* Added editor, osx, and windows standalone platform definitions

* Removed the SupportedPlatforms enum from the platform configuration

* Fixed compiler error

* updated sdk checkout

* updated sdk

* some changes to auto registration

* updated tests to support existing systems/services setup by the toolkit

* Renamed IMixedRealityPlatform.IsActive to IMixedRealityPlatform.IsAvailable

* Added the android platform data provider

* Added IOS platform data provider

* Added ability to get active platforms from platform system

* Added a base platform class

* better sorting of registered platform configurations

* rolled back obsolete flag for now until I've figured out a better replacement path

* Finalized platform feature

* bumped version numbers

* Apply suggestions from code review
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Breaking Change Enhancement New feature or request Ready for review PR finished primary development, open for review
Projects
None yet
3 participants