VSCode in Unity

onedayitwillmake No Comments

If you’re tired of MonoDevelop’s editing capabilities, you should try VSCode!
It’s super snappy, and lightweight

Screen Shot 2016-08-24 at 1.36.38 PM

  1. Download VSCode insiders edition
  2. Install the C# 1.3.0 support
  3. Install mono debugger
  4. brew install mono (need this for intellisense to work)
  5. In unity, open C# project by going to Assets > Open C# Project In Code (don’t just double click a file)

Running a python/shell script from the UnityEditor

onedayitwillmake No Comments

While working on your game, sometimes you develop little python or shell scripts that help along the process, and it’d be nice to run them from the editor.
Or better yet, during your automated build process, have it call out to this from within Unity.

It’s actually quite simple, and you can even capture the output into the editor.

[MenuItem("MyGame/Downscale Reference Textures")]
public static void DownscaleRefTextures() {
        // using System.Diagnostics;
    Process p = new Process();
    p.StartInfo.FileName = "python";
    p.StartInfo.Arguments = "resize_reference_sprites.py";    
        // Pipe the output to itself - we will catch this later
    p.StartInfo.CreateNoWindow = true;
       // Where the script lives
    p.StartInfo.WorkingDirectory = Application.dataPath+"/SpriteCollections/"; 
    p.StartInfo.UseShellExecute = false;
        // Read the output - this will show is a single entry in the console - you could get  fancy and make it log for each line - but thats not why we're here
    UnityEngine.Debug.Log( p.StandardOutput.ReadToEnd() );