Giter Site home page Giter Site logo

tokars / unityscenereference Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nibblebyte/unityscenereference

0.0 0.0 0.0 117 KB

Simple way to reference a scene in Unity without typing manually the scene path.

License: MIT License

C# 99.31% Batchfile 0.69%

unityscenereference's Introduction

Unity SceneReference

Keeps reference to a scene asset and tracks it's path in the editor, so it can be used in the game runtime.

Why

It's a well known fact that scenes can't be referenced like prefabs, textures etc. The Unity SceneManager API works with relative scene paths or names.

Use this class to avoid manually typing and updating scene path strings - it will try to do it for you as best as it can, including when building the player.

Installation

npm install -g openupm-cli
openupm add devlocker.utils.scenereference

openupm

  • Github upm package - merge this to your Packages/manifest.json
{
  "dependencies": {
    "devlocker.utils.scenereference": "https://github.com/NibbleByte/UnitySceneReference.git#upm"
}

Features

  • The SceneReference class works on lists, scriptable objects, game objects, multiple-select.
  • Small button on the right to add or remove from the build settings. The +/- sign and color indicate what the operation would be.
  • Paths are updated during build (guaranteed by the ISerializationCallbackReceiver).

Here is how it looks like:
SceneReference

Here is how it looks in debug mode (what data is stored):
SceneReferenceDebug

Here is how it looks in the code:
SceneReferenceCode

Credits & Similar Projects

Using the ISerializationCallbackReceiver was inspired by the JohannesMP's SceneReference implementation.

Another solution that builds a runtime look-up table instead of storing paths in the data members is Eflatun.SceneReference.

unityscenereference's People

Contributors

nibblebyte avatar

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.