0.35.0 • Published 1 year ago

com.magnopus.olympus.foundation.unity v0.35.0

Weekly downloads
-
License
UNLICENSED
Repository
github
Last release
1 year ago

Olympus Foundation Unity

A package for wrapping the Olympus Foundation C++ code with C# code to be used in Unity. This package should be every front end unity facing client's go-to for hitting backend endpoints. It wraps other magnopus packages (like Olympus Foundation) such that our clients will not have to include any using statements from those packages. The goal is to simplify and unite all backend calls into one easy to use package.

Authors

Developers

  • Chris chris.chavira@magnopus.com
  • Dylan dylan.markowitz@magnopus.com

Scrum Master

  • Bailin sarah.bailin@magnopus.com

PO

  • Harvey brandon.harvey@magnopus.com

Changelog

Link to Changelog

Current Goals

  • Create Samples for Multiplayer Connection: Ticket

Dependencies

Unity version 2020.3.33f1

Coding Standards

  • TODOs: format "TODO: link to JIRA ticket short description/summary of the issue
  • Use var when explicit

Package Versioning

We roughly follow semantic versioning.
The idea is that while the package is in pre-release mode / the version is still less than 1.0.0 (official release), then the version may change based off our own reasons which I will note. This is based off Sem Ver's 4th point,
"Major version zero (0.y.z) is for initial development. Anything MAY change at any time. The public API SHOULD NOT be considered stable."

In this state, we will increment the Minor version number when we would normally increment a Major version, a new feature is added, or a breaking change is made either within this package or from the Foundation package we wrap. Because we wrap the Foundation, it is possible that not every breaking change that is made within their package is guaranteed a breaking change for us. That will be up to the developer who updates the Foundation version to discuss with the code reviewer. The Minor version should be updated only if there were bug fixes to this package or if only bug fixes were included in the Foundation version update.

When we officially release version 1.0.0, we will follow semantic versioning rules more strictly:
"Version 1.0.0 defines the public API. The way in which the version number is incremented after this release is dependent on this public API and how it changes."

At this state, we will have to determine when breaking changes / backwards incompatible changes are made from the Foundation package to decide how to update the semantic versioning for this package.

Relative Links

Known Issues

  • Asset API - UploadAssetDataWithFilePathAsync Unity crashes if given a bad file path Ticket
  • Spaces API - DeleteSpaceAsync endpoint will never return a result if non-valid Id is passed in Ticket - GetSpacesByIdsAsync bson Id validation not working properly on passed in Id value Ticket - MigrateVersion2SpaceAsync bson Id validation not working properly on passed in Id value Ticket - UpdateSpaceThumbnail endpoint crashes Unity if given a bad file path Ticket
  • POI API - GetPOIsInAreaAsync Endpoint produces a 500 error if radius is less than zero Ticket
  • Anchor API - GetAnchorsInAreaAsync Endpoint produces a 500 error if radius is less than zero Ticket

Publish a New Version of the Package

Steps:

  • Create a new branch
  • Update the version in the package.json
  • Update the package.json in the Samples to match
  • Update the Changelog
  • Make sure all of our tests run and succeed, including the integration tests
  • Create a Merge Request on Github
  • Get the Merge Request reviewed and merged in
  • Push a tag onto dev following the format "v#.#.#" (just like all the other tags)
  • Check TeamCity to make sure it kicked off the build on the tag: TeamCity link
    • You can manually kick off a build in TeamCity if it doesn't do so automatically after a few minutes. It might have to build latest dev before it starts building the tag branch for publish.
    • To manually kick it off, Click the triple dots next to "Run" in TeamCity, then switch to the "Changes" tab and change the "Build branch" to the tag.
  • Make sure the TeamCity build succeeds. It will run all of our tests, including integration tests and they must succeed before it will publish.

Samples

Working on Samples in the Repo:

Samples are located in the root folder under "Samples~" and can be accessed in Unity by pointing the Unity Hub to open "Foundation.Unity~". When open, you will see the folder "com.magnopus.olympus.foundation.unity.samples" under the "Packages" folder. When we update the package version, we also update the version of the samples to match.

Using Samples in a Unity Project:

Use Unity's Package Manager window to import the samples into unity. When imported into a unity project, you will see the folder "Samples/com.magnopus.olympus.foundation.unity/#.#.#(the version)/name of sample" under the "Assets" folder. Each sample has a unity scene used to run the sample (name of sampleSample/Content/Scenes/name of sampleScene.Unity). Some samples depend on the other samples being in the project. The biggest example to note is that all samples rely on the "LoginSample" for its login menu prefab. The other sample dependencies will be listed in their appropriate section (below).

Login Sample

This sample lets you login using various endpoints. Note that the "Switch Modes" button loops between 3 different types of login.

alt text

  • Login with email and password:
    • Insert your email and password into the appropriate input fields
    • Click "Login"
  • Login with username and password:
    • Click the "Switch Modes" button once
    • Insert your username and password into the appropriate input fields
    • Click "Login"
  • Login with key and user Id:
    • Click the "Switch Modes" button twice
    • Insert your key and user Id into the appropriate input fields
    • Click "Login"
  • Login as a guest:
    • Click the "Login As Guest" button
  • Create a new account:
    • Click the "Create New Account" button
    • Insert your username, email, and password into the appropriate fields
    • Click "Create"
  • Logout:
    • Login using one of the methods above
    • Click the "Logout" button

Dependencies

  • Projnet: Login Sample holds a file for other samples: used for converting from Lat,Lon to Unity

Anchors Sample

This sample lets you view and delete anchors. For simplicity, the background image is set to the Magnopus US office and doesn't move. If you don't enter a Latitude or Longitude, the Magnopus US office location will be inserted for you.

alt text

  • Radius search for anchors:
    • Login
    • Enter the Latitude, Longitude, and Radius you desire
    • Click "Search"
  • Search anchor by Id:
    • Login
    • Click the "Mode" button to toggle modes
    • Enter the Latitude, Longitude, and GCA ID you desire
    • Click "Search"
  • View data:
    • Search for Anchor
    • Click on one of the red dots on the screen
    • View the data
    • "X" button to close
    • or "Delete" button to delete the Anchor

Dependencies

  • Login Sample
  • Projnet: for using Latitude and Longitude data in Unity

Points of Interest Sample

This sample lets you view and delete Points of Interest(POI). For simplicity, the background image is set to the Magnopus US office and doesn't move. If you don't enter a Latitude or Longitude, the Magnopus US office location will be inserted for you.

alt text
alt text

  • Radius search for anchors:
    • Login
    • Enter the Latitude, Longitude, and Radius you desire
    • Click "Search"
  • Search anchor by Title:
    • Login
    • Click the "Mode" button to toggle modes
    • Enter the Latitude, Longitude, and Title you desire
    • Click "Search"
  • View data:
    • Search for POI
    • Click on one of the red dots on the screen
    • View the data
    • "X" button to close
    • or "Delete" button to delete the POI

Dependencies

  • Login Sample
  • Projnet: for using Latitude and Longitude data in Unity

Spaces Sample

This sample lets you create, join, delete, and invite users to spaces.

alt text

  • Create a space:
    • Login
    • Enter a name and description to the appropriate fields
    • Click "Create"
  • Join a space:
    • Login
    • A scrollable list of spaces should be shown at the top, click "Join" on the space you want
  • Leave a space:
    • Join a space
    • Click the "Leave Space" button
  • Delete a space:
    • Login
    • Click the "Delete" button in the top right of a space shown in the scrollable list
    • Only works if you are the owner of the space
  • Invite a user to a space:
    • Login
    • Enter the email of user you want to invite
    • Enter the space name you want to invite the user to
    • Click "Invite"

Dependencies

  • Login Sample

Assets Sample

This sample lets you view data on assets within a space.

alt text

  • View information on an Asset:
    • Login
    • Click "Join" on a space
    • Click on an icon in the "Asset Collections" view
    • View the info

Dependencies

  • Login Sample
  • Spaces Sample

Multiplayer Sample

This sample is currently work in progress, it is not working at the moment and has some bugs: SpaceEntity RealOnUpdate throws exception MPV2 component type casting

This sample lets you connect to another player in a space and see each other move. The local player is represented by an orange cube and the remote players are represented by purple cubes. Use "WASD" to move.

W for upward\ S for downward\ A for left\ D for right

alt text

  • Join a player:
    • Login
    • Click "Join" on a space
    • Do the same for another player
    • See the other player
    • Move around and see each other move

Dependencies

  • Login Sample
  • Spaces Sample