GithubHelp home page GithubHelp logo

scenereference's Introduction

SceneReference.cs for Unity3D

Unity3D script, that allows assigning serializable references to scenes in inspector.
Works in editor and in build.
Based on https://github.com/starikcetin/unity-scene-reference

Instalation

Install as git package,
or just drop SceneReference.cs anywhere in your "Assets" folder.

Usage

  1. Add using Tymski;
  2. Make a field in your script
    public SceneReference scene; 
  1. In inspector, reference your scene
    Scene field

  2. Load your scene

    SceneManagement.SceneManager.LoadScene(scene);

scenereference's People

Contributors

tymski avatar

Stargazers

 avatar p2or avatar Froms avatar Vladimir Belousov avatar  avatar Poolnudel avatar VerzatileDev avatar César Zárate avatar Sangmin Lee avatar 이건한 avatar Gregg avatar David Dempsey avatar Adam avatar Matheus Santana avatar Alexandre Pimentel avatar  avatar Adam Krupicka avatar Mikkel avatar Vadim Filatov avatar Felix Gagne avatar  avatar Saba Shaw avatar Ale avatar  avatar themasky7 avatar Massimiliano Glitch avatar Hayley Davies avatar jerryc05 avatar Hullo I'm Jay avatar Enrico Speranza avatar mika avatar Endar avatar Ģirts Ķesteris avatar  avatar Osman Zeki avatar

Watchers

James Cloos avatar  avatar Felix Gagne avatar

scenereference's Issues

Can crash when building

Because there can be two different assemblies in Unity projects (one for runtime and one for editor) there is an issue in the script.

#if UNITY_EDITOR
using UnityEditor;
using UnityEditor.SceneManagement;
#endif

All you need to do is wrap the using statements where it is calling for the editor in a pre-processor directive to ensure that it's only compiled if you're in the editor.

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.