Show YOUR editor scripts with a screenshot

While I was just writing a new page in the Unify Wiki about a cool editor script I just created with the help of Aras, I thought it would be cool to see what editor scripts other developers use in their projects.

So I thought I start with a screenshot of Hard Rock Racing’s editor scripts menu item.

Might be a helpful thing to see what other people do with editor scripts! Want to share a screenshot of your editor scripts? :slight_smile:

Fun!

Here’s a screenshot of some of the top-secret functionality that will be included in Whirld 3.1 :slight_smile:

Thanks for starting this Martin. We definitely need more appreciation around here for Editor scripts :smile: They are so handy.

Here’s mine. I call it VBee - VoxelBoy Editor Extensions. Quite egomaniacal, I know :slight_smile:

It’s a collection of tools that makes object placement and lighting easier. I meant to release this a while ago but I can never get past the “OK, this is somewhat complicated, let’s record some video tutorials” stage.

One problem I have with Editor scripts that interact with the Scene view is that you have to use the Editor class which is only usable through the Inspector by having an object selected. EditorWindow is nice in that you can create a new dockable window, but then it can’t receive Scene view input. So I had to work around it by creating a Console that was an EditorWindow but tie it to an Editor that showed up in an Inspector tab that I lock and hide away.

@Martin I am interested in your script “Place GO Selection on Surface”.

Did you find it somewhere?
If its yours can you provide it?

Thanks

Here we go!

Here’s my A* editor script.

I have no idea where I got it from. I just looked at the wiki, but couldn’t find it there. Anyway, here it is. But it became obsolete with 2.6’s place-on-surface function if you hold shift and apple, click the center of the GO’s gizmo and move it around (pivot point must be set to center in the top of Unity).

using UnityEngine;
using UnityEditor;
 
 public class PlaceSelectionOnSurface : ScriptableObject
 {
    [MenuItem ("Tools/Place GO Selection On Surface")]
    static void CreateWizard ()
    {
        Transform[] transforms = Selection.GetTransforms(SelectionMode.Deep |
            SelectionMode.ExcludePrefab | SelectionMode.OnlyUserModifiable);
        
        if (transforms.Length > 0  EditorUtility.DisplayDialog("Place Selection On Surface?",
            "Are you sure you want to place " + transforms.Length +
            ((transforms.Length > 1) ? " objects" : " object") +
            " on the surface in the -Y direction?", "Place", "Do Not Place"))
        {
            foreach (Transform transform in transforms)
            {
                RaycastHit hit;
                if (Physics.Raycast(transform.position, Vector3.down, out hit))
                {
                    transform.position = hit.point;
                    Vector3 randomized = Random.onUnitSphere;
                    randomized = new Vector3(randomized.x, 0F, randomized.z);
                    transform.rotation = Quaternion.LookRotation(randomized, hit.normal);
                }
            }
        }
    }
 }