Merge remote-tracking branch 'remotes/origin/development' into mars-volume-queries

# Conflicts:
#	.gitmodules
#	Interfaces/Subscribers/IUsesSpatialHash.cs
#	Runtime/Scripts/Core/EditorXRDirectSelectionModule.cs
#	Runtime/Scripts/Core/EditorXRMiniWorldModule.cs
#	Runtime/Scripts/Core/EditorXRViewerModule.cs
#	Runtime/Scripts/Core/Interfaces/IDelayedInitializationModule.cs
#	Runtime/Scripts/Data/SpatialHash.cs
#	Runtime/Scripts/Extensions/BoundsExtensions.cs
#	Runtime/Scripts/Extensions/Vector2Extensions.cs
#	Runtime/Scripts/Extensions/Vector3Extensions.cs
#	Runtime/Scripts/Modules/HierarchyModule.cs
#	Runtime/Scripts/Modules/IntersectionModule/IntersectionModule.cs
#	Runtime/Scripts/Modules/IntersectionModule/IntersectionTester.cs
#	Runtime/Scripts/Modules/IntersectionModule/IntersectionUtils.cs
#	Runtime/Scripts/Modules/ProjectFolderModule.cs
#	Runtime/Scripts/Modules/SerializedPreferencesModule.cs
#	Runtime/Scripts/Modules/SpatialHashModule.cs
#	Runtime/Scripts/UI/CuboidLayout.cs
#	Runtime/Scripts/UI/UITransformCopy.cs
#	Runtime/libs/UnityOctree
#	Tests/Editor/Unit/Extension Methods/Vec2ExtensionsTests.cs
#	Tests/Editor/Unit/Extension Methods/Vec3ExtensionsTests.cs
This commit is contained in:
Matt Schoen 2020-01-04 21:08:38 -08:00
Родитель 6f45c6fa2d b98f8deb3c
Коммит b30354fc9f
869 изменённых файлов: 123577 добавлений и 113996 удалений

2
.gitignore поставляемый
Просмотреть файл

@ -10,3 +10,5 @@ npm-debug.log
build.sh.meta
build.bat.meta
.idea/
.Editor
upm-ci~

3
.gitmodules поставляемый
Просмотреть файл

@ -2,6 +2,3 @@
path = Runtime/libs/input-prototype
url=https://github.com/Unity-Technologies/input-prototype.git
branch = editorvr/main
[submodule "Runtime/libs/VRLineRenderer"]
path = Runtime/libs/VRLineRenderer
url = https://github.com/Unity-Technologies/VRLineRenderer

Просмотреть файл

@ -17,3 +17,10 @@ build.sh
build.sh.meta
build.bat
build.bat.meta
upm-ci~/**
.Editor/**
.yamato/**
*.zip*
TestRunnerOptions.json
.idea/**

84
.yamato/base.yml Normal file
Просмотреть файл

@ -0,0 +1,84 @@
# This template is the base template required to exist for all other templates to work
# It has some common jobs shared between all the templates provided.
# Required CI templates: none
# When using the template for setting up a yamato job, please include the following disclaimer:
#_________________________________________________
# If you make changes to this file, please consider making a PR to the templating repo!
# Please find the source file here: https://github.cds.internal.unity3d.com/unity/yamato-ci-templates/blob/master/.yamato/base.yml
# VERSION 1
#_________________________________________________
# Configuration #######################################
######################################################
# Avoid tampering with stuff below here if you can
{% metadata_file .yamato/template-config.yml %}
template_environment_variables:
# Do not touch
JOB_TEMPLATE_VERSION: 1
---
{% for platform in platforms %}
{% for editor in editors %}
editor:priming:{{ editor.version }}:{{ platform.os }}:
name: "[{{ editor.version }},{{ platform.os }}] Editor priming"
agent:
type: Unity::VM
image: 'cds-ops/ubuntu-16.04-base:stable'
flavor: b1.small
variables:
PATH: /home/bokken/bin:/home/bokken/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/sbin:/home/bokken/.npm-global/bin
DISPLAY: ":0"
{% for v in template_environment_variables %}
{{ v[0] }}: {{ v[1]}}
{% endfor %}
commands:
- pip install unity-downloader-cli --upgrade --extra-index-url https://artifactory.eu-cph-1.unityops.net/api/pypi/common-python/simple
- >
unity-downloader-cli
-u {{ editor.version }}
-o {{ platform.os }}
--wait
--skip-download
{% for component in platform.components -%}
-c {{ component }}
{% endfor -%}
> unity_revision.txt
artifacts:
unity_revision.zip:
paths:
- "unity_revision.txt"
{% endfor -%}
{% for test in testables %}
editor:priming:{{ test.name }}:{{ platform.os }}:
name: "[{{ test.name }},{{ platform.os }}] Editor priming"
agent:
type: Unity::VM
image: 'cds-ops/ubuntu-16.04-base:stable'
flavor: b1.small
variables:
PATH: /home/bokken/bin:/home/bokken/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/sbin:/home/bokken/.npm-global/bin
DISPLAY: ":0"
{% for v in template_environment_variables %}
{{ v[0] }}: {{ v[1]}}
{% endfor %}
commands:
- pip install unity-downloader-cli --upgrade --extra-index-url https://artifactory.eu-cph-1.unityops.net/api/pypi/common-python/simple
- >
unity-downloader-cli
-u {{ test.path }}
-o {{ platform.os }}
--wait
--skip-download
{% for component in platform.components -%}
-c {{ component }}
{% endfor -%}
> unity_revision.txt
artifacts:
unity_revision.zip:
paths:
- "unity_revision.txt"
{% endfor -%} # testables
{% endfor %}

Просмотреть файл

@ -1 +0,0 @@
Please refer to https://github.cds.internal.unity3d.com/unity/upm-ci-yamato-templates

134
.yamato/package-publish.yml Normal file
Просмотреть файл

@ -0,0 +1,134 @@
# This template contains all package publishing jobs to candidates, including nightly auto-publishing
{% metadata_file .yamato/template-config.yml %}
template_environment_variables:
# Do not touch
JOB_TEMPLATE_VERSION: 1
scripting_backends:
images:
windows:
type: Unity::VM
image: package-ci/win10:stable
flavor: b1.large
linux:
type: Unity::VM
image: package-ci/ubuntu:stable
flavor: b1.large
---
auto-version:
name: "Auto version"
agent:
type: {{ images.linux.type }}
image: {{ images.linux.image }}
flavor: {{ images.linux.flavor }}
variables:
PATH: /home/bokken/bin:/home/bokken/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/sbin:/home/bokken/.npm-global/bin
DISPLAY: ":0"
{% for v in template_environment_variables -%}
{{ v[0] }}: {{ v[1]}}
{% endfor -%}
commands:
- npm install git+ssh://git@github.cds.internal.unity3d.com/unity/upm-ci-utils#auto-publish -g --@upm:registry=https://artifactory.internal.unity3d.com/api/npm/upm-service-npm
- >
upm-ci auto-version bump
{% for test in testables -%}
--{{ test.type }}-path {{ test.path }}
{% endfor -%}
- upm-ci auto-version commit --push
artifacts:
packages:
paths:
- "upm-ci~/**/*"
{% if publishing.auto_version == "true" -%}
triggers:
branches:
only:
- "{{ repo.branches.integration }}"
{% endif -%}
{% if extra_jobs.pre -%}
dependencies:
{% for prebuild in extra_jobs.pre -%}
- {{ prebuild }}
{% endfor -%}
{% endif -%}
{% for test in testables -%}
{% if test.publish_source == "true" -%}
publish:{{ test.name }}:
name: "[{{ test.name }}] Candidates Publish"
agent:
type: {{ images.windows.type }}
image: {{ images.windows.image }}
flavor: {{ images.windows.flavor }}
variables:
{% for v in template_environment_variables %}
{{ v[0] }}: {{ v[1]}}
{% endfor %}
commands:
- npm install upm-ci-utils@stable --registry https://api.bintray.com/npm/unity/unity-npm -g
- >
upm-ci {{ test.type }} publish
{% if test.type == "template" -%}
--project-path {{ test.path }}
{% else -%}
--{{ test.type }}-path {{ test.path }}
{% endif -%}
artifacts:
packages:
paths:
- "upm-ci~/packages/*.tgz"
{% if publishing.auto_publish == "true" -%}
triggers:
recurring:
- branch: "{{ repo.branches.integration }}"
frequency: daily
{% endif -%}
dependencies:
{% for testing in extra_jobs.testing -%}
- {{ testing }}
{% endfor -%}
{% if test.publish_source -%}
- .yamato/package-test.yml#pack:{{ test.name }}
{% endif -%}
{% for editor in editors -%}
{% for platform in platforms -%}
- .yamato/package-test.yml#{{ test.name }}:{{ platform.os }}:{{ editor.version }}
# Disabled for linux since it requires GPUs
{% if platform.os != "linux" -%}
{% if test.standalone == "true" -%}
{% for backend in scripting_backends -%}
- .yamato/package-test.yml#{{ test.name }}:{{ platform.os }}:{{ editor.version }}:standalone:{{ backend }}
{% endfor -%}
{% endif -%} # test.standalone
{% endif -%} # platform.os
{% endfor -%}
{% endfor -%}
{% endif -%} # publish_source
{% endfor -%}
{% for test in testables -%}
{% if test.publish_source == "true" and test.type != "template" -%}
promote:{{ test.name }}:
name: "[{{ test.name }}] Production Promote"
agent:
type: {{ images.windows.type }}
image: {{ images.windows.image }}
flavor: {{ images.windows.flavor }}
variables:
UPMCI_PROMOTION: 1
commands:
- npm install upm-ci-utils@stable -g --registry https://api.bintray.com/npm/unity/unity-npm
- >
upm-ci {{ test.type }} promote
--{{ test.type }}-path {{ test.path }}
artifacts:
packages:
paths:
- "upm-ci~/packages/*.tgz"
dependencies:
- .yamato/package-test.yml#pack:{{ test.name }}
- .yamato/package-test.yml#promotion:test:trigger:{{ test.name }}
{% endif -%} # publish_source
{% endfor %}

378
.yamato/package-test.yml Normal file
Просмотреть файл

@ -0,0 +1,378 @@
# This template contains all package validation
# Required CI templates:
# - base.yml
# When using the template for setting up a yamato job, please include the following disclaimer:
#_________________________________________________
# If you make changes to this file, please consider making a PR to the templating repo!
# Please find the source file here: https://github.cds.internal.unity3d.com/unity/yamato-ci-templates/blob/master/.yamato/package-test.yml
# VERSION 2
#_________________________________________________
######################################################
# Avoid tampering with stuff below here if you can
{% metadata_file .yamato/template-config.yml %}
template_environment_variables:
# Do not touch
JOB_TEMPLATE_VERSION: 2
images:
windows:
type: Unity::VM
image: package-ci/win10:stable
flavor: b1.large
linux:
type: Unity::VM
image: package-ci/ubuntu:stable
flavor: b1.large
macos:
type: Unity::VM::osx
image: buildfarm/mac:stable
flavor: m1.mac
scripting_backends:
---
{% for test in testables %}
{% for platform in platforms %}
{% for editor in editors %}
{% if test.standalone == "true" -%}
# Standalone tests
# Disabled for linux since it requires GPUs
{% if platform.os != "linux" -%}
{% for backend in scripting_backends %}
{{ test.name }}:{{ platform.os }}:{{ editor.version }}:standalone:{{ backend }}:
name: "[{{ backend }},{{ test.name }},{{ editor.version }},{{ platform.os }}] Test Standalone"
agent:
type: {{ images[platform.os].type }}
image: {{ images[platform.os].image }}
flavor: {{ images[platform.os].flavor }}
variables:
{% if platform.os == "linux" -%}
PATH: /home/bokken/bin:/home/bokken/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/sbin:/home/bokken/.npm-global/bin
DISPLAY: ":0"
{% endif -%}
{% for v in template_environment_variables -%}
{{ v[0] }}: {{ v[1]}}
{% endfor -%}
commands:
- pip install unity-downloader-cli --upgrade --extra-index-url https://artifactory.eu-cph-1.unityops.net/api/pypi/common-python/simple
- npm install upm-ci-utils@stable --registry https://api.bintray.com/npm/unity/unity-npm -g
- unity-downloader-cli --source-file unity_revision.txt {% for component in platform.components %}-c {{ component }} {% endfor %}--wait --published-only
# TODO: upm-ci needs to support scripting backends
- >
upm-ci
{{ test.type }}
test
-u .Editor
{% if test.type == "template" -%}
--project-path {{ test.path }}
{% else -%}
--{{ test.type }}-path {{ test.path }}
{% endif -%}
--platform standalone
artifacts:
logs.zip:
paths:
- "upm-ci~/test-results/**/*"
dependencies:
- .yamato/base.yml#editor:priming:{{ editor.version }}:{{ platform.os }}
- .yamato/package-test.yml#pack:{{ test.name }}
{% for prebuild in extra_jobs.pre -%}
- {{ prebuild }}
{% endfor -%}
{% endfor %} # scripting_backends
{% endif %} # platform.os
{% endif %} # test.standalone
{{ test.name }}:{{ platform.os }}:{{ editor.version }}:
name : "[{{ test.name }},{{ platform.os }},{{ editor.version }}] Test"
agent:
type: {{ images[platform.os].type }}
image: {{ images[platform.os].image }}
flavor: {{ images[platform.os].flavor }}
variables:
{% if platform.os == "linux" -%}
PATH: /home/bokken/bin:/home/bokken/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/sbin:/home/bokken/.npm-global/bin
DISPLAY: ":0"
{% endif -%}
{% for v in template_environment_variables -%}
{{ v[0] }}: {{ v[1]}}
{% endfor -%}
commands:
- pip install unity-downloader-cli --upgrade --extra-index-url https://artifactory.eu-cph-1.unityops.net/api/pypi/common-python/simple
- npm install upm-ci-utils@stable --registry https://api.bintray.com/npm/unity/unity-npm -g
- unity-downloader-cli --source-file unity_revision.txt {% for component in platform.components %}-c {{ component }} {% endfor %}--wait --published-only
- >
upm-ci
{{ test.type }}
test
-u .Editor
{% if test.type == "template" -%}
--project-path {{ test.path }}
{% else -%}
--{{ test.type }}-path {{ test.path }}
{% endif -%}
{% if test.standalone == "false" -%}
--platform editmode
{% endif -%}
artifacts:
logs.zip:
paths:
- "upm-ci~/test-results/**/*"
dependencies:
- .yamato/base.yml#editor:priming:{{ editor.version }}:{{ platform.os }}
- .yamato/package-test.yml#pack:{{ test.name }}
{% for prebuild in extra_jobs.pre -%}
- {{ prebuild }}
{% endfor -%}
{% endfor %}
{{ test.name }}:{{ platform.os }}:{{ test.type }}:
name : "[{{ test.name }},{{ platform.os }},{{ test.type }}] Test"
agent:
type: {{ images[platform.os].type }}
image: {{ images[platform.os].image }}
flavor: {{ images[platform.os].flavor }}
variables:
{% if platform.os == "linux" -%}
PATH: /home/bokken/bin:/home/bokken/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/sbin:/home/bokken/.npm-global/bin
DISPLAY: ":0"
{% endif -%}
{% for v in template_environment_variables -%}
{{ v[0] }}: {{ v[1]}}
{% endfor -%}
commands:
- pip install unity-downloader-cli --upgrade --extra-index-url https://artifactory.eu-cph-1.unityops.net/api/pypi/common-python/simple
- npm install upm-ci-utils@stable --registry https://api.bintray.com/npm/unity/unity-npm -g
- unity-downloader-cli --source-file unity_revision.txt {% for component in platform.components %}-c {{ component }} {% endfor %}--wait --published-only
- >
upm-ci
{{ test.type }}
test
-u .Editor
{% if test.type == "template" -%}
--project-path {{ test.path }}
{% else -%}
--{{ test.type }}-path {{ test.path }}
{% endif -%}
{% if test.standalone == "false" -%}
--platform editmode
{% endif -%}
artifacts:
logs.zip:
paths:
- "upm-ci~/test-results/**/*"
dependencies:
- .yamato/base.yml#editor:priming:{{ test.name }}:{{ platform.os }}
- .yamato/package-test.yml#pack:{{ test.name }}
{% for prebuild in extra_jobs.pre -%}
- {{ prebuild }}
{% endfor -%}
{% endfor %}
{% endfor %}
{% for test in testables %}
pack:{{ test.name }}:
name: "[{{ test.name }}] Pack"
agent:
type: {{ images.linux.type }}
image: {{ images.linux.image }}
flavor: {{ images.linux.flavor }}
variables:
PATH: /home/bokken/bin:/home/bokken/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/sbin:/home/bokken/.npm-global/bin
DISPLAY: ":0"
{% for v in template_environment_variables -%}
{{ v[0] }}: {{ v[1]}}
{% endfor -%}
commands:
- git submodule update --init
- npm install git+ssh://git@github.cds.internal.unity3d.com/unity/upm-ci-utils#auto-publish -g --@upm:registry=https://artifactory.internal.unity3d.com/api/npm/upm-service-npm
{% if test.type == "project" or test.type == "template" %}
- upm-ci {{ test.type }} pack --project-path {{ test.path }}
{% elsif test.type == "package" %}
- upm-ci package pack --package-path {{ test.path }}
{% endif %}
artifacts:
packages:
paths:
- "upm-ci~/**/*"
{% if extra_jobs.pre -%}
dependencies:
{% for prebuild in extra_jobs.pre -%}
- {{ prebuild }}
{% endfor -%}
{% endif -%}
{% endfor %}
test_trigger:
name: Tests Trigger
agent:
type: Unity::VM
image: package-ci/win10:stable
flavor: b1.large
commands:
- npm install upm-ci-utils@stable -g --registry https://api.bintray.com/npm/unity/unity-npm
- upm-ci package izon --tests-complete
triggers:
branches:
only:
- /.*/
except:
- ^draft
dependencies:
{% for test in testables %}
{% for editor in editors %}
{% for platform in platforms %}
- .yamato/package-test.yml#{{ test.name }}:{{ platform.os }}:{{ editor.version }}
- .yamato/package-test.yml#{{ test.name }}:{{ platform.os }}:{{ test.type }}
{% endfor %}
{% endfor %}
{% endfor %}
{% for test in testables %}
{% for editor in editors %}
{% for platform in platforms %}
dependency:{{ test.name }}:{{ platform.os }}:{{ editor.version }}:
name : "[{{ editor.version }},{{ platform.os }}] Dependency Test"
agent:
type: {{ images[platform.os].type }}
image: {{ images[platform.os].image }}
flavor: {{ images[platform.os].flavor }}
variables:
{% if platform.os == "linux" -%}
PATH: /home/bokken/bin:/home/bokken/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/sbin:/home/bokken/.npm-global/bin
DISPLAY: ":0"
{% endif -%}
{% for v in template_environment_variables -%}
{{ v[0] }}: {{ v[1]}}
{% endfor -%}
commands:
- pip install unity-downloader-cli --upgrade --extra-index-url https://artifactory.eu-cph-1.unityops.net/api/pypi/common-python/simple
- unity-downloader-cli --source-file unity_revision.txt {% for component in platform.components %}-c {{ component }} {% endfor %}--wait --published-only
- npm install upm-ci-utils@stable -g --registry https://api.bintray.com/npm/unity/unity-npm
- >
upm-ci
{{ test.type }}
test
-u {{ editor.version }}
--type updated-dependencies-tests
{% if test.type == "template" -%}
--project-path {{ test.path }}
{% else -%}
--{{ test.type }}-path {{ test.path }}
{% endif -%}
artifacts:
logs:
paths:
- "upm-ci~/test-results/**/*"
triggers:
recurring:
- branch: master
frequency: 20 * * ?
dependencies:
- .yamato/package-test.yml#pack:{{ test.name }}
- .yamato/base.yml#editor:priming:{{ editor.version }}:{{ platform.os }}
{% for prebuild in extra_jobs.pre -%}
- {{ prebuild }}
{% endfor -%}
{% endfor %}
{% endfor %}
{% endfor %}
{% for test in testables %}
dependency:test:trigger:{{ test.name }}:
name: "[{{ test.name }}] Dependency Tests Trigger"
agent:
type: Unity::VM
image: package-ci/win10:stable
flavor: b1.large
variables:
{% for v in template_environment_variables -%}
{{ v[0] }}: {{ v[1]}}
{% endfor -%}
commands:
- npm install upm-ci-utils@stable -g --registry https://api.bintray.com/npm/unity/unity-npm
- upm-ci {{ test.type }} izon -d
triggers:
recurring:
- branch: master
frequency: 22 * * ?
dependencies:
- .yamato/package-test.yml#pack:{{ test.name }}
{% for prebuild in extra_jobs.pre -%}
- {{ prebuild }}
{% endfor -%}
{% for editor in editors %}
{% for platform in platforms %}
- .yamato/package-test.yml#dependency:{{ test.name }}:{{ platform.os }}:{{ editor.version }}
{% endfor %}
{% endfor %}
{% endfor %}
{% for test in testables %}
{% for editor in editors %}
{% for platform in platforms %}
promotion:test:{{ test.name }}:{{ platform.os }}:{{ editor.version }}:
name : "[{{ test.name }},{{ editor.version }},{{ platform.os }}] Promotion Test"
agent:
type: {{ images[platform.os].type }}
image: {{ images[platform.os].image }}
flavor: {{ images[platform.os].flavor }}
variables:
{% if platform.os == "linux" -%}
PATH: /home/bokken/bin:/home/bokken/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/sbin:/home/bokken/.npm-global/bin
DISPLAY: ":0"
{% endif -%}
{% for v in template_environment_variables -%}
{{ v[0] }}: {{ v[1]}}
{% endfor -%}
UPMCI_PROMOTION: 1
commands:
- pip install unity-downloader-cli --upgrade --extra-index-url https://artifactory.eu-cph-1.unityops.net/api/pypi/common-python/simple
- unity-downloader-cli --source-file unity_revision.txt {% for component in platform.components %}-c {{ component }} {% endfor %}--wait --published-only
- npm install upm-ci-utils@stable -g --registry https://api.bintray.com/npm/unity/unity-npm
- >
upm-ci
{{ test.type }}
test
-u {{ editor.version }}
--type updated-dependencies-tests
{% if test.type == "template" -%}
--project-path {{ test.path }}
{% else -%}
--{{ test.type }}-path {{ test.path }}
{% endif -%}
artifacts:
logs:
paths:
- "upm-ci~/test-results/**/*"
dependencies:
- .yamato/package-test.yml#pack:{{ test.name }}
- .yamato/base.yml#editor:priming:{{ editor.version }}:{{ platform.os }}
{% for prebuild in extra_jobs.pre -%}
- {{ prebuild }}
{% endfor -%}
{% endfor %}
{% endfor %}
{% endfor %}
{% for test in testables %}
promotion:test:trigger:{{ test.name }}:
name: "[{{ test.name }}] Promotion Tests Trigger"
agent:
type: Unity::VM
image: package-ci/win10:stable
flavor: b1.large
commands:
- npm install upm-ci-utils@stable -g --registry https://api.bintray.com/npm/unity/unity-npm
- upm-ci {{ test.type }} izon -d
dependencies:
- .yamato/package-test.yml#pack:{{ test.name }}
{% for editor in editors %}
{% for platform in platforms %}
- .yamato/package-test.yml#promotion:test:{{ test.name }}:{{ platform.os }}:{{ editor.version }}
{% endfor %}
{% endfor %}
{% endfor %}

Просмотреть файл

@ -0,0 +1,57 @@
# This file contains all the supported global configurations for the yamato-ci templates repo
# This is required by all templates
# When using the template for setting up a yamato job, please include the following disclaimer:
#_________________________________________________
# If you make structural changes to this file, please consider making a PR to the templating repo!
# Please find the source file here: https://github.cds.internal.unity3d.com/unity/yamato-ci-templates/blob/master/.yamato/template-config.yml
# VERSION 1
#_________________________________________________
editors:
# Add any versions or branches required for testing here
# This needs to be an exhaustive list of all potential versions used by all template jobs
# Make sure to include the very minimum explicit version that a package or project requires (eg. 2019.1.0f1)
- version: 2019.1
publishing:
auto_publish: false
auto_version: false
# Uncomment and add any yamato jobs here that are required for other jobs to be successful. Usually this means binary builds jobs or custom test jobs
# that need to run before package packaging and/or publishing can run
# extra_jobs:
# # Can be binary build jobs or extra validation jobs etc. This will run before the pack jobs so it will block all other jobs
# # so avoid adding long running jobs here and rather use testing_jobs for heavier stuff
# pre:
# - .yamato/myjobs.yml#extra:build:job
# # For extra jobs to run side-by-side with the regular package test jobs
# # Jobs listed here will be added as dependencies to things like publishing jobs etc.
# testing:
# - .yamato/myjobs.yml#extra:testing:job
repo:
branches:
# What the integration branch for the repo is (the branch where things need to land)
integration: development
platforms:
# Exhaustive list of operating systems and editor components used by all jobs so the preparation jobs
# can make sure all editors are cached on cheap vms before starting the heavy duty machines for running tests
- os: windows
components:
- editor
testables:
# Add any package and/or project folders here. If you add a package that is already covered in a project
# you will end up doing duplicate testing etc, so try to avoid overlap
# name: all generated jobs will have this string as a part of the name
# path: the path to where this testable exists relative to the root folder of the repo
# type: package or project
# publish_source: indicates if this testable should be included in publishing
# standalone: true/false for if this testable contains runtime code or if it's only editor code
- name: com.unity.labs.editorxr
path: .
type: package
publish_source: true
standalone: false

Просмотреть файл

@ -4,6 +4,21 @@ All notable changes to this package will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
## [0.4.1-preview] - 2020-01-03
Update dependencies and finalize package manager release
## [0.4.0-preview.3] - 2019-12-18
-- Clean up import warnings
-- Add dependencies on timeline and Text Mesh Pro
## [0.4.0-preview.2] - 2019-11-14
-- Fix settings menu issues
-- Fix ViewerScaleVisuals Line Renderer
## [0.4.0-preview.1] - 2019-12-08
-- Fixes related to immutable package exceptions
-- Upgrade to latest VRLineRenderer
## [0.4.0] - 2019-11-14
-- Refactor to use Module Loader package
-- Add package manifest, change structure to match package layout
@ -66,7 +81,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
-- Fast toolswapping via spatial workflow
Known issues:
-- Performance improvements are an ongoing priority
-- Console + profiler cant be resized
-- Console + profiler can<EFBFBD>t be resized
-- Single Pass Stereo + EXR is currently non-functional with Unity 2017.2 and .3
## [0.0.8] - 2017-10-01

Просмотреть файл

@ -0,0 +1,384 @@
# About EditorXR
Use the EditorXR package to create content directly in extended reality. EditorXR allows you to see things from the users perspective while accessing the full capabilities of the Unity Editor. EditorXR Runtime lets you build tools into your experiences and bring authoring workflows to AR-capable smartphones and beyond.
## Preview package
This package is available as a preview, so it is not ready for production use. The features and documentation in this package might change before it is verified for release.
## Installation
To install this package, follow the instructions in the [Package Manager documentation](https://docs.unity3d.com/Manual/upm-ui-install.html).
In addition, you need to to set up your default VR platform.
- First open Edit > Project Settings > Player.
- Be sure that Virtual Reality Supported is checked on, and if you want to use Oculus Rift + Touches, then Oculus must come first, before OpenVR.
## Requirements
This version of EditorXR is compatible with the following versions of the Unity Editor:
* 2018.4.12f1 and later (recommended)
## Known limitations
*_EditorXR version 1.0 includes the following known limitations:_*
* *_Undo/redo do not record all change history yet in the Radial Menu_*
* *_Toggles from the main menu are not yet supported (snap, locomotion type, etc)._*
* *_Other EditorXR menus and workspaces still draw above the Spatial Menu._*
* *_The MiniWorld doesnt show all types of objects or lighting for performance reasons._*
* *_You cannot grab small objects in the MiniWorld easily. If you cant grab something, try zooming in._*
* *_The MiniWorld currently does not work in Single Pass._*
* *_We need to tweak where objects instantiate in the Project Workspace._*
* *_The alphanumeric keyboard has not been enabled yet in the Inspector._*
* *_Performance improvements are an ongoing priority._*
* *_Console + profiler cant be resized._*
* *_Single Pass Stereo + EditorXR is currently non-functional._*
* *_Some actions can end up silently deleting the object to which you attach the EditingContextManager. For now, make sure it is attached to an empty object in your scene that is easy to recover._*
* *_Some 3rd party image-effects can cause Unity to crash when performing the image-effect copy operation._*
* *_Some copied camera settings will be overridden depending on the target platform._*
## Helpful links
If you are new to EditorXR, or have a question after reading the documentation, you can:
* Join our [support forum](https://forum.unity.com/forums/editorxr.126/).
* Follow us on [Twitter](http://www.twitter.com/unity3dlabs).
<a name="UsingPackageName"></a>
# Using EditorXR
To use EditorXR, go to ****Windows**** > ****EditorXR**** (or press Ctrl-E on your keyboard), then put on your headset. You might need to click the button ****Toggle Device View**** to have it show correctly in the headset.
* EditorXR Controller Guide.
- Vive Controller Guide.
![Vive Controller Guide.](images/vivecontrols.png)
- Oculus Controller Guide.
![Oculus Controller Guide](images/oculuscontrols.png)
* Main Menu.
- The Main Menu is accessed by selecting the ubiquitous Hamburger button at the bottom of each controller. To select the button, point at it with the controller in your other hand, and pull the trigger. This opens up a menu for the hand you are selecting with. Please note, some tools are single-handed.
![Main Menu](images/mainmenu.png)
![Main Menu](images/mainmenu.gif)
- The Main Menu is the 3D equivalent of the Unity menu bar: it allows you to access Tools, Workspaces, Settings, etc. in EditorXR.
- To open the Main Menu on either hand, activate the Unity button with the ray from the other hand by pulling on the primary trigger.
- Close the menu the same way: click the Hamburger button with the ray from the other hand.
- Swipe your thumb across the thumbad (Vive) or flick the joystick (Touch) to rotate the menus on the hand that has the menu.
- Scroll a window by pointing at it with the ray and using the thumbpad (Vive) or joystick (Touch) while over the menu.
- Some menu buttons can open sub-menus (e.g. snapping settings). Click on the title text to navigate back to the parent menu.
* Pinned Toolbar.
- The last tool you selected for a specific hand displays below the Unity button on your controller. If you have a tool active, navigate to the toolbar; here, you can hover over to the tool with the Selection Cone and push the [x] button to close it.
* Radial Menu.
- The radial menu appears when objects are selected, or certain actions can be taken. It is the equivalent of a 2D contextual menu.
- The radial menu hides when there is no object selected, so to get rid of it you would deselect by pointing the ray over empty space and pulling the trigger.
![Radial Menu](images/radialmenu.gif)
- Available actions in order from top to bottom with the latest version of EditorXR:
- Redo
- Clone
- Cut
- Copy
- Paste
- Delete
- Select Parent (move up hierarchy)
- Lock / Unlock
- Change Pivot (Center vs. Origin)
- Change Rotation Pivot (Local vs. Global)
- The radial menu contents change depending on what you have selected and what actions are available. The illustration here shows an example of two new buttons being added to the menu.
- The radial menu is selectable in two ways: by using the thumb pad or joystick, or by selecting with the ray on the other hand.
- When an item is locked, hover over the object for a few seconds until the radial menu comes back up and then select the unlock button. You can select and unlock objects using the Locked Objects workspace.
* Spatial Menu.
- One-handed menu control that is accessible independent of the user's viewpoint, or controller visibility.
- The Spatial Menu allows certain actions to be performed independent of the users viewpoint, without needing to utilize any of the other controller/hand-bound menus. This Spatial Menu will allow you access most tools, workspaces, and actions that EditorXR provides. The Spatial Menu was designed to obscure any content that would be in the users FOV while interacting with it.
- The Spatial Menu allows for multiple forms of input to drive it. The two core means of input that drive the Spatial Menu at this time are ray-based interaction, and thumbstick/trackpad based input.The Spatial Menu was designed to provide a foundation that can be extended to support gesture and other forms of input in the future.
- It is not necessary for the controller to be visible when opening & interacting with the Spatial Menu if using the thumbstick/trackpad form of input. Look anywhere, activate the menu, selection the menu element youd like, without needing to move your hand or head.
- Means of interaction:
- Ray-based interaction:
- A controller/proxy ray can be used to aim and select items in the Spatial Menu.
- Oculus Touch specific interaction:
- Hold “Up/Away” on the analog thumbstick to display the Spatial Menu.
- In order to highlight elements in the Spatial Menu do the following: while not releasing the thumbstick after holding up/away on the thumbstick, rotate the thumbstick in a circular manner in either direction.
- Vive specific interaction:
- Tap and hold at the top of the trackpad to display the Spatial Menu. Do not click the trackpad.
- In order to highlight elements in the Spatial Menu do the following: while not releasing the trackpad after tapping and holding at the top of the trackpad, scrub the outer edges of the trackpad in a circular manner in either direction.
- Common Interaction:
- Trigger will confirm the selection of the highlighted item.
- Grip will return to a previous Spatial Menu level, if the user has drilled down to a sub menu beyond the top-level of the Spatial Menu.
* Quick Tool Swap.
- If you have more than one tool added to one of your hands/controllers, you can quickly swap between your two most recently used tools by performing the following action:
- Hold the grip button, then quickly tap trigger, then again quickly release both buttons. If this action is performed in a second or less, your current tools will be swapped for the previously used tool on that hand/controller/proxy.
* Locomotion.
- Blink Locomotion
- Blink locomotion lets you quickly move around large spaces by pointing an arc where you want to go with the trigger. To enable Blink locomotion, navigate to the Settings pane of the Main Menu, and under the Locomotion Settings, ensure that Blink is enabled. To blink, use the Menu button on Vive, or the B button on Rift. On release, youre zoomed to the new position. You can cancel blink locomotion by pointing the arc up.
![Blink Locomotion](images/blink.gif)
- Fly Locomotion
- To enable Fly locomotion, navigate to the Settings pane of the Main Menu, and under the Locomotion Settings, ensure that Fly is enabled. To fly, use the Menu button on Vive, or the B button on Rift; (with button pressed) to accelerate your flight, press the trigger.
![Fly Locomotion](images/fly.gif)
* Re-Scaling the World.
![Scale](images/scale.png)
- You can re-scale and rotate the world by holding down the secondary triggers (Oculus) or the grip buttons (Vive) on both controllers, and pulling in/out.
![Scale](images/rescaling.gif)
* Selection
![Selection](images/ray.png)
- There are two kinds of selection: direct selection and ray selection.
- Direct selection allows you to grab any object within arms reach. Dip the blue selection cone at the end of your controller into an object for direct selection and pull the primary trigger (usually under your index finger).
- Ray selection allows you to move objects further than arms distance away. When objects are selected with the ray, the Manipulator Gizmo comes up.
- Multi-Select
- To enable multi-select: (with nothing selected) double click the grip buttons (Vive) or the secondary trigger (Oculus). A tooltip will pop-up to confirm you are in Multiselect mode.
![Multi Select](images/multiselect.gif)
- When multi-select is enabled, you can select multiple objects and manipulate them simultaneously. (In this context this trigger is used as a 'shift/cmd' modifier).
* Block Selection
![Block Selection](images/blockselection.gif)
- There are two kinds of block selection: cuboid selection and sphere selection. Both methods are activated by holding down the primary trigger in an open area and moving the controller to resize the selection shape. You can switch between the two methods in the Settings Menu
- Cuboid selection allows you to trace a cube to select any objects within arms reach. The cube extents are defined from the blue selection cone at the end of your controller.
- Sphere selection allows you to create a selection sphere. The center of the sphere is defined by where you first hold down the trigger, while the controllers distance from that point defines the radius.
* Two-handed Scaling
![Two-handed Scaling](images/scaling.gif)
- To enable two-handed scaling: With an object directly selected, use the trigger on both controllers, and pull in/out to resize.
* The Manipulator Gizmo
![Manipulator Gizmo](images/manipulatorgizmo.gif)
- Select a plane or axis of the Manipulator Gizmo to move the object along that path, or select the free selection sphere in the center to move the object freely. The three types of movement are:
- Plane movement
- Axis movement
- Free selection sphere: move the joystick (Rift) or thumbpad (Vive) back and forth along the Y-axis to move the object closer or further away.
![Manipulator Gizmo](images/manipulator.gif)
* Snapping
- Snapping can be enabled or disabled by using the section on the main menu labeled Snapping. Here, you can direct how the mode will function, i.e. snap via pivot or bounds, via direct selection or manipulator, snap to ground or surfaces, etc.
- By enabling Bounds, objects can snap to each other by directly selecting them and stacking them on top of one another.
![Snapping](images/snapping.gif)
- By enabling Pivot, objects can snap to a surface by selecting an object via the free selection sphere (center of the manipulator gizmo), and navigate the object to the desired surface.
![Snapping](images/snapping_02.gif)
- By enabling Rotate object, objects will automatically rotate to their root orientation when snapped to a surface.
![Snapping](images/snapping_rotate.gif)
* Workspaces
- Workspaces are the equivalent of 2D windows in VR. You can open various workspaces using the Main Menu.
- Workspaces can be moved, resized, or rotated.
- To move or rotate: Put the selection cone inside the front face of the workspace, then select by pressing down on the secondary trigger (Rift) or the grips (Vive). Make sure youre grabbing the face, not the scale or view UI.
![Workspaces](images/workspacemove.gif)
- To resize: Hold the controller near an edge until the resize arrows show, then hold down the secondary trigger (Rift) or the grip button (Vive).
![Workspaces](images/workspacescale.gif)
- To close a workspace, click the [X] on the front of a workspace.
![Workspaces](images/closeworkspace.gif)
- To scroll, either dip the selection cone directly in the pane, or use the ray or thumbpad.
![Workspaces](images/workspaces_scroll.gif)
- Here is the list of current workspaces that come as defaults:
- Console: View errors, warnings and other messages
- Hierarchy: View all GameObjects in your Scene(s)
- Locked Objects: View all locked GameObjects in your Scene(s)
- Inspector: View and edit GameObject properties
- MiniWorld: Edit a smaller version of your Scene(s)
- Profiler: Analyze your project's performance
- Project: Manage the Assets that belong to your project
* MiniWorld Workspace
- The MiniWorld is a workspace that shows the exact same scene youre already in, but smaller. Its very useful for moving large objects or rearranging a lot of life-sized objects quickly.
- You can move objects in the MiniWorld using the selection cone (trigger). Read more about the difference between ray selection and the selection cone in the Selection section, above.
![MiniWorld Workspace](images/miniworld_01.gif)
- To move the MiniWorld view, dip your cone into the top-pane of the workspace (which initially displays the grid) and move it around using the secondary trigger (Rift) or the grip buttons (Vive).
![MiniWorld Workspace](images/miniworld_02.gif)
- You can scale/rotate the MiniWorld view, similarly to world-scaling the physical scene, by dipping your controllers into the MiniWorld view and using the grip buttons (Vive) or the Secondary Trigger (Oculus) on both controllers.
![MiniWorld Workspace](images/miniworld.gif)
- If you lose where you are in the MiniWorld, you can select the Reset icon to get back to the root, or the button labeled Center on Player.
![MiniWorld Workspace](images/miniworld_reset.gif)
- To move yourself from one point of the world to another, grab yourself in the MiniWorld and move yourself around.
![MiniWorld Workspace](images/miniworldmoveuser.gif)
* Project Workspace
- The Project workspace (see Unity documentation on the Project view) works much the same way it does in regular Unity: you can open and close folders, look at different types of Assets, drag them into the Scene, and filter by Asset type.
- The left-hand side of the view shows folders, and the right-hand side shows Assets. Prefabs and models arent rendered in the Project view until you hover over them. This is for performance reasons.
- Drag objects out of the Project view to add them to the Scene. The bigger they are, the further away they instantiate from you. This is so they dont hit you in the face.
![Project Workspace](images/projectworkspace.gif)
* Hierarchy
- The Hierarchy (See Unity documentation on the Hierarchy window) shows which GameObjects are currently in your Scene. Click on an object in the Hierarchy to select the object in the Scene (Note: you may have to look around for it!).
![Hierarchy](images/hierarchy.gif)
* The Inspector
- The Inspector (See Unity documentation on the Inspector window) is used to view and edit the properties and settings of GameObjects, Assets, and other preferences and settings in the Editor.
- When you select a GameObject in EditorXR, or from the Hierarchy Workspace, the Inspector displays the GameObjects components, including Transform, which exposes position, rotation, and scale values.
![The Inspector](images/inspector.gif)
* Locked Objects
- The Locked Objects workspace shows a list of all of the locked GameObjects in the scene. Locked objects are not selectable by ray in the scene. You can lock and unlock items from the hierarchy or directly from the radial menu by clicking on the lock icon.
![Locked Objects](images/locked.gif)
<a name="Workflows"></a>
# EditorXR workflows
To create assets:
From the Main Menu, scroll to the Create Section. Here, you will find tools that enable you to create assets to place in your scene.
To create primitive assets:
1. In the Main Menu, scroll to the Create Section and select Primitive.
2. Select Cube, Sphere, Capsule, Cylinder, Plane, or Quad with your ray or cone.
3. To place, draw the object in the desired space.
4. After you are done with creation and would like to move back to selection, transforming, etc., turn off the tool by one of two means: Navigate back to the main menu and select the tool again to toggle it using the [X] button on the top right hand corner of the pane, or use the pinned toolbar below the Main Menu button on your controller to toggle it on and off.
To create annotations:
1. In the Main Menu, scroll to the Create Section and select the Annotation Tool.
2. To begin, choose a color from the gradient palette and draw using the trigger. You can change your brush size by sliding the thumbstick (Oculus) or touchpad (Vive) left or right.
3. When youre finished drawing, you can close the tool by pointing your selection cone to the the tool doc, hovering over the Annotation Tool label, and press the [x] button.
To place assets:
1. To open the Main Menu, select the Main Menu activator (the round Unity logo button) on your controller, then navigate to the Workspaces face on the Main Menu.
2. Select the Workspace named Project; it will open up in front of you.
3. The folder list is on the left, and Assets are on the right. You can open and close folders using the ray or the selection cone, or use the View all menu to see only certain types of Assets.
4. To add Assets from your project to the active Scene, drag them out of the Workspace Asset grid (on the right side), and place them in the space surrounding you. This action is akin to dragging an item from the Project window into your Scene view or Hierarchy in the standard Unity editor.
![Place](images/placement.gif)
<a name="Advanced"></a>
# Advanced topics
This section provides more information on the following topics:
* [EditorXR Runtime](#first): explains the use of EditorXR in Play Mode and included in Player builds.
* [Minimal Context](#second): explains the origin of ...
* [Image Effect and Camera Settings Copy Support](#third): explains the origin of ...
* [Extending EditorXR](#fourth): explains the origin of ...
<a name="first"></a>
## EditorXR Runtime
As of version 0.2, EditorXR can be used in Play Mode and included in Player builds. This means that you can use your tools, workspaces, and menus alongside your experience. This feature is highly experimental, and requires careful consideration of how to integrate EditorXR with your applications input and interaction code.
By default, EditorXR will strip its code out of Player builds to avoid increasing build size or causing conflicts with application code. However, if you would like to include EditorXR code in your player build, simply open the EditorXR preferences panel, and check “Include in Player Builds.”
![EditorXR](images/editorxr_02.png)
To include EditorXR in your scene, simply create a new GameObject and add an EditingContextManager component. It will include a reference to the EditorXR context by default, but you can change it to whatever context you would like to have active on start. You should also be able to manage contexts via script, but it depends on your desired use case.
Before entering Play Mode or making a build, there is one final step: you must create a default resources asset. From the menu, go to Assets > Create > EditorXR > Default Script References
This will add support for the Script Importer functionality which many EditorXR systems rely on. This collects all of the MonoBehaviours that are instantiated during an EditorXR session and creates prefabs out of them, which will include asset references that were set in the Script Importer inspector. If you have created any new EditorXR systems you may want to ensure that you update this asset as you make changes, or tag your classes with the interfaces used within the DefaultScriptReferences class.
<a name="second"></a>
## Minimal Context
* Ideal for lightweight client builds not requiring much of the EditorXR UI
* Unobtrusive context with no tools or menus other than the Spatial Menu
* Improvements to context handling (can hide workspaces, define preferences per context-type)
* Can be set via the Default Editing Context setting window:
- Edit / Project Settings / EditorXR / Default Editing Context
* Can be located in the project at :
- Assets/EditorXR/Scripts/Core/Contexts/Minimal
<a name="third"></a>
## Image Effect & Camera Settings Copy Support
EditorXR has limited support for automatic copying of (post)image effects to the EditorXR camera(s), from the MainCamera in your scene. This includes the in-HMD camera, and the “presentation camera”. Both cameras are created by EditorXR on startup of an EditorXR session.
* In order to enable Image Effect support for EditorXR cameras, please perform the following:
- Select the Camera in your scene that youd like the effects and settings copied from.
- Verify that Cameras tag is set to “MainCamera” preferences per context-type)
- Select the EditorXR context that youre currently using in the project tab.
- Default contexts are located in the project at : Assets/EditorXR/Scripts/Core/Contexts/
- To verify which context youre currently using, select the following menu option:
- Edit / Project Settings / EditorXR / Default Editing Context
- After selecting your active context in the Project tab, you will be presented with 3 options in the the Inspector tab. These options are as follows:
- “Copy Main Camera Settings”
- This option allows for the copying of non-image-effect related Camera settings.
- “Copy Main Camera Image Effects to HMD”
- This option will copy any image effects from your MainCamera to the in-HMD EditorXR camera. This allows you to see these image effects in the HMD while using EditorXR in the editor, outside of play-mode.
- “Copy Main Camera Image Effects to Presentation Camera”
- This option will copy any image effects from your MainCamera to the EditorXR “presentation camera”.
- The presentation camera is better suited for demonstrations of an EditorXR session to an audience, and can be enabled via the “Use Presentation Camera” checkbox in an active EditorXR session view window.
<a name="Reference"></a>

Просмотреть файл

@ -1,57 +0,0 @@
# EditorXR
Author XR in XR - Initial public release was on December 15, 2016 via [blogpost](https://blogs.unity3d.com/2016/12/15/editorvr-experimental-build-available-today/)
## Experimental Status
Its important to note that EditorXR is an experimental feature. As such, there is no formal support (e.g. FogBugz, support@unity3d.com, Premium Support, etc.) offered, so please do not use these channels. Instead, take your questions, suggestions, comments to our dedicated [forum](https://forum.unity3d.com/forums/editorvr.126/).
To help ensure you have a good experience, and to help us answer your questions (hey, were a small team!), we encourage you to try it out first with a small VR-ready scene. Please use life-sized objects, nothing too big or small. Dive in and have fun just playing around, instead of trying to use your existing project.
**As with any experimental/preview/alpha/beta build, it is always a good idea to make a backup of your project before using the build.**
Experimental means this:
- We're still adding features!
- The current menus, tools, workspaces, actions, etc. are not the end-all-be-all. Each of these have individual designs that will change as we experiment with what works best for UX. EditorXR was designed in such a way that we plan on you being able to replace all of these defaults, too, if you so desire.
- Namespaces, classes, software architecture, prefabs, etc. can change at any point. If you are writing your own tools, then you might need to update them as these things change.
- There wont always be an upgrade path from one release to the next, so you might need to fix things manually, which leads to the next point...
- Stuff can and will break (!)
- Theres **no guarantee** that this project will move out of experimental status within any specific timeframe.
- As such, there is no guarantee that this will remain an actively supported project.
## Getting Started
If you've made it here, but aren't accustomed to using GitHub, cloning repositories, etc. and are simply looking to give EditorXR a spin, then take a look at the [Getting Started Guide](https://docs.google.com/document/d/1Rymrri54MeUO1UE8pev0Tss9dMAcltECOF7NAAO5XuE). Once you're up and running we recommend you join the discussion on the [EditorXR forum](https://forum.unity3d.com/forums/editorvr.126/).
## For Software Developers
If you're a developer, we recommend that you take a look at the [Getting Started Guide](https://docs.google.com/document/d/1Rymrri54MeUO1UE8pev0Tss9dMAcltECOF7NAAO5XuE) *and* the companion document [Extending EditorXR](https://docs.google.com/document/d/1EGi9hKXAujfBMI2spErojdqRc0giqEnOu0NpwgBxtpg). You'll need to clone the repository into an existing project using the instructions below.
### Git Dependencies
- [git-lfs](https://git-lfs.github.com/)
- [git-submodule](https://git-scm.com/docs/git-submodule)
### Project Asset Dependencies
- [Textmesh Pro](https://docs.unity3d.com/Packages/com.unity.textmeshpro@1.2/manual/index.html#installation)
- [Legacy Input Helpers](https://docs.unity3d.com/Packages/com.unity.xr.legacyinputhelpers@1.0/manual/index.html#installing-comunityxrlegacyinputhelpers) (2019.1+)
- Users of 2018.4 do not need Legacy Input Helpers
### Cloning
1. Create a new Unity project or use an existing one
2. From the command line change directory to your project's `Assets` directory.
3. Run `git lfs clone --recursive -b development https://github.com/Unity-Technologies/EditorXR` **(Use HTTPS!)**
### Updating
Because this project uses [git-submodule](https://git-scm.com/docs/git-submodule), you'll need to execute `git submodule update` after pulling whenever a submodule is updated. You could execute this command always just to be safe or if you notice that a submodule is showing as modified after pulling changes.
Optionally, you could add a [git hook for post-checkout](https://ttboj.wordpress.com/2014/05/06/keeping-git-submodules-in-sync-with-your-branches/) or use a GUI (e.g. SourceTree) that does this automatically for you.
### Project Settings
If you plan on making changes to EditorXR and/or contributing back, then you'll need to set the `Asset Serialization` property under Edit->Project Settings->Editor to `Force Text`.
### Assembly Definitions
In order to support a variety of platform configurations, and to optionally strip its code out of player builds, EditorXR uses assembly definitions. Some of EditorXR's dependencies do not include assembly definitions in their current forms, so after importing EditorXR (in Unity 2018.4), you must add them.
For easy set-up when cloning the repository, EditorXR includes two `.unitypackage` files (`Patches/PolyToolkit_asmdef.unitypackage` and `Patches/SpatialTracking_2018.4.unitypackage`) containing assembly definitions for the Google Poly Toolkit and UnityEngine.SpatialTracking, which are referenced by EditorXR. Simply import them via Assets > Import Package > Custom Package...
- **For all Unity versions**: import the `PolyToolkit_asmdef` package to add assembly definitions to the PolyToolkit folder if you wish to integrate the PolyToolkit from the Asset Store
- **For Unity 2018.4**: Import both the `PolyToolkit_asmdef` *and* `SpatialTracking_2018.4` packages to fix compile errors that occur due to missing package dependencies
If you are using the release package, you will need to *delete* the `UnityEngine.SpatialTracking` assembly definition to prevent it from conflicting with the assembly definiton from the `Legacy Input Helpers` package, which will be automatically imported when you import EditorXR.
## All contributions are subject to the [Unity Contribution Agreement (UCA)](https://unity3d.com/legal/licenses/Unity_Contribution_Agreement)
By making a pull request, you are confirming agreement to the terms and conditions of the UCA, including that your Contributions are your original creation and that you have complete right and authority to make your Contributions.

Просмотреть файл

@ -1,4 +1,6 @@
namespace UnityEditor.Experimental.EditorVR.UI
using UnityEditor;
namespace Unity.Labs.EditorXR.UI
{
// Because Button already has a custom editor, and we need to expose SelectionFlags, we need a custom inspector
[CustomEditor(typeof(Button))]

Просмотреть файл

@ -1,28 +0,0 @@
using Unity.Labs.Utils;
using UnityEngine;
namespace UnityEditor.Experimental.EditorVR.Core
{
/// <summary>
/// Runtime hooks for EditingContextManager. One of these must be in any scene which depends on modules for it to function properly
/// </summary>
[InitializeOnLoad]
public static class ExecutionOrderSetter
{
// For some reason, we can't set an execution order as low as int.MinValue
public const int EditingContextManagerExecutionOrder = short.MinValue / 2;
static ExecutionOrderSetter()
{
var contextManager = new GameObject().AddComponent<EditingContextManager>();
var managerMonoScript = MonoScript.FromMonoBehaviour(contextManager);
if (managerMonoScript == null)
return;
if (MonoImporter.GetExecutionOrder(managerMonoScript) != EditingContextManagerExecutionOrder)
MonoImporter.SetExecutionOrder(managerMonoScript, EditingContextManagerExecutionOrder);
UnityObjectUtils.Destroy(contextManager.gameObject);
}
}
}

Просмотреть файл

@ -1,6 +1,7 @@
using UnityEditor.UI;
using UnityEditor;
using UnityEditor.UI;
namespace UnityEditor.Experimental.EditorVR.UI
namespace Unity.Labs.EditorXR.UI
{
[CustomEditor(typeof(InputField))]
[CanEditMultipleObjects]

Просмотреть файл

@ -1,8 +1,9 @@
using System;
using System.Text.RegularExpressions;
using UnityEditor;
using UnityEngine;
namespace UnityEditor.Experimental.EditorVR.UI
namespace Unity.Labs.EditorXR.UI
{
[CustomEditor(typeof(KeyboardButton))]
sealed class KeyboardButtonEditor : Editor

Просмотреть файл

@ -1,4 +1,6 @@
namespace UnityEditor.Experimental.EditorVR.UI
using UnityEditor;
namespace Unity.Labs.EditorXR.UI
{
[CanEditMultipleObjects]
[CustomEditor(typeof(KeyboardMallet))]

Просмотреть файл

@ -1,6 +1,7 @@
using UnityEngine;
using UnityEditor;
using UnityEngine;
namespace UnityEditor.Experimental.EditorVR.UI
namespace Unity.Labs.EditorXR.UI
{
[CustomEditor(typeof(KeyboardUI))]
sealed class KeyboardUIEditor : Editor

Просмотреть файл

@ -1,4 +1,4 @@
using UnityEditor;
using UnityEditor;
using UnityEngine;
[InitializeOnLoad]

Просмотреть файл

@ -1,11 +1,12 @@
using Unity.Labs.EditorXR.Interfaces;
using UnityEditor.Experimental.EditorVR.Menus;
using Unity.Labs.EditorXR.Interfaces;
using Unity.Labs.EditorXR.Menus;
using UnityEditor;
using UnityEngine;
namespace UnityEditor.Experimental.EditorVR.UI
namespace Unity.Labs.EditorXR.UI
{
[CustomEditor(typeof(MainMenu))]
public class MainMenuEditor : Editor
class MainMenuEditor : Editor
{
public override void OnInspectorGUI()
{

Просмотреть файл

@ -1,4 +1,6 @@
namespace UnityEditor.Experimental.EditorVR.UI
using UnityEditor;
namespace Unity.Labs.EditorXR.UI
{
[CustomEditor(typeof(NumericInputField))]
[CanEditMultipleObjects]

145
Editor/PolyToolkitHelper.cs Normal file
Просмотреть файл

@ -0,0 +1,145 @@
using System;
using System.IO;
using System.Linq;
using UnityEditor;
using UnityEditor.Compilation;
using UnityEngine;
[InitializeOnLoad]
static class PolyToolkitHelper
{
// ReSharper disable InconsistentNaming
[Serializable]
class AssemblyDefinition
{
[SerializeField]
string name;
[SerializeField]
string[] references;
[SerializeField]
string[] optionalUnityReferences;
[SerializeField]
string[] includePlatforms;
[SerializeField]
string[] excludePlatforms;
[SerializeField]
bool allowUnsafeCode;
public string Name { get { return name; } set { name = value; } }
public string[] References { get { return references; } set { references = value; } }
public string[] IncludePlatforms { get { return includePlatforms; } set { includePlatforms = value; } }
public bool AllowUnsafeCode { get { return allowUnsafeCode; } set { allowUnsafeCode = value; } }
}
// ReSharper restore InconsistentNaming
const string k_PolyApiGuid = "bffc1b9d57b39eb47a9ca38dcb349814";
const string k_PtUtilsGuid = "c92cab08cb256b44282cc813e8abd250";
const string k_AssemblyDefinitionExtension = ".asmdef";
const string k_RuntimeAssemblyDefinitionName = "PolyToolkit";
const string k_EditorAssemblyDefinitionName = "PolyToolkit.Editor";
const string k_RuntimeAssemblyDefinitionFileName = k_RuntimeAssemblyDefinitionName + k_AssemblyDefinitionExtension;
const string k_EditorAssemblyDefinitionFileName = k_EditorAssemblyDefinitionName + k_AssemblyDefinitionExtension;
const string k_IncludePolyToolkitDefine = "INCLUDE_POLY_TOOLKIT";
static readonly string[] k_IncludePlatformsEditorOnly = { "Editor" };
static PolyToolkitHelper()
{
// Use compilationFinished instead of just running in the static constructor to catch failed compiles
CompilationPipeline.compilationFinished += OnCompilationFinished;
}
static void OnCompilationFinished(object context)
{
var polyApiPath = AssetDatabase.GUIDToAssetPath(k_PolyApiGuid);
// Load the asset in case it was recently deleted, and its guid is still loaded in the database
if (string.IsNullOrEmpty(polyApiPath) || AssetDatabase.LoadAssetAtPath<MonoScript>(polyApiPath) == null)
{
Cleanup();
return;
}
var runtimeFolder = Directory.GetParent(polyApiPath).Parent;
if (runtimeFolder == null)
{
Cleanup();
return;
}
var ptUtilsPath = AssetDatabase.GUIDToAssetPath(k_PtUtilsGuid);
if (string.IsNullOrEmpty(ptUtilsPath))
{
Cleanup();
return;
}
var editorFolder = Directory.GetParent(ptUtilsPath);
if (editorFolder == null)
{
Cleanup();
return;
}
var runtimeAssemblyDefinitionPath = Path.Combine(runtimeFolder.ToString(), k_RuntimeAssemblyDefinitionFileName);
if (!File.Exists(runtimeAssemblyDefinitionPath))
{
var runtimeAssemblyDefinition = new AssemblyDefinition
{
Name = k_RuntimeAssemblyDefinitionName,
AllowUnsafeCode = true
};
File.WriteAllText(runtimeAssemblyDefinitionPath, JsonUtility.ToJson(runtimeAssemblyDefinition));
}
var editorAssemblyDefinitionPath = Path.Combine(editorFolder.ToString(), k_EditorAssemblyDefinitionFileName);
if (!File.Exists(editorAssemblyDefinitionPath))
{
var editorAssemblyDefinition = new AssemblyDefinition
{
Name = k_EditorAssemblyDefinitionName,
References = new[] { k_RuntimeAssemblyDefinitionName },
IncludePlatforms = k_IncludePlatformsEditorOnly
};
File.WriteAllText(editorAssemblyDefinitionPath, JsonUtility.ToJson(editorAssemblyDefinition));
}
BuildTargetGroup currentGroup;
var defineString = GetDefineString(out currentGroup);
if (string.IsNullOrEmpty(defineString) || defineString.Contains(k_IncludePolyToolkitDefine))
return;
var defines = defineString.Split(';').ToList();
defines.Add(k_IncludePolyToolkitDefine);
defineString = string.Join(";", defines);
PlayerSettings.SetScriptingDefineSymbolsForGroup(currentGroup, defineString);
}
/// <summary>
/// Attempt to remove the INCLUDE_POLY_TOOLKIT define if it exists, but PolyToolkit cannot be found
/// </summary>
static void Cleanup()
{
BuildTargetGroup currentGroup;
var defineString = GetDefineString(out currentGroup);
if (string.IsNullOrEmpty(defineString) || !defineString.Contains(k_IncludePolyToolkitDefine))
return;
var defines = defineString.Split(';').ToList();
defines.Remove(k_IncludePolyToolkitDefine);
defineString = string.Join(";", defines);
PlayerSettings.SetScriptingDefineSymbolsForGroup(currentGroup, defineString);
}
static string GetDefineString(out BuildTargetGroup currentGroup)
{
currentGroup = BuildPipeline.GetBuildTargetGroup(EditorUserBuildSettings.activeBuildTarget);
return PlayerSettings.GetScriptingDefineSymbolsForGroup(currentGroup);
}
}

Просмотреть файл

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: ce1eead830b73944584a284337906544
guid: 3bb8bf7eea010184bb37ebb5efe62c39
MonoImporter:
externalObjects: {}
serializedVersion: 2

Просмотреть файл

@ -1,6 +1,7 @@
using UnityEditor.UI;
using UnityEditor;
using UnityEditor.UI;
namespace UnityEditor.Experimental.EditorVR.UI
namespace Unity.Labs.EditorXR.UI
{
// Because Slider already has a custom editor, and we need to expose SelectionFlags, we need a custom inspector
[CustomEditor(typeof(RaySlider))]

Просмотреть файл

@ -1,17 +1,18 @@
using System.Collections.Generic;
using System.Collections.Generic;
using UnityEditor;
// Copied from UnityEditor.XR.LegacyInputHelpers
namespace UnityEditor.Experimental.EditorXR.LegacyInputHelpers
namespace Unity.Labs.EditorXR.LegacyInputHelpers
{
/// <summary>
/// The SeedXRInputBindings class is used to populate the Input Asset with the cross platform bindings published by Unity for most XR Devices.
/// </summary>
[InitializeOnLoad]
public class SeedXRInputBindings
class SeedXRInputBindings
{
static SeedXRInputBindings()
{
EditorVR.Core.EditorVR.UpdateInputManager = UpdateInputManager;
Core.EditorXR.UpdateInputManager = UpdateInputManager;
}
#region InputAxisDataAndConfig
// Same as InputAxis.h

Просмотреть файл

@ -1,4 +1,6 @@
namespace UnityEditor.Experimental.EditorVR.UI
using UnityEditor;
namespace Unity.Labs.EditorXR.UI
{
class EditorXRSettingsProvider : SettingsProvider
{

Просмотреть файл

@ -1,6 +1,7 @@
using System.Collections.Generic;
using UnityEditor.Experimental.EditorVR.Core;
using UnityEditor.Experimental.EditorVR.Modules;
using System.Collections.Generic;
using Unity.Labs.EditorXR.Core;
using Unity.Labs.EditorXR.Modules;
using UnityEditor;
using UnityEngine;
#if UNITY_2019_1_OR_NEWER
@ -9,7 +10,7 @@ using UnityEngine.UIElements;
using UnityEngine.Experimental.UIElements;
#endif
namespace UnityEditor.Experimental.EditorVR.UI
namespace Unity.Labs.EditorXR.UI
{
class HapticPulsesSettingsProvider : EditorXRSettingsProvider
{
@ -43,14 +44,14 @@ namespace UnityEditor.Experimental.EditorVR.UI
base.OnActivate(searchContext, rootElement);
Reset();
Undo.undoRedoPerformed += OnUndoRedo;
UnityEditor.Undo.undoRedoPerformed += OnUndoRedo;
}
public override void OnDeactivate()
{
base.OnDeactivate();
Undo.undoRedoPerformed -= OnUndoRedo;
UnityEditor.Undo.undoRedoPerformed -= OnUndoRedo;
}
void OnUndoRedo()

Просмотреть файл

@ -1,7 +1,8 @@
using System;
using System;
using System.Collections.Generic;
using UnityEditor.Experimental.EditorVR.Modules;
using UnityEditor.Experimental.EditorVR.Proxies;
using Unity.Labs.EditorXR.Modules;
using Unity.Labs.EditorXR.Proxies;
using UnityEditor;
using UnityEngine;
#if UNITY_2019_1_OR_NEWER
@ -10,7 +11,7 @@ using UnityEngine.UIElements;
using UnityEngine.Experimental.UIElements;
#endif
namespace UnityEditor.Experimental.EditorVR.UI
namespace Unity.Labs.EditorXR.UI
{
class ProxyFeedbackSettingsProvider : EditorXRSettingsProvider
{
@ -93,6 +94,9 @@ namespace UnityEditor.Experimental.EditorVR.UI
m_SerializedFeedback.Clear();
var preferences = SerializedPreferencesModule.SerializedPreferences.Deserialize(SerializedPreferencesModule.serializedPreferences);
if (preferences == null)
return;
foreach (var kvp in preferences.items)
{
var type = kvp.Key;

Просмотреть файл

@ -1,8 +1,9 @@
using System;
using System;
using System.Collections.Generic;
using System.Reflection;
using Unity.Labs.EditorXR.Interfaces;
using Unity.Labs.Utils;
using UnityEditor;
using UnityEngine;
#if UNITY_2019_1_OR_NEWER
@ -11,7 +12,7 @@ using UnityEngine.UIElements;
using UnityEngine.Experimental.UIElements;
#endif
namespace UnityEditor.Experimental.EditorVR.UI
namespace Unity.Labs.EditorXR.UI
{
class TooltipsSettingsProvider : EditorXRSettingsProvider
{

Просмотреть файл

@ -1,4 +1,6 @@
namespace UnityEditor.Experimental.EditorVR.UI
using UnityEditor;
namespace Unity.Labs.EditorXR.UI
{
[CustomEditor(typeof(StandardInputField))]
sealed class StandardInputFieldEditor : InputFieldEditor

Просмотреть файл

@ -1,9 +1,11 @@
using UnityEditor;
using UnityEditor.Experimental.EditorVR.Menus;
using Unity.Labs.EditorXR.Menus;
using UnityEditor;
using UnityEngine;
namespace Unity.Labs.EditorXR
{
[CustomEditor(typeof(ToolsMenu))]
public class ToolsMenuEditor : Editor
class ToolsMenuEditor : Editor
{
public override void OnInspectorGUI()
{
@ -15,3 +17,4 @@ public class ToolsMenuEditor : Editor
}
}
}
}

Просмотреть файл

@ -1,9 +1,11 @@
using UnityEditor;
using UnityEditor.Experimental.EditorVR.Proxies;
using Unity.Labs.EditorXR.Proxies;
using UnityEditor;
using UnityEngine;
namespace Unity.Labs.EditorXR
{
[CustomEditor(typeof(TouchProxy))]
public class TouchProxyEditor : Editor
class TouchProxyEditor : Editor
{
public override void OnInspectorGUI()
{
@ -15,3 +17,4 @@ public class TouchProxyEditor : Editor
}
}
}
}

Просмотреть файл

@ -1,9 +1,11 @@
using UnityEditor;
using UnityEditor.Experimental.EditorVR.Proxies;
using Unity.Labs.EditorXR.Proxies;
using UnityEditor;
using UnityEngine;
namespace Unity.Labs.EditorXR
{
[CustomEditor(typeof(ViveProxy))]
public class ViveProxyEditor : Editor
class ViveProxyEditor : Editor
{
public override void OnInspectorGUI()
{
@ -15,3 +17,4 @@ public class ViveProxyEditor : Editor
}
}
}
}

Просмотреть файл

@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using UnityEngine;

Просмотреть файл

@ -1,4 +1,4 @@
using UnityEngine;
using UnityEngine;
namespace Unity.Labs.EditorXR.Interfaces
{

Просмотреть файл

@ -1,4 +1,4 @@
using UnityEngine;
using UnityEngine;
namespace Unity.Labs.EditorXR.Interfaces
{

Просмотреть файл

@ -1,4 +1,4 @@
using System;
using System;
namespace Unity.Labs.EditorXR.Interfaces
{
@ -8,8 +8,19 @@ namespace Unity.Labs.EditorXR.Interfaces
[Flags]
public enum AxisFlags
{
/// <summary>
/// The X axis
/// </summary>
X = 1 << 0,
/// <summary>
/// The Y axis
/// </summary>
Y = 1 << 1,
/// <summary>
/// The Z axis
/// </summary>
Z = 1 << 2
}
}

Просмотреть файл

@ -1,4 +1,4 @@
using UnityEngine;
using UnityEngine;
namespace Unity.Labs.EditorXR.Interfaces
{

Просмотреть файл

@ -1,12 +1,18 @@
namespace Unity.Labs.EditorXR.Interfaces
namespace Unity.Labs.EditorXR.Interfaces
{
/// <summary>
/// Base class for feedback requests
/// </summary>
public abstract class FeedbackRequest
{
/// <summary>
/// The calling object
/// </summary>
public IUsesRequestFeedback caller { get; set; }
/// <summary>
/// Reset the state of this request for re-use
/// </summary>
public abstract void Reset();
}
}

Просмотреть файл

@ -1,7 +1,10 @@
using UnityEngine;
using UnityEngine;
namespace UnityEditor.Experimental.EditorVR.Core
namespace Unity.Labs.EditorXR.Core
{
/// <summary>
/// Serialized data to describe a haptic pulse
/// </summary>
[CreateAssetMenu(menuName = "EditorXR/Haptic Pulse", fileName = "NewHapticPulse.asset")]
public class HapticPulse : ScriptableObject
{
@ -21,21 +24,32 @@ namespace UnityEditor.Experimental.EditorVR.Core
bool m_FadeOut;
#pragma warning restore 649
// Don't allow public setting of value; use inspector-set values
/// <summary>
/// The duration of the pulse
/// </summary>
public float duration
{
get { return m_Duration; }
internal set { m_Duration = value; }
}
/// <summary>
/// The intensity of the pulse
/// </summary>
public float intensity
{
get { return m_Intensity; }
internal set { m_Intensity = value; }
}
/// <summary>
/// Whether to fade in this pulse
/// </summary>
public bool fadeIn { get { return m_FadeIn; } }
/// <summary>
/// Whether to fade out this pulse
/// </summary>
public bool fadeOut { get { return m_FadeOut; } }
}
}

Просмотреть файл

@ -0,0 +1,46 @@
using System;
namespace Unity.Labs.EditorXR.Interfaces
{
/// <summary>
/// Flags to describe why a menu is hidden. Anything > 0 is hidden
/// </summary>
[Flags]
public enum MenuHideFlags
{
/// <summary>
/// The menu has been explicitly set to hidden
/// </summary>
Hidden = 1 << 0,
/// <summary>
/// The menu overlaps with another menu
/// </summary>
OtherMenu = 1 << 1,
/// <summary>
/// The ray associated with menu is hovering over UI
/// </summary>
OverUI = 1 << 2,
/// <summary>
/// The menu is overlapping with a workspace
/// </summary>
OverWorkspace = 1 << 3,
/// <summary>
/// The ray has a direct selection
/// </summary>
HasDirectSelection = 1 << 4,
/// <summary>
/// The menu is temporarily hidden
/// </summary>
Temporary = OtherMenu | OverUI | OverWorkspace | HasDirectSelection,
/// <summary>
/// The menu is occluded
/// </summary>
Occluded = OverUI | OverWorkspace | HasDirectSelection
}
}

Просмотреть файл

@ -1,12 +1,23 @@
namespace Unity.Labs.EditorXR.Interfaces
namespace Unity.Labs.EditorXR.Interfaces
{
/// <summary>
/// A tracked node within the system
/// </summary>
public enum Node
{
/// <summary>
/// No hand specified
/// </summary>
None,
/// <summary>
/// The left hand
/// </summary>
LeftHand,
/// <summary>
/// The right hand
/// </summary>
RightHand
}
}

Просмотреть файл

@ -1,9 +1,18 @@
#if !UNITY_EDITOR
#if !UNITY_EDITOR
namespace Unity.Labs.EditorXR.Interfaces
{
/// <summary>
/// Where is the tool handle placed.
/// </summary>
public enum PivotMode
{
/// <summary>
/// The tool handle is at the graphical center of the selection.
/// </summary>
Center,
/// <summary>
/// The tool handle is on the pivot point of the active object.
/// </summary>
Pivot,
}
}

Просмотреть файл

@ -1,10 +1,28 @@
namespace Unity.Labs.EditorXR.Interfaces
namespace Unity.Labs.EditorXR.Interfaces
{
/// <summary>
/// Possible states for a spatial hint
/// </summary>
public enum SpatialHintState
{
/// <summary>
/// The hint is hidden
/// </summary>
Hidden,
/// <summary>
/// The hint is ready for drag reveal
/// </summary>
PreDragReveal,
/// <summary>
/// The hint is indicating scrolling
/// </summary>
Scrolling,
/// <summary>
/// The hint is indicating centered scrolling
/// </summary>
CenteredScrolling,
}
}

Просмотреть файл

@ -1,7 +1,6 @@
using UnityEditor.Experimental.EditorVR.Menus;
using UnityEngine;
namespace UnityEditor.Experimental.EditorVR
namespace Unity.Labs.EditorXR.Interfaces
{
/// <summary>
/// Declares a class as a system-level menu
@ -28,6 +27,9 @@ namespace UnityEditor.Experimental.EditorVR
/// </summary>
Bounds localBounds { get; }
/// <summary>
/// The priority of this menu for deciding which menu should be visible if multiple menus overlap
/// </summary>
int priority { get; }
}
}

Просмотреть файл

@ -1,4 +1,4 @@
namespace Unity.Labs.EditorXR.Interfaces
namespace Unity.Labs.EditorXR.Interfaces
{
/// <summary>
/// Decorates classes which can specify tool tip information

Просмотреть файл

@ -1,4 +1,4 @@
using System;
using System;
using UnityEngine;
namespace Unity.Labs.EditorXR.Interfaces

Просмотреть файл

@ -1,4 +1,4 @@
using UnityEngine.InputNew;
using UnityEngine.InputNew;
namespace Unity.Labs.EditorXR.Interfaces
{

Просмотреть файл

@ -1,4 +1,4 @@
using UnityEngine.InputNew;
using UnityEngine.InputNew;
namespace Unity.Labs.EditorXR.Interfaces
{
@ -7,6 +7,9 @@ namespace Unity.Labs.EditorXR.Interfaces
/// </summary>
public interface IStandardActionMap : IProcessInput
{
/// <summary>
/// The default action map will be set on this property by the system
/// </summary>
ActionMap standardActionMap { set; }
}
}

Просмотреть файл

@ -1,5 +1,5 @@
using Unity.Labs.EditorXR.Core;
using Unity.Labs.ModuleLoader;
using UnityEditor.Experimental.EditorVR.Core;
namespace Unity.Labs.EditorXR.Interfaces
{

Просмотреть файл

@ -8,8 +8,19 @@ namespace Unity.Labs.EditorXR.Interfaces
/// </summary>
public interface IProvidesDetectGazeDivergence : IFunctionalityProvider
{
/// <summary>
/// Check if gaze direction is above the divergence threshold
/// </summary>
/// <param name="transformToTest">The transform representing gaze direction</param>
/// <param name="divergenceThreshold">The threshold angle value to test</param>
/// <param name="disregardTemporalStability">Whether to disregard temporal stability</param>
/// <returns>True if the angle between the gaze and target is above the divergence threshold</returns>
bool IsAboveDivergenceThreshold(Transform transformToTest, float divergenceThreshold, bool disregardTemporalStability = true);
/// <summary>
/// Set the divergence recovery speed
/// </summary>
/// <param name="rateAtWhichGazeVelocityReturnsToStableThreshold">The rate at which gaze velocity returns to a stable threshold</param>
void SetDivergenceRecoverySpeed(float rateAtWhichGazeVelocityReturnsToStableThreshold);
}
}

Просмотреть файл

@ -19,6 +19,7 @@ namespace Unity.Labs.EditorXR.Interfaces
/// Check whether a GameObject is locked
/// </summary>
/// <param name="go">GameObject locked status to test</param>
/// <returns>Whether the object is locked</returns>
bool IsLocked(GameObject go);
}
}

Просмотреть файл

@ -12,6 +12,7 @@ namespace Unity.Labs.EditorXR.Interfaces
/// <summary>
/// Returns objects that are used to represent the VR player
/// </summary>
/// <returns>A list containing the VR player objects</returns>
List<GameObject> GetVRPlayerObjects();
}
}

Просмотреть файл

@ -12,6 +12,7 @@ namespace Unity.Labs.EditorXR.Interfaces
/// Returns whether the main menu is visible on the specified rayOrigin
/// </summary>
/// <param name="rayOrigin">The rayOrigin that is being checked</param>
/// <returns>Whether the main menu is visible on the specified rayOrigin</returns>
bool IsMainMenuVisible(Transform rayOrigin);
}
}

Просмотреть файл

@ -11,10 +11,10 @@ namespace Unity.Labs.EditorXR.Interfaces
{
/// <summary>
/// Highlights a ToolMenuButton when a menu button is highlighted
/// </summary>
/// <param name="rayOrigin">Transform: Ray origin to check</param>
/// <param name="toolType">Type: MenuButton's tool type to preview</param>
/// <param name="toolDescription">String: The tool description to display as a Tooltip</param>
/// </summary>
void PreviewInToolsMenuButton(Transform rayOrigin, Type toolType, string toolDescription);
/// <summary>

Просмотреть файл

@ -13,6 +13,7 @@ namespace Unity.Labs.EditorXR.Interfaces
/// Returns the first GameObject being hovered over, or intersected with
/// </summary>
/// <param name="rayOrigin">The rayOrigin for intersection purposes</param>
/// <returns>The first intersected GameObject</returns>
GameObject GetFirstGameObject(Transform rayOrigin);
}
}

Просмотреть файл

@ -10,20 +10,21 @@ namespace Unity.Labs.EditorXR.Interfaces
public interface IProvidesSelectTool : IFunctionalityProvider
{
/// <summary>
/// Method used to select tools from the menu
/// Returns whether the tool was successfully selected
/// Select tools from the menu
/// </summary>
/// <param name="rayOrigin">The rayOrigin that the tool should spawn under</param>
/// <param name="toolType">Type of tool to spawn/select</param>
/// <param name="despawnOnReselect">Despawn the tool, if re-selected while already the current tool</param>
/// <param name="hideMenu">Whether to hide the menu after selecting this tool</param>
/// <returns>Whether the tool was successfully selected</returns>
bool SelectTool(Transform rayOrigin, Type toolType, bool despawnOnReselect = true, bool hideMenu = false);
/// <summary>
/// Returns true if the active tool on the given ray origin is of the given type
/// Check if the active tool on the given ray origin is of the given type
/// </summary>
/// <param name="rayOrigin">The ray origin to check</param>
/// <param name="type">The tool type to compare</param>
/// <returns>True if the active tool is of the given type</returns>
bool IsToolActive(Transform rayOrigin, Type type);
}
}

Просмотреть файл

@ -30,6 +30,7 @@ namespace Unity.Labs.EditorXR.Interfaces
/// <param name="force">Force the setting or unsetting of the highlight</param>
/// <param name="dutyPercent">The percentage of time when the highlight is active</param>
/// <param name="cycleDuration">The duration for which to show this highlight. Keep default value of 0 to show until explicitly hidden</param>
/// <returns>Coroutine enumerator</returns>
IEnumerator SetBlinkingHighlight(GameObject go, bool active, Transform rayOrigin = null,
Material material = null, bool force = false, float dutyPercent = 0.75f, float cycleDuration = .8f);
}

Просмотреть файл

@ -1,5 +1,4 @@
using Unity.Labs.ModuleLoader;
using UnityEditor;
using UnityEngine;
namespace Unity.Labs.EditorXR.Interfaces

Просмотреть файл

@ -9,15 +9,17 @@ namespace Unity.Labs.EditorXR.Interfaces
public interface IProvidesViewerBody : IFunctionalityProvider
{
/// <summary>
/// Returns whether the specified transform is over the viewer's shoulders and behind the head
/// Check whether the specified transform is over the viewer's shoulders and behind the head
/// </summary>
/// <param name="rayOrigin">The rayOrigin to test</param>
/// <returns>Whether the specified transform is over the viewer's shoulders and behind the head</returns>
bool IsOverShoulder(Transform rayOrigin);
/// <summary>
/// Returns whether the specified transform is over the viewer's head
/// Check whether the specified transform is over the viewer's head
/// </summary>
/// <param name="rayOrigin">The rayOrigin to test</param>
/// <returns>Whether the specified transform is over the viewer's head</returns>
bool IsAboveHead(Transform rayOrigin);
}
}

Просмотреть файл

@ -8,8 +8,9 @@ namespace Unity.Labs.EditorXR.Interfaces
public interface IProvidesViewerScale : IFunctionalityProvider
{
/// <summary>
/// Returns the scale of the viewer object
/// Get the scale of the viewer object
/// </summary>
/// <returns>The viewer scale</returns>
float GetViewerScale();
/// <summary>

Просмотреть файл

@ -6,10 +6,11 @@ namespace Unity.Labs.EditorXR.Interfaces
/// <summary>
/// Gives decorated class the ability block all UI interaction for a given rayOrigin
/// </summary>
public interface IUsesBlockUIInteraction : IFunctionalitySubscriber<IProvidesBlockUIInteraction>
{
}
public interface IUsesBlockUIInteraction : IFunctionalitySubscriber<IProvidesBlockUIInteraction> { }
/// <summary>
/// Extension methods for implementors of IUsesBlockUIInteraction
/// </summary>
public static class UsesBlockUIInteractionMethods
{
/// <summary>

Просмотреть файл

@ -10,6 +10,9 @@ namespace Unity.Labs.EditorXR.Interfaces
{
}
/// <summary>
/// Extension methods for implementors of IUsesCanGrabObject
/// </summary>
public static class UsesCanGrabObjectMethods
{
/// <summary>

Просмотреть файл

@ -11,6 +11,9 @@ namespace Unity.Labs.EditorXR.Interfaces
{
}
/// <summary>
/// Extension methods for implementors of IUsesCheckBounds
/// </summary>
public static class UsesCheckBoundsMethods
{
/// <summary>

Просмотреть файл

@ -11,6 +11,9 @@ namespace Unity.Labs.EditorXR.Interfaces
{
}
/// <summary>
/// Extension methods for implementors of IUsesCheckSphere
/// </summary>
public static class UsesCheckSphereMethods
{
/// <summary>

Просмотреть файл

@ -9,6 +9,9 @@ namespace Unity.Labs.EditorXR.Interfaces
{
}
/// <summary>
/// Extension methods for implementors of IUsesConnectInterfaces
/// </summary>
public static class UsesConnectInterfacesMethods
{
/// <summary>

Просмотреть файл

@ -8,6 +8,9 @@ namespace Unity.Labs.EditorXR.Interfaces
/// </summary>
public interface IUsesContainsVRPlayerCompletely : IFunctionalitySubscriber<IProvidesContainsVRPlayerCompletely> { }
/// <summary>
/// Extension methods for implementors of IUsesContainsVRPlayerCompletely
/// </summary>
public static class UsesContainsVRPlayerCompletelyMethods
{
/// <summary>

Просмотреть файл

@ -1,5 +1,5 @@
using Unity.Labs.EditorXR.Core;
using Unity.Labs.ModuleLoader;
using UnityEditor.Experimental.EditorVR.Core;
namespace Unity.Labs.EditorXR.Interfaces
{
@ -10,6 +10,9 @@ namespace Unity.Labs.EditorXR.Interfaces
{
}
/// <summary>
/// Extension methods for implementors of IUsesControlHaptics
/// </summary>
public static class UsesControlHapticsMethods
{
/// <summary>

Просмотреть файл

@ -11,6 +11,9 @@ namespace Unity.Labs.EditorXR.Interfaces
{
}
/// <summary>
/// Extension methods for implementors of IUsesControlInputIntersection
/// </summary>
public static class UsesControlInputIntersectionMethods
{
/// <summary>

Просмотреть файл

@ -14,6 +14,9 @@ namespace Unity.Labs.EditorXR.Interfaces
{
}
/// <summary>
/// Extension methods for implementors of IUsesControlSpatialHinting
/// </summary>
public static class UsesControlSpatialHintingMethods
{
/// <summary>

Просмотреть файл

@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using Unity.Labs.ModuleLoader;
using UnityEngine;
@ -12,6 +11,9 @@ namespace Unity.Labs.EditorXR.Interfaces
{
}
/// <summary>
/// Extension methods for implementors of IUsesCreateWorkspace
/// </summary>
public static class UsesCreateWorkspaceMethods
{
/// <summary>

Просмотреть файл

@ -18,6 +18,9 @@ namespace Unity.Labs.EditorXR.Interfaces
/// <returns>Whether to block the normal highlight method</returns>
public delegate bool OnHighlightMethod(GameObject go, Material material);
/// <summary>
/// Extension methods for implementors of IUsesCustomHighlight
/// </summary>
public static class UsesCustomHighlightMethods
{
/// <summary>

Просмотреть файл

@ -10,6 +10,9 @@ namespace Unity.Labs.EditorXR.Interfaces
{
}
/// <summary>
/// Extension methods for implementors of IUsesDeleteSceneObject
/// </summary>
public static class UsesDeleteSceneObjectMethods
{
/// <summary>

Просмотреть файл

@ -6,12 +6,20 @@ namespace Unity.Labs.EditorXR.Interfaces
/// <summary>
/// Gives decorated class ability to detect gaze divergence above a defined threshold, for a given transform's forward vector
/// </summary>
public interface IUsesDetectGazeDivergence : IFunctionalitySubscriber<IProvidesDetectGazeDivergence>
{
}
public interface IUsesDetectGazeDivergence : IFunctionalitySubscriber<IProvidesDetectGazeDivergence> { }
/// <summary>
/// Extension methods for implementors of IUsesDeleteSceneObject
/// </summary>
public static class UsesDetectGazeDivergenceMethods
{
/// <summary>
/// Check if gaze direction is above the divergence threshold
/// </summary>
/// <param name="transformToTest">The transform representing gaze direction</param>
/// <param name="divergenceThreshold">The threshold angle value to test</param>
/// <param name="disregardTemporalStability">Whether to disregard temporal stability</param>
/// <returns>True if the angle between the gaze and target is above the divergence threshold</returns>
public static bool IsAboveDivergenceThreshold(this IUsesDetectGazeDivergence user, Transform transformToTest, float divergenceThreshold, bool disregardTemporalStability = true)
{
#if FI_AUTOFILL
@ -21,6 +29,10 @@ namespace Unity.Labs.EditorXR.Interfaces
#endif
}
/// <summary>
/// Set the divergence recovery speed
/// </summary>
/// <param name="rateAtWhichGazeVelocityReturnsToStableThreshold">The rate at which gaze velocity returns to a stable threshold</param>
public static void SetDivergenceRecoverySpeed(this IUsesDetectGazeDivergence user, float rateAtWhichGazeVelocityReturnsToStableThreshold)
{
#if !FI_AUTOFILL

Просмотреть файл

@ -12,6 +12,9 @@ namespace Unity.Labs.EditorXR.Interfaces
{
}
/// <summary>
/// Extension methods for implementors of IUsesDirectSelection
/// </summary>
public static class UsesDirectSelectionMethods
{
/// <summary>

Просмотреть файл

@ -10,6 +10,9 @@ namespace Unity.Labs.EditorXR.Interfaces
{
}
/// <summary>
/// Extension methods for implementors of IUsesGameObjectLocking
/// </summary>
public static class UsesGameObjectLockingMethods
{
/// <summary>
@ -32,6 +35,7 @@ namespace Unity.Labs.EditorXR.Interfaces
/// </summary>
/// <param name="user">The functionality user</param>
/// <param name="go">GameObject locked status to test</param>
/// <returns>Whether the GameObject is locked</returns>
public static bool IsLocked(this IUsesGameObjectLocking user, GameObject go)
{
#if FI_AUTOFILL

Просмотреть файл

@ -10,6 +10,9 @@ namespace Unity.Labs.EditorXR.Interfaces
{
}
/// <summary>
/// Extension methods for implementors of IUsesGetDefaultRayColor
/// </summary>
public static class UsesGetDefaultRayColorMethods
{
/// /// <summary>

Просмотреть файл

@ -10,6 +10,9 @@ namespace Unity.Labs.EditorXR.Interfaces
{
}
/// <summary>
/// Extension methods for implementors of IUsesGetFieldGrabOrigin
/// </summary>
public static class UsesGetFieldDragOriginMethods
{
/// <summary>

Просмотреть файл

@ -7,6 +7,9 @@ namespace Unity.Labs.EditorXR.Interfaces
/// </summary>
public interface IUsesGetManipulatorDragState : IFunctionalitySubscriber<IProvidesGetManipulatorDragState> { }
/// <summary>
/// Extension methods for implementors of IUsesGetManipulatorDragState
/// </summary>
public static class UsesGetManipulatorDragStateMethods
{
/// <summary>

Просмотреть файл

@ -10,6 +10,9 @@ namespace Unity.Labs.EditorXR.Interfaces
{
}
/// <summary>
/// Extension methods for implementors of IUsesGetPreviewOrigin
/// </summary>
public static class UsesGetPreviewOriginMethods
{
/// <summary>

Просмотреть файл

@ -10,6 +10,9 @@ namespace Unity.Labs.EditorXR.Interfaces
{
}
/// <summary>
/// Extension methods for implementors of IUsesGetRayVisibility
/// </summary>
public static class UsesGetRayVisibilityMethods
{
/// <summary>

Просмотреть файл

@ -11,6 +11,9 @@ namespace Unity.Labs.EditorXR.Interfaces
{
}
/// <summary>
/// Extension methods for implementors of IUsesGetVRPlayerObjects
/// </summary>
public static class UsesGetVRPlayerObjectsMethods
{
/// <summary>

Просмотреть файл

@ -10,6 +10,9 @@ namespace Unity.Labs.EditorXR.Interfaces
{
}
/// <summary>
/// Extension methods for implementors of IUsesGrouping
/// </summary>
public static class UsesGroupingMethods
{
/// <summary>

Просмотреть файл

@ -10,6 +10,9 @@ namespace Unity.Labs.EditorXR.Interfaces
{
}
/// <summary>
/// Extension methods for implementors of IUsesIsHoveringOverUI
/// </summary>
public static class UsesIsHoveringOverUIMethods
{
/// <summary>

Просмотреть файл

@ -10,6 +10,9 @@ namespace Unity.Labs.EditorXR.Interfaces
{
}
/// <summary>
/// Extension methods for implementors of IUsesIsInMiniWorld
/// </summary>
public static class UsesIsInMiniWorldMethods
{
/// <summary>

Просмотреть файл

@ -10,13 +10,17 @@ namespace Unity.Labs.EditorXR.Interfaces
{
}
/// <summary>
/// Extension methods for implementors of IUsesIsMainMenuVisible
/// </summary>
public static class UsesIsMainMenuVisibleMethods
{
/// <summary>
/// Returns whether the main menu is visible on the specified rayOrigin
/// Check if the main menu is visible on the specified rayOrigin
/// </summary>
/// <param name="user">The functionality user</param>
/// <param name="rayOrigin">The rayOrigin that is being checked</param>
/// <returns>Whether the main menu is visible on the specified rayOrigin</returns>
public static bool IsMainMenuVisible(this IUsesIsMainMenuVisible user, Transform rayOrigin)
{
#if FI_AUTOFILL

Просмотреть файл

@ -10,6 +10,9 @@ namespace Unity.Labs.EditorXR.Interfaces
{
}
/// <summary>
/// Extension methods for implementors of IUsesMoveCameraRig
/// </summary>
public static class UsesMoveCameraRigMethods
{
/// <summary>

Просмотреть файл

@ -10,6 +10,9 @@ namespace Unity.Labs.EditorXR.Interfaces
{
}
/// <summary>
/// Extension methods for implementors of IUsesPlaceSceneObject
/// </summary>
public static class UsesScenePlacementMethods
{
/// <summary>

Просмотреть файл

@ -10,6 +10,9 @@ namespace Unity.Labs.EditorXR.Interfaces
{
}
/// <summary>
/// Extension methods for implementors of IUsesPlaceSceneObjects
/// </summary>
public static class UsesPlaceSceneObjectsMethods
{
/// <summary>

Просмотреть файл

@ -11,15 +11,18 @@ namespace Unity.Labs.EditorXR.Interfaces
{
}
/// <summary>
/// Extension methods for implementors of IUsesPreviewInToolsMenuButton
/// </summary>
public static class UsesPreviewInToolsMenuButtonMethods
{
/// <summary>
/// Highlights a ToolMenuButton when a menu button is highlighted
/// </summary>
/// <param name="user">The functionality user</param>
/// <param name="rayOrigin">Transform: Ray origin to check</param>
/// <param name="toolType">Type: MenuButton's tool type to preview</param>
/// <param name="toolDescription">String: The tool description to display as a Tooltip</param>
/// </summary>
public static void PreviewInToolsMenuButton(this IUsesPreviewInToolsMenuButton user, Transform rayOrigin, Type toolType, string toolDescription)
{
#if !FI_AUTOFILL

Просмотреть файл

@ -10,6 +10,9 @@ namespace Unity.Labs.EditorXR.Interfaces
{
}
/// <summary>
/// Extension methods for implementors of IUsesRayVisibilitySettings
/// </summary>
public static class UsesRayVisibilitySettingsMethods
{
/// <summary>

Просмотреть файл

@ -10,14 +10,17 @@ namespace Unity.Labs.EditorXR.Interfaces
{
}
/// <summary>
/// Extension methods for implementors of IUsesRaycastResults
/// </summary>
public static class UsesRaycastResultsMethods
{
/// <summary>
/// Method used to test hover/intersection
/// Returns the first GameObject being hovered over, or intersected with
/// Test hover/intersection
/// </summary>
/// <param name="user">The functionality user</param>
/// <param name="rayOrigin">The rayOrigin for intersection purposes</param>
/// <returns>The first GameObject being hovered over, or intersected with</returns>
public static GameObject GetFirstGameObject(this IUsesRaycastResults user, Transform rayOrigin)
{
#if FI_AUTOFILL

Просмотреть файл

@ -9,6 +9,9 @@ namespace Unity.Labs.EditorXR.Interfaces
{
}
/// <summary>
/// Extension methods for implementors of IUsesRequestFeedback
/// </summary>
public static class UsesRequestFeedbackMethods
{
/// <summary>

Просмотреть файл

@ -9,6 +9,9 @@ namespace Unity.Labs.EditorXR.Interfaces
{
}
/// <summary>
/// Extension methods for implementors of IUsesRequestStencilRef
/// </summary>
public static class UsesRequestStencilRefMethods
{
/// <summary>

Просмотреть файл

@ -9,6 +9,9 @@ namespace Unity.Labs.EditorXR.Interfaces
{
}
/// <summary>
/// Extension methods for implementors of IUsesResetWorkspaces
/// </summary>
public static class UsesResetWorkspacesMethods
{
/// <summary>

Просмотреть файл

@ -11,6 +11,9 @@ namespace Unity.Labs.EditorXR.Interfaces
{
}
/// <summary>
/// Extension methods for implementors of IUsesSceneRaycast
/// </summary>
public static class UsesSceneRaycastMethods
{
/// <summary>

Просмотреть файл

@ -11,6 +11,9 @@ namespace Unity.Labs.EditorXR.Interfaces
{
}
/// <summary>
/// Extension methods for implementors of IUsesSelectObject
/// </summary>
public static class UsesSelectObjectMethods
{
/// <summary>

Просмотреть файл

@ -11,17 +11,20 @@ namespace Unity.Labs.EditorXR.Interfaces
{
}
/// <summary>
/// Extension methods for implementors of IUsesSelectTool
/// </summary>
public static class UsesSelectToolMethods
{
/// <summary>
/// Method used to select tools from the menu
/// Returns whether the tool was successfully selected
/// </summary>
/// <param name="user">The functionality user</param>
/// <param name="rayOrigin">The rayOrigin that the tool should spawn under</param>
/// <param name="toolType">Type of tool to spawn/select</param>
/// <param name="despawnOnReselect">Despawn the tool, if re-selected while already the current tool</param>
/// <param name="hideMenu">Whether to hide the menu after selecting this tool</param>
/// <returns>Whether the tool was successfully selected</returns>
public static bool SelectTool(this IUsesSelectTool user, Transform rayOrigin, Type toolType, bool despawnOnReselect = true, bool hideMenu = false)
{
#if FI_AUTOFILL
@ -32,10 +35,12 @@ namespace Unity.Labs.EditorXR.Interfaces
}
/// <summary>
/// Returns true if the active tool on the given ray origin is of the given type
/// Check if the active tool on the given ray origin is of the given type
/// </summary>
/// <param name="user">The functionality user</param>
/// <param name="rayOrigin">The ray origin to check</param>
/// <param name="type">The tool type to compare</param>
/// <returns>True if the active tool on the given ray origin is of the given type</returns>
public static bool IsToolActive(this IUsesSelectTool user, Transform rayOrigin, Type type)
{
#if FI_AUTOFILL

Просмотреть файл

@ -10,6 +10,9 @@ namespace Unity.Labs.EditorXR.Interfaces
{
}
/// <summary>
/// Extension methods for implementors of IUsesSetDefaultRayColor
/// </summary>
public static class UsesSetDefaultRayColorMethods
{
/// <summary>

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше