Giter Site home page Giter Site logo

extendrealityltd / zinnia.unity Goto Github PK

View Code? Open in Web Editor NEW
320.0 24.0 38.0 3.84 MB

A collection of design patterns for solving common problems.

Home Page: http://vrtk.io

License: MIT License

C# 100.00%
virtual reality vr unity3d unity3d-plugin oculus-rift steamvr windows-mixed-reality daydream cardboard

zinnia.unity's Introduction

Zinnia logo

Zinnia

A collection of design patterns for solving common problems.

[zin-ee-uh]

Release License Backlog

Introduction

Zinnia is a collection of design patterns for the Unity software that can be beneficial in (but not limited to) spatial computing development.

Requires the Unity software version 2018.3.10f1 (or above).

Getting Started

Setting up a project

  • Using the Unity software version 2018.3.10f1 (or above), create a new project using the 3D Template or open an existing project.
  • Ensure the project Scripting Runtime Version is set to .NET 4.x Equivalent.
    • In the Unity software select Main Menu -> Edit -> Project Settings to open the Project Settings inspector.
    • Select Player from the left hand menu in the Project Settings window.
    • In the Player settings panel expand Other Settings.
    • Ensure the Scripting Runtime Version is set to .NET 4.x Equivalent.

Adding the package to the Unity project manifest

  • Navigate to the Packages directory of your project.

  • Adjust the project manifest file manifest.json in a text editor.

    • Ensure https://registry.npmjs.org/ is part of scopedRegistries.
      • Ensure io.extendreality is part of scopes.
    • Add io.extendreality.zinnia.unity to dependencies, stating the latest version.

    A minimal example ends up looking like this. Please note that the version X.Y.Z stated here is to be replaced with the latest released version which is currently Release.

    {
      "scopedRegistries": [
        {
          "name": "npmjs",
          "url": "https://registry.npmjs.org/",
          "scopes": [
            "io.extendreality"
          ]
        }
      ],
      "dependencies": {
        "io.extendreality.zinnia.unity": "X.Y.Z",
        ...
      }
    }
  • Switch back to the Unity software and wait for it to finish importing the added package.

Running the tests

If you want to run the tests that come with Zinnia please follow these steps.

Because Zinnia is a package tests have to be explicitly enabled for this package, before the Test Runner can pick them up.

  • Navigate to the Packages directory of your project.

  • Adjust the project manifest file manifest.json in a text editor.

    • Ensure io.extendreality.zinnia.unity is part of testables.

    A minimal example ends up looking like this.

    {
      "scopedRegistries": [
        ...
      ],
      "testables": [
        "io.extendreality.zinnia.unity"
      ],
      "dependencies": {
        ...
      }
    }
  • As noted in the official Unity documentation:

    NOTE: You may need to re-import the package, because the test framework doesn't always immediately pick up changes to the testables attribute.

    • Within the Unity software's Project window expand the Packages node.
    • Right-click on the Zinnia.Unity child node and choose Reimport.
    • Wait for the Unity software to finish re-importing the package.
  • In the Unity software select Main Menu -> Window -> Test Runner.

  • Within the Test Runner window click on the PlayMode tab and the click Run All button.

  • If all the tests pass then the installation was successful.

Note: The tests are not compatible with the Run all in player option.

Updating to the latest version

The package will show up in the Unity Package Manager UI once the above steps have been carried out. From then on the package can be updated by selecting the package in the Unity Package Manager and clicking on the Update button or using the version selection UI.

Script Define Symbols

There are a collection of custom script define symbols that are included that can affect functionalities provided within Zinnia:

  • ZINNIA_IGNORE_CUSTOM_COLLAPSIBLE_DRAWER - Disables the collapsible event drawer functionality in the inspector windows.
  • ZINNIA_IGNORE_CUSTOM_INSPECTOR_EDITOR - Disables the custom zinnia inspector that handles automatically updating property values when changed in the inspector.
  • ZINNIA_IGNORE_CUSTOM_LIST_EDITOR - Disables the custom observable list editor in any version of Unity.
  • ZINNIA_IGNORE_PIPELINE_MATERIALS - Prevents the PipelineMaterialApplier from updating materials to match the current render pipeline mode.
  • ZINNIA_USE_CUSTOM_LIST_EDITOR - Force the custom observable list editor in the version of Unity 2020.3 or above.
  • ZINNIA_USE_ISACTIVEANDENABLED - Determines whether to use the behaviour.isActiveAndEnabled property on a behvaiour when calling the CheckIsActiveAndEnabled method instead of using the more robust behaviour.gameObject.activeInHierarchy && behaviour.enabled.

Naming

Inspired by the Zinnia genus of plants known for their colorful, long lasting flower heads and their great ease to grow from seeds. This repository, much like the Zinnia flower aims to be easy to use and allow your projects to grow and flourish into long lasting, easy to maintain solutions.

Fun Fact: Zinnias have been grown aboard the International Space Station and have demonstrated the capability to blossom in a weightless environment.

Contributing

Please refer to the Extend Reality Contributing guidelines and the Unity project coding conventions.

Code of Conduct

Please refer to the Extend Reality Code of Conduct.

License

Code released under the MIT License.

Disclaimer

These materials are not sponsored by or affiliated with Unity Technologies or its affiliates. "Unity" is a trademark or registered trademark of Unity Technologies or its affiliates in the U.S. and elsewhere.

zinnia.unity's People

Contributors

bddckr avatar dependabot-preview[bot] avatar extendreality avatar extendreality-bot avatar hbvmware avatar reznovvr avatar samuelacook avatar thestonefox avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

zinnia.unity's Issues

Ability to emit a signal when a controller input is received

The concept of signals will basically be events with extra controls to allow for things like controller input.

e.g. button press, axis changes

These will be agnostic for each SDK and will simply emit an event when a (controller) input is detected. Other scripts will then digest these signals to determine another course of action to occur.

This will decouple the input mechanisms to other scripts (such as turning on or off a pointer).

Apply colour overlay to screen

The ability to provide a colour overlay on the screen cameras to allow fading in and out or to simulate the "blink" action.

This can be useful for teleporting but won't be tied to the teleporter.

Modify a Transform with constraints (e.g. offset) with a potential transition time

The ability to modify a Transform's position, rotation, scale with a given offset Transform and to be able to perform the transition over a given duration.

This will enable movement of the play area using the headset as an offset position. The transition duration will enable the transform to lerp to it's new orientation.

This will enable teleporting and dash teleporting around a scene.

To be able to toggle an action based on any given signal

Rather than build the concept of toggling something on a button press (e.g. toggle pointer on/off)

the Toggle signal is an extension of a signal that will listen for a signal and then activate a toggle on action, then on the second digestion of a signal it will call the toggle off action.

This totally decouples the concept of toggling from all scripts and provide a single signal script for performing this task.

A pointer that emits a straight visible line with a cursor that reacts to other scene objects

This is the straight pointer but has no connection to teleporters or button input, a simple concept that simply emits a raycast and draws a straight pointer with a cursor that when interacts with objects in the scene will report the items it has entered, is hovering over, has exited and when it is selected.

It will be activatable by a simple method call and no button presses will be coupled to it.

Grab an object with a level of precognition

This allows someone to be initiating the grab action before the grab is valid.

E.g.

If you press the grip button before touching the object (within a second or so) then you still perform the grab. This helps with fast moving objects.

Ability to determine the nearest surface along a given Vector

To determine the nearest surface will be useful to replicate the Snap To Nearest Floor setting but without tying it into any teleport code.

The feature will simply cast a ray in a given direction (e.g. down) and find the nearest surface and report the position of that surface (again with an offset maybe of another object e.g. the headset).

This can then be used to report to move the camera rig down to the nearest surface on teleporting

String Identifier Rule

Environment

Source of VRTK: Github
Version of VRTK: release/3.3.0-alpha (e43089a)
Version of Unity3D (e.g. Unity 2017.3.0f3)
Hardware used (e.g. Vive)
SDK used (e.g. SteamVR)

Steps to reproduce

  1. Open "041_Controller_ObjectSnappingToDropZones"
  2. See that that "Valid Object List Policy" only supports Tags, Layers and Scripts
  3. The scene uses tags to identify correct objects
  4. In my game, i got > 100 snap drop zones/objects. Therefore I would need >100 different Tags/Layers/Scripts.

Expected behavior

I propose a forth Option for VRTK_PolicyList: "String Identifier"

If you chose VRTK_PolicyList.CheckType = "String Identifier"
Then VRTK_PolicyList.TypeCheck would check if the GameObject obj got an Script VRTK_PolicyListStringIdentifier. If so, it checks whether the string specified in VRTK_PolicyListStringIdentifier matches one identifier of VRTK_PolicyList.

Basically it's the same system like tags, but it don't mess up a projects tag-structure.

If you like it, I can start an PR immeadiatly, because I already programmed this change.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.