Categories
Unity3D Unity3D-tips

Use shift-N to create new scripts in Unity Project Window, fast

In Unity, you create new scripts many times per day, and folders but there’s no keyboard shortcuts. I fixed this, and made the popup rather more intelligent than Unity’s built-in one. I’ve decided to make the basic version available for free here:

UPDATE: there’s a bug in the 1.0 version – it WILL NOT WORK if you set your Project window to 2-column layout. This is due to BUGS IN UNITY (not my code!). I have a workaround that’s in the Asset Store version, but is missing from the free version. I’ll patch it later

FreeIntelligentNew.dll – I’m not supporting this; it’s free: use at your own risk.

Or, for $2, you can get the latest version with full source code from Asset Store – I’m supporting + updating this.

Installation

Drag/drop the DLL into any folder named “Editor” in your project.

(required by Unity; this is how they make sure that Editor scripts aren’t accidentally included in your final game)

Usage

  1. Select the Project panel
  2. Hit shift-N
  3. By default, it intelligently guesses if you wanted a new Folder or a new Script. If it guessed wrong, hit “tab” to cycle through the options
  4. Choose a name and hit Enter (like normal in Unity). Done!

How…?

This works by peeking into some of Unity’s internals and detecting which EditorWindow has focus. If it’s the Project window, it uses some hardcoded constants (which differ between Unity versions, due to bugs they gradually fix, I think) to get the positions right, and offer you the popup.

I did it this way because Unity currently provides NO PUBLIC API for reproducing some of their core Editor features (e.g. where they temporarily change the render-style of the “newly-created item” in a Unity windowpane, so that you can edit the name in-line. Not possible for you or I!)

With a bit more hacking, I might be able to hook Unity’s own code and enable / trigger / alter the hidden features from keyboard, but … that’s on the wrong side of “Fragile; would probably break unexpectedly in a future version”.

How I’ve done it so far it sits independently of Unity’s code, and is very unlikely to stop working, or to cause bugs later on. YMMV…

(if you want to know more, get the Asset Store version, read the source. I’m happy to answer quetsions via the support links or in the Unity Forums page for this)

Categories
entity systems programming

Entity ID’s: how big, using UUIDs or not, why, etc?

This has come up a few times, and I ended up replying on Twitter:

But that’s a crappy way to find things later, so I made a quick-and-dirty infographic with a few key points:

Docs-entityID

Categories
advocacy games industry games publishing marketing and PR Unity3D usability

6 ways to massively improve the #unity3d AssetStore (for #gamedev’s)

Six months ago I tweeted a handful of obvious ways that you could make the Unity Asset Store greatly more profitable.

One of the Unity folk reached out to me, claimed that Unity was highly invested in improving this and asked for specific suggestions. So I wrote longer, detailed versions of each tweet and emailed them.

It’s been six months. No response. So … for Unity’s competitors, maybe looking to make/improve their own Asset Stores (or newcomers hoping to unseat the incumbents), here’s six obvious commercial improvements.

I’ve cut a few paragraphs I wrote to Unity about who I think their 3 main audiences are on the Asset Store; I included them as a “here are the assumptions I’m making” – I have no idea what their real audiences are. So I omitted that here.

NB: I’ve made the formatting webpage friendly, added some details, but this is essentially an info dump. I was too busy at the time to sugar-coat it – I figured that if Unity wanted to talk, I’d talk to them, and in person I’m really quite friendly and gentle. But at the time we were working 24/7 getting ready for a major exhibition, so this is a bit … terse.