Introduction

Weaver is a Unity plugin which allows you to avoid using magic strings to reference assets, animations, layers, navigation areas, scenes, and shaders. This makes your code more efficient and robust to streamline development, debugging, and refactoring.

The following table summarises its main features and their availability in Weaver Lite (all features are fully available in Weaver Pro):

Feature Summary Weaver Lite
Asset Injection Attributes like [SerializeField], but for for static fields and properties (including private and readonly ones). Very useful for singletons and other global systems that would normally require some bad practices to set up. Editor-Only
Asset Lists Automatically gather all assets of a specific type in a particular folder into a strongly typed list. Editor-Only
Project Constants Procedurally generated scripts containing constants for animations, layers, navigation areas, scenes, and shaders so that you don't need to use magic strings in your code. Included, but no customisation
Procedural Assets The system used to generate those scripts can be used to generate any type of asset using code: prefabs, meshes, materials, textures, sounds, etc. Fully included
Object Pooling Easily and efficiently reuse objects to improve performance instead of creating and destroying them all the time. Fully included
Source Code Weaver is comprised of two DLLs: Kybernetik.Core.dll contains various general utilities while Weaver.dll contains the main functionality of Weaver itself. The source code is included and this site includes the full API Documentation. Only source of Kybernetik.Core.dll

Frequently Asked Questions

Question Answer
What are magic strings?

The term has various meanings, but in the context of Weaver, a magic string is a hard coded value in a script which refers to something outside that script. For example: Resources.Load("Goblins/Warrior") or LayerMask.NameToLayer("Creature").

There are two main groups of problems with such systems:

  • The string doesn't know about its target. Intellisense can't offer auto-complete suggestions and you can't tell if the string is actually valid just by looking at it. Spelling or naming mistakes aren't automatically identified.
  • And the target doesn't know if any strings are depending on it. Modifying the target (such as moving the file or renaming the layer) won't update the string and looking at the target won't even tell you if anything is depending on it (let alone which script or scripts contain the dependency).
Weaver helps you avoid those problems by avoiding magic strings in the first place.
Errors when importing Weaver. You must delete any previous versions of Weaver before importing a new one.
The WeaverWindow shows itself automatically. You can disable Auto Focus in the Miscellaneous Panel.
Help? Feel free to post in the Forum or send an email to mail@kybernetik.com.au.