GithubHelp home page GithubHelp logo

unityrepl's Introduction

OVERVIEW

UnityREPL is a REPL (Read, Eval, Print, Loop) tool based on Miguel’s CSharpRepl but for Unity.

What’s a REPL? See the Wikipedia article. or the demo videos on the Wiki.

INSTALLATION

Please note that this requires UnityGUIExtensions. The .unitypackage includes everything you need

NON-GIT, OR UNITY-INDIE SETUP

  • Grab the .unitypackage from the downloads page.
  • Open your project.
  • Click “Assets” → “Import Package…” from the menu, and select the file.

GIT SETUP IN A UNITY-PRO PROJECT THAT IS NOT VERSIONED WITH GIT

You must have External Version Control enabled to use these instructions. If not, please download the .unitypackage and use that.

  cd myproject/
  mkdir -p Assets/Editor/
  git clone git://github.com/MrJoy/UnityREPL.git Assets/Editor/UnityREPL
  git clone git://github.com/MrJoy/UnityGUIExtensions.git Assets/UnityGUIExtensions

By setting up this way, you can track updates using “git pull”.

GIT SETUP IN A UNITY-PRO PROJECT VERSIONED WITH GIT

You must have External Version Control enabled to use these instructions. If not, please download the .unitypackage and use that.

  cd myproject/
  mkdir -p Assets/Editor
  git submodule add git://github.com/MrJoy/UnityREPL.git Assets/Editor/UnityREPL
  git submodule add git://github.com/MrJoy/UnityGUIExtensions.git Assets/UnityGUIExtensions
  git submodule init
  git submodule update

USAGE

  • Click “Window” → “C# Shell”
  • Dock the new tab wherever you wish, and enjoy!

From this window you can enter C# code and run it. You should have access to all classes you’ve defined in C#, JavaScript, or Boo in your project.

COMPATIBILITY

Tested on Unity 5.3.1, but should work on slightly earlier versions down to, perhaps 5.0.

Will definitely not work on older versions of Unity (4.x and below).

DOCUMENTATION

Full documentation is available from within UnityREPL by clicking the ‘?’ button on the toolbar.

LICENSE

All original/novel code is Copyright © 2009-2016 Jon Frisby. All other code is the property of the respective authors.

Dual licensed under the terms of the MIT X11 or GNU GPL, as per the original code.

The included Mono.CSharp.dll is a completely unmodified copy from Mono 2.4., please see the Mono Project for details on obtaining source to it.

TODO

  • Undo functionality.
  • Editing history support (Bash style).
  • Smooth out some hiccups with assembly reloads.
    • Local vars getting blown away.
    • Make sure we’re not leaking references to things.
  • Add things to UnityBaseClass to help with Unity workflows.
  • Lots of other little things; see the source code for more info.

unityrepl's People

Contributors

mrjoy 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

unityrepl's Issues

Evaluator fails to load assemblies with .Net 4.x Equivalent Scripting Runtime

After setting the Scripting Runtime Version to .Net 4.x Equivalent , I get the following error

NullReferenceException: Object reference not set to an instance of an object
Mono.CSharp.PredefinedAttribute.Resolve (System.Boolean canFail) (at <c8c039196d284944be96b9057c4d6976>:0)
Mono.CSharp.TypeManager.IsThisOrFriendAssembly (System.Reflection.Assembly assembly) (at <c8c039196d284944be96b9057c4d6976>:0)
Mono.CSharp.Namespace.RegisterExternalExtensionMethodClass (System.Type type) (at <c8c039196d284944be96b9057c4d6976>:0)
Mono.CSharp.RootNamespace.RegisterExtensionMethodClass (System.Type t) (at <c8c039196d284944be96b9057c4d6976>:0)
Mono.CSharp.RootNamespace.ComputeNamespaces (System.Reflection.Assembly assembly, System.Type extensionType) (at <c8c039196d284944be96b9057c4d6976>:0)
Mono.CSharp.RootNamespace.ComputeNamespace (Mono.CSharp.CompilerContext ctx, System.Type extensionType) (at <c8c039196d284944be96b9057c4d6976>:0)
Mono.CSharp.GlobalRootNamespace.ComputeNamespaces (Mono.CSharp.CompilerContext ctx) (at <c8c039196d284944be96b9057c4d6976>:0)
Mono.CSharp.Evaluator.ReferenceAssembly (System.Reflection.Assembly a) (at <c8c039196d284944be96b9057c4d6976>:0)
EvaluationHelper.TryLoadingAssemblies (System.Boolean isInitialized) (at Assets/Editor/UnityREPL/Evaluator.cs:35)
EvaluationHelper..ctor () (at Assets/Editor/UnityREPL/Evaluator.cs:21)
Shell..ctor () (at Assets/Editor/UnityREPL/Shell.cs:47)
UnityEditorInternal.InternalEditorUtility:LoadSerializedFileAndForget(String)
UnityEditor.WindowLayout:LoadWindowLayout(String, Boolean)

This exception happens for all the assemblies from AppDomain.CurrentDomain.

Intermittent exception....

Occasional exceptions showing up. I suspect it's an order-of-operations issue involving the history being updated at the wrong time. Need to track history length and update it at the top of the layout event.

----snip----

ArgumentException: Getting control 0's position in a group with only 0 controls when doing KeyDown
Aborting

UnityEngine.GUILayoutGroup.GetNext ()
UnityEngine.GUILayoutUtility.DoGetRect (Single minWidth, Single maxWidth, Single minHeight, Single maxHeight, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options) [0x00000]
UnityEngine.GUILayoutUtility.GetRect (Single width, Single height, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options) [0x00000]
UnityEngine.GUILayout.FlexibleSpace ()
Shell.ShowHistory () (at Assets\Lib\Editor\MrJoy-UnityREPL-85117ec\MrJoy-UnityREPL-85117ec\Shell.cs:603)
Shell.OnGUI () (at Assets\Lib\Editor\MrJoy-UnityREPL-85117ec\MrJoy-UnityREPL-85117ec\Shell.cs:619)
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000]

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.