Skip to content

Tools and Features

Andrew Rumak edited this page Feb 28, 2019 · 13 revisions

AssetPressetPreprocessor — Conditionally apply Presets to your assets on import
TimeTest — Measure performance with simple api
Features — Cleanup Empty Directories, AutoSave featur, Hotkeys


AssetPressetPreprocessor

Tool to unleash true power of Preset assets and rid off of AssetPostprocessor scripts.

  1. Create some Presets! 😉

  2. Access this tool via "Tools/MyBox/Postprocess Preset Tool" menu item.

  3. First time accessed you'll see Save Folder Panel prompt to create AssetsPresetPostprocessBase asset.

  4. Either use menu item again or manually select this asset to access its inspector.

  5. Fill up ConditionalPresetsBase with your presets! Conditions supported: "Path contains", "FileType", "Prefix", "Postfix".

    You may reorder Conditional Preset items. First item that match all conditions will be applied.

  6. Reimport existing assets. Newly imported assets will be set up accordingly.

AssetPressetPreprocessor

note that Presets will apply all import settings and sometimes you'll don't want that. For example, you probably will want to keep SpriteBorder setting of your sprites. You able to exclude such properties through ConditionalPresetsBase inspector. SpriteBorder excluded by default. Push "Apply Excludes" button to update existing ConditionalPresets.

Please contact me if you'll find out some other properties that should be excluded by default


TimeTest

TimeTest is a tool to benchmark code with simple api

// Use static methods
TimeTest.Start(string title, bool useMilliseconds = false)
...
TimeTest.End()
// Or as disposable with using statement
using (new TimeTest(string title, bool useMilliseconds = false))
{
  ...
}

Example:

TimeTest.Start("1k GO creation", true);
		
List<GameObject> objects = new List<GameObject>();
for (var i = 0; i < 1000; i++)
{
  objects.Add(new GameObject("Object No" + i));
}

TimeTest.End();

using (new TimeTest("Massive parenting"))
{
  Transform parent = null;
  foreach (var o in objects)
  {
    if (parent == null)
    {
      parent = o.transform;
      continue;
    }
    o.transform.SetParent(parent);
    parent = o.transform;
  }
}

TimeTest Example


Cleanup Empty Directories and AutoSave features and some Hotkeys

Cleanup feature will remove empty folders on save. No more pesky .meta files for empty folders in your vcs 🙌

AutoSave will save your scenes on Playmode. You'll be glad it's on, especially if Unity will crash a few times in a row

Toggle Inspector Lock hotkey [Alt+Q] is with me for years. I don't know how I'd survive without it. It is SOOO EXHAUSTING to toggle inspector lock manually 😩

Both features located in "Tools/MyBox/" menu and may be disabled (enabled by default)

Features


//TODO: ImageStringConverter

SerializedPropertyViewer

Clone this wiki locally