1. Help us improve the editor usability and artist workflows. Join our discussion to provide your feedback.
    Dismiss Notice
  2. We're looking for feedback on Unity Starter Kits! Let us know what you’d like.
    Dismiss Notice
  3. We’re giving 2017.1 beta testers a chance to win t-shirts and a Nintendo Switch. Read more on the blog.
    Dismiss Notice
  4. We want to know how you learned Unity! Help us by taking this quick survey and have a chance at a $25 gift card
    Dismiss Notice
  5. Are you an artist or level designer going to Unite Europe? Join our roundtables there to discuss artist features.
    Dismiss Notice
  6. Unity 5.6 is now released.
    Dismiss Notice
  7. Check out all the fixes for 5.6 on the patch releases page.
    Dismiss Notice

Livity - The Live Coding Tool for Unity

Discussion in 'Assets and Asset Store' started by bamboo, Aug 12, 2013.

  1. bamboo

    bamboo

    Joined:
    Oct 9, 2012
    Posts:
    121
    This has been fixed for 0.1.8.
     
  2. whydoidoit

    whydoidoit

    Joined:
    Mar 12, 2012
    Posts:
    367
    Should just point out to anyone browsing that bamboo has been able to make the Goto Symbol function instantaneous for C# now in a build 0.1.7 which I tried for him. Brilliant stuff. 5 * Review.
     
  3. bamboo

    bamboo

    Joined:
    Oct 9, 2012
    Posts:
    121
    Hi,

    A friend suggested I should change the default command palette shortcut to %L instead of the current %J as it's more mnemonic of Livity. I think that makes sense. My rationale for %J was that it seemed more ergonomic at first but having tried both for a while now I think they work equally well from that aspect.

    Any thoughts?

    Best wishes,
    Rodrigo
     
  4. whydoidoit

    whydoidoit

    Joined:
    Mar 12, 2012
    Posts:
    367
    Sounds good to me.
     
  5. Sashimi_2

    Sashimi_2

    Joined:
    Jun 26, 2013
    Posts:
    30
    Hi Bamboo,

    Thanks for the window issue fix in the new version!

    Regarding your question to %j and %l change....well.

    Right now is the time to change if you intend to change it, as livity is very new.
    But I advice to stay away from changing default hotkeys later on without any hardcore reason.
    You probably know yourself why, thats why you were kind enough to ask your current userbase :)

    I want to suggest to make this important hotkey set-able in the preferences menu so the user can choose to map %whatever without the need to make it per script, as this hotkey is a major "portal" to access all the "subfunctions"

    Cheers,
    Sash
     
  6. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    3,500
    My thoughts are you should put up a context menu, so I can right-click and choose "save" (etc), in addition to a key command. Because it's not really obvious that I need to type "command j", "s", "enter" to save. A context menu would make your cool plugin about twice as cool in my opinion. :)
     
  7. bamboo

    bamboo

    Joined:
    Oct 9, 2012
    Posts:
    121
    Hi Sash,

    Thanks for the feedback. In the end I decided not to change it :)

    Cheers,
    Rodrigo

     
  8. bamboo

    bamboo

    Joined:
    Oct 9, 2012
    Posts:
    121
    Hi Jaimi,

    Thanks for the feedback. 0.1.8 adds a context menu with save, close and related actions :)

    Cheers,
    Rodrigo

     
  9. angel_m

    angel_m

    Joined:
    Nov 4, 2005
    Posts:
    1,008
    Is the Livity editor taking up a window in the Unity editor? or it works like another script editor as a separate app?
    I would prefer the second solution because my Unity editor is already full packed with the rest of windows.
     
  10. PatHightree

    PatHightree

    Joined:
    Aug 18, 2009
    Posts:
    232
    Maybe this helps.
    You can undock a window from Unity and maximize it on a secondary monitor.
     
  11. UAF

    UAF

    Joined:
    Jun 24, 2013
    Posts:
    8
    Hi Bamboo,
    I'm new to Unity but I bought Livity because it looked like one of those must-have assets that can really improve workflow.
    I've yet to actually TRY its abilities like Live Coding and such so I can't comment about them yet (though the demo looked amazing).

    I'm still trying to figure out the shortcuts Livity uses (or how to set them if it doesn't).

    For example 'Go to definition', and if possible some way to go to the previous position in a document (like after checking a definition pressing some key combination that will take me to where I invoked the 'go to definition').

    I know the readme file have an example for that but its not very clear to me, and its written in boo (which I never touched or seen before)

    Can you please help me setting up my keyboard shortcuts for Livity?

    Also, a couple of suggestions for future versions of Livity:
    1) Some menu window to set up keyboard shortcuts for livity (Or at least an already made, very easy to edit file).
    2) I'd mention that Livity have settings under Edit->Preferences. I don't think it was mentioned clearly in the readme.
     
  12. UAF

    UAF

    Joined:
    Jun 24, 2013
    Posts:
    8
    One more thing.
    I understand that Livity works with VS - does it work with Mono?

    Because until Livity gets the powers of a full IDE (will it ever get those? Any idea when?) it can be nice to combine the features.

    Example for something currently missing:
    I created a class that should implement an interface, but I didn't really wrote an implementation for one of the interface's functions.
    I'm pretty sure right now Livity will not show me a warning specifying what is wrong.

    Hey can you make a Livity command to automatically create stubs that implement an interface? :)


    EDIT:
    I'm editing so I won't flood the thread with posts of my own.
    I made some progress with the shortcut example you provided earlier in this thread.
    I got a shortcut for save working (mapped to Ctrl+Alt+S)
    But for some reason I can't get it to work with GoTo:Definition

    I even managed to translate it to C# but the core of the issue remains (I hoped I'll understand better in C#...) - ExecuteCommand just can't find "Livity:GoTo:Definition"

    Code (csharp):
    1. using Livity.Collections;
    2. using Livity.Composition;
    3. using Livity.Text.Data;
    4. using Livity.Text.UI.Commands;
    5. using Livity.Text.UI.Editor;
    6. using UnityEngine;
    7.  
    8. [ExportAttribute(typeof(IKeyboardModeProvider))]
    9. class CustomKeyboardModeProvider : IKeyboardModeProvider
    10. {
    11.     public string Name { get { return "Mine2"; } }
    12.    
    13.     #region IKeyboardModeProvider implementation
    14.     public IKeyboardMode KeyboardModeFor (ITextEditor editor)
    15.     {
    16.         KeyBindings kbs = new KeyBindings();
    17.         kbs.Add("^s", () => editor.Operations.ExecuteCommand("Livity:Save"));      
    18.         kbs.Add("^g", () => editor.Operations.ExecuteCommand("Livity:GoTo:Definition"));   
    19.         return kbs;
    20.     }
    21.     #endregion
    22. }
    Maybe you could make some commands Enum?
     
    Last edited: Sep 26, 2013
  13. bamboo

    bamboo

    Joined:
    Oct 9, 2012
    Posts:
    121
    Hi angel_m,

    Livity is currently implemented as Unity editor window but as Pat said you can simply undock it from Unity and maximize it on a secondary monitor (ALT+SHIFT+ENTER).

    Its live coding capabilities however can be used from an external editor such as Visual Studio 2012 or Sublime and I'll be releasing plugins for both soon. And of course Emacs users will also be able to implement the required integration functionality (I'm looking at you, Fernando ;-)).

     
  14. bamboo

    bamboo

    Joined:
    Oct 9, 2012
    Posts:
    121
    Hi UAF,

    Thanks for your support!

    I'm sorry for the missing documentation, I'll be releasing a new update soon with all shortcuts documented.

    Coincidentally I'm implementing exactly that right now :)

    Good point, thanks!

    By Mono, do you mean MonoDevelop? I might implement MonoDevelop integration in the near future if there's enough popular demand.


    Right. Yes, Livity will get those powers such as refactoring and code generation in the future. The first set of features I intend to release are ALT+ENTER triggered commands for live coding such as "Make Live" (if you press ALT+ENTER on a function), "Watch Expression" (if you press ALT+ENTER with an expression selected) and so on. But "Implement Interface" and auto imports are high on the list too.


    Nice.

    That's an inconsistency in the current implementation of Livity commands, some commands such as GoToDefinition have Command Palette names (Livity:GoTo:Definition) which are optimized for discoverability and internal names (GoToDefinition) which are supposed to be stable like an API, currently when a command has both, ExecuteCommand will only accept the internal name. I'll fix that for the next version but in the meanwhile you can get your shortcut working by using the internal name.

    Cheers,
    Rodrigo
     
  15. UAF

    UAF

    Joined:
    Jun 24, 2013
    Posts:
    8
    Thanks, that worked!

    A couple of other things:
    1) Mapping S***+tab to Outdent Selectin causes some weird behavior (a combination of outdent and just pressing tab). I guess its some kind of bug.
    2) Can there be some command to refresh a file without saving it first? So if the file is edited in Mono (which reminds me your previous question - yes, by Mono I mean MonoDevelop) and saved there I can just refresh the Livity window. Currently I'll have to close and reopen the file.
     
  16. PatHightree

    PatHightree

    Joined:
    Aug 18, 2009
    Posts:
    232
    Just a quick question: Is there a cheatsheet that lists all commands?
    So far I've read the readme, but for a tool that isn't UI-based, it would be handy to have all commands listed for easy reference.
     
  17. UAF

    UAF

    Joined:
    Jun 24, 2013
    Posts:
    8
    I think I've found a bug:
    I created extension methods for Vector3 but Livity doesn't find them.
    Its not a code problem - MonoDevelop finds them and allow me to use them just fine.


    Also, when compiling my project with MonoDevelop I have 4 warnings from Livity's code. Please fix them (Or mark the code so it just won't raise the warnings)
     
  18. UAF

    UAF

    Joined:
    Jun 24, 2013
    Posts:
    8
    Another question (should I start doing those via mail?):
    How to I make Livity compile, so I'll see all the compiler error I have?
    (Save and Refresh didn't seem to do it)

    Also, how do I set script files so they will return to be opened by MonoDevelop?
     
    Last edited: Sep 28, 2013
  19. bamboo

    bamboo

    Joined:
    Oct 9, 2012
    Posts:
    121
    Hi UAF,

    shift+tab is indeed a problematic key combination, I'm still evaluating how to best handle it, best to steer away from it for now.

    I'll include the required API and command to handle reloading from disk in the next update due to Monday.

    Best wishes,
    Rodrigo


     
  20. bamboo

    bamboo

    Joined:
    Oct 9, 2012
    Posts:
    121
    Hi Pat,

    The command palette lists all available commands. Currently there's a lot of functionality that's not exposed via the command system but directly through the ITextEditor and ITextEditorOperations API, the VimstalgiaMode class and code completion should give you an idea of the kind of things that are possible.

    The next update should include a list of all keybindings.

    Best wishes,
    Rodrigo

     
  21. bamboo

    bamboo

    Joined:
    Oct 9, 2012
    Posts:
    121
    Thanks for the report, the completion system does have some limitations still.

    I'll fix those warnings for the next update.

    Best wishes,
    Rodrigo

     
  22. bamboo

    bamboo

    Joined:
    Oct 9, 2012
    Posts:
    121
    The forum works fine for me.

    Save and Refresh should cause Unity to recompile all code dependent upon the current file, if it doesn't you can try the regular Unity refresh command after that to see if it works for you but that's exactly what Livity is doing (AssetDatabase.Refresh).

    You can configure Livity file associations in the preferences window (the cog button on the top right corner) Unity Integration section or via the Unity preferences dialog, Livity section, "Unity Integration" at the very bottom.

    Best wishes,
    Rodrigo

     
  23. andyz

    andyz

    Joined:
    Jan 5, 2010
    Posts:
    660
    Got the Unityscript version, just tried the editor so far which is nice to have integrated - good autocomplete, but I am immediately missing the usual key commands for copy/paste/find etc. I'm not sure about the command palette as Ctrl-J is hard to press with 1 hand and the scroller appears broken.

    Also Unity only seems to re-compile when I do 'Save All and Refresh' which is confusing. Perhaps the other options are only relevant during live coding but the other save options become redundant for me when they don't cause a re-compile.
    Could the right click menu also include copy/paste/find/replace etc?

    I think this will be a great editor with a bit more work.
     
  24. bamboo

    bamboo

    Joined:
    Oct 9, 2012
    Posts:
    121
    Hi Andyz,

    Thanks for your support!

    The menu item 'Save And Refresh' was actually bound to the simple 'Save' command, this has been fixed for the next update as well as the scrolling of all popups (including the command palette).

    Copy, Cut, Paste and Find are bound to the usual platform specific shortcuts: CTRL+C/COMMAND+C, CTRL+X/COMMAND+X, CTRL+V/COMMAND+V and CTRL+F/COMMAND+F respectivelty. Let me know if for any reason these are not working for you.

    About the menu, yes, I'll be improving the command system and user interface around it quite a bit after the next update, you can expect those commands to show up in the menu soon.

    Best wishes,
    Rodrigo

     
  25. bamboo

    bamboo

    Joined:
    Oct 9, 2012
    Posts:
    121
    Hi UAF,

    After further investigation I've found out the 'Save And Refresh' menu item was actually bound to the simple 'Save' command. This has been fixed for the next update I'll be releasing later today.

    Best wishes,
    Rodrigo

     
  26. bamboo

    bamboo

    Joined:
    Oct 9, 2012
    Posts:
    121
    Hi UAF,

    I'm not getting any warnings on MonoDevelop with Unity 4.2.1f4.

    Could you please open a ticket on Livity's issue tracker with the warnings you're getting so I can investigate further?

    Thanks,
    Rodrigo

     
  27. bamboo

    bamboo

    Joined:
    Oct 9, 2012
    Posts:
    121
    By the way, you can set your own keyboard shortcut for the command palette by saving the following UnityScript snippet to an editor script and editing the MenuItem string accordingly:
    Code (csharp):
    1.  
    2.     @MenuItem("Window/Livity/My Command Palette %g")
    3.     static function MyCommandPalette() {
    4.         Livity.Text.UI.Editor.Commands.CommandPaletteMenuItems.OpenCommandPalette();
    5.     }
     
  28. andyz

    andyz

    Joined:
    Jan 5, 2010
    Posts:
    660
    Ok yes copy paste are working, not sure what happened before! The find box appearing at the bottom was a little different to what I am used to, I would definitely like a nice find/replace popup but I see there is much too come.
     
  29. bamboo

    bamboo

    Joined:
    Oct 9, 2012
    Posts:
    121
  30. 3D Omelette Studio

    3D Omelette Studio

    Joined:
    Oct 1, 2013
    Posts:
    130
    Nice tool,
    any chance for a free trial?
     
  31. angel_m

    angel_m

    Joined:
    Nov 4, 2005
    Posts:
    1,008
    Are you going to implement menu options (apart from the key bindings) for main functions as:
    save, copy, paste, undo, close... ?
     
  32. bamboo

    bamboo

    Joined:
    Oct 9, 2012
    Posts:
    121
    Hi angel_m,

    save and close are already available as part of the context menu and via Window / Livity / Documents.

    Others will follow.

    Best wishes,
    Rodrigo

     
  33. bamboo

    bamboo

    Joined:
    Oct 9, 2012
    Posts:
    121
    I'm still considering that option.

     
  34. Beervangeer

    Beervangeer

    Joined:
    Dec 4, 2012
    Posts:
    12
    Hi there,

    Since I started using livity for c# , I cant open MonoDevelop anymore.
    Any ideas why?

    Greetings
     
  35. Beervangeer

    Beervangeer

    Joined:
    Dec 4, 2012
    Posts:
    12
    I also have a problem with undo-ing things, its not working.
     
  36. bamboo

    bamboo

    Joined:
    Oct 9, 2012
    Posts:
    121
    Hi Beervangeer,

    This is most probably caused by Livity taking over the opening of script files. You can change the file associations in the Livity preferences window, Unity integration section. You can access Livity preferences via the cog button on the top right corner of the Livity window or via the standard Unity preferences menu item.

    Best wishes,
    Rodrigo

     
  37. Beervangeer

    Beervangeer

    Joined:
    Dec 4, 2012
    Posts:
    12
    Im sorry. It seems to be a bug in the new unity. I just updated Unity and now I can start monodevelop anymore..
    Good that I have livity ! :p
     
  38. bamboo

    bamboo

    Joined:
    Oct 9, 2012
    Posts:
    121
    Due to the way Unity implements undo as a scene based concept Livity can't currently respond to the standard Ctrl+Z/Command+Z key bindings.

    Use Alt+Z on Windows and Ctrl+Z on OSX.

    A complete list of key bindings is included in the latest update (KeyBindings.md).

    Cheers,
    Rodrigo

     
  39. bamboo

    bamboo

    Joined:
    Oct 9, 2012
    Posts:
    121
    Actually it has much less to do with the scene based undo model than to editor windows not being able to handle global shortcuts.

     
  40. Beervangeer

    Beervangeer

    Joined:
    Dec 4, 2012
    Posts:
    12
    thanks for the quick effecient reply Bambo. Great plugin, thanks.
     
  41. pvloon

    pvloon

    Joined:
    Oct 5, 2011
    Posts:
    508
    Hows the visual studio 2012 plugin doing? As soon as you have that this'll become an essential tool for me!
     
  42. bamboo

    bamboo

    Joined:
    Oct 9, 2012
    Posts:
    121
    Hi p v loon,

    I'm almost done and I should be able to release it later this week!

    Cheers,
    Rodrigo

     
  43. Wampy

    Wampy

    Joined:
    Sep 9, 2013
    Posts:
    14
    Is there a way to collapse blocks of code/functions?
     
  44. bamboo

    bamboo

    Joined:
    Oct 9, 2012
    Posts:
    121
    Hi Wampy,

    Not yet but I plan to include that in a future version.

    Best wishes,
    Rodrigo

     
  45. Wampy

    Wampy

    Joined:
    Sep 9, 2013
    Posts:
    14
    Any reason this does not receive the proper variables if i use the @Live before it but if i remove it then everything is fine?

    function AnimateSprite(tileX: int, tileY: int, tileXStart :int, tileYStart: int, totalFrames: int, framesPerSecond: int)

    Im calling it with this

    AnimateSprite(8, 2, 0, 0, 16, 8 );

    It gets the first 4 right but receives the 16 as a 0....and 8 as a16. So basically the function recieves 8,2,0,0,0,16
     
    Last edited: Oct 19, 2013
  46. bamboo

    bamboo

    Joined:
    Oct 9, 2012
    Posts:
    121
    Hi Wampy,

    I was able to reproduce this behavior in a test case and I'm currently investigating it. I'll release an update with a fix ASAP.

    Thanks for the report!
    Rodrigo

     
  47. Wampy

    Wampy

    Joined:
    Sep 9, 2013
    Posts:
    14
    Awsome thanks
     
  48. G.E.Team

    G.E.Team

    Joined:
    Aug 21, 2013
    Posts:
    34
    It's Rocks. Is there any solution to use Livity C# features on Visual Studio 2012?
     
    Last edited: Oct 20, 2013
  49. bamboo

    bamboo

    Joined:
    Oct 9, 2012
    Posts:
    121
    I'll be releasing an update compatible with VS2012 Today.

     
  50. bamboo

    bamboo

    Joined:
    Oct 9, 2012
    Posts:
    121
    The bug has been fixed for the next update due to Today.