All Projects → ByronMayne → Weaver

ByronMayne / Weaver

Weaver is a code weaving framework built right into Unity Engine. Based heavily off of Fody.

Programming Languages

csharp
926 projects

Projects that are alternatives of or similar to Weaver

Nexplayer unity plugin
Stream videos in HLS & DASH with Widevine DRM using NexPlayer Video Streaming Player SDK for Unity on Android & iOS devices
Stars: ✭ 73 (-6.41%)
Mutual labels:  unity, unity3d
Unity3d Dynamicallyloadinganimation
👾 Unity3D Loading and unloading animations at runtime (Example)
Stars: ✭ 74 (-5.13%)
Mutual labels:  unity, unity3d
Drawmeshwithmotionvectors
An example showing how to generate per-object motion vectors when using DrawMesh.
Stars: ✭ 65 (-16.67%)
Mutual labels:  unity, unity3d
3 Modifiers And Abilities
Customise character abilities, weapons, characters and enemies. This includes multiple damage types, modifiers, sounds, animations. By the end you can create your core combat experience. (REF MA_RPG) http://gdev.tv/rpggithub
Stars: ✭ 64 (-17.95%)
Mutual labels:  unity, unity3d
3dxrayshader unity
Surface shader. Clips a Model with given plane , applies fresnel on clipped part and highlights the cross section.
Stars: ✭ 73 (-6.41%)
Mutual labels:  unity, unity3d
09 Zombierunner Original
First person shooter with Unity terrain and AI pathfinding (http://gdev.tv/cudgithub)
Stars: ✭ 64 (-17.95%)
Mutual labels:  unity, unity3d
Unimic
A wrapper for Unity's Microphone class.
Stars: ✭ 65 (-16.67%)
Mutual labels:  unity, unity3d
Ksframework
QQ Group:538722494,KSFramework = KEngine + SLua(or xLua) , Unity3D Framework/Toolsets focus on hot reload
Stars: ✭ 1,119 (+1334.62%)
Mutual labels:  unity, unity3d
Extosc
extOSC is a tool dedicated to simplify creation of applications in Unity with OSC protocol usage.
Stars: ✭ 69 (-11.54%)
Mutual labels:  unity, unity3d
Vfxgraphmodeling
Procedural modeling with Unity VFX Graph
Stars: ✭ 68 (-12.82%)
Mutual labels:  unity, unity3d
Dkvfxsketches
VFX sketches with Depthkit and Unity
Stars: ✭ 74 (-5.13%)
Mutual labels:  unity, unity3d
Bdframework.core
[中]Simple! Easy! Powerful Unity3d game workflow! Unity3d framework:c# hotfix(ILRuntime)、asset manager、ui workflow、network debug... and so on
Stars: ✭ 1,196 (+1433.33%)
Mutual labels:  unity, unity3d
Awesome Unity Open Source On Github
A categorized collection of awesome Unity open source on GitHub (800+)
Stars: ✭ 1,124 (+1341.03%)
Mutual labels:  unity, unity3d
Learning Unity Ecs 2
A bunch of small Unity projects where I explore and learn Unity's new ECS and Job System. Updated for the new API.
Stars: ✭ 65 (-16.67%)
Mutual labels:  unity, unity3d
Unity Scene Query
A library to traverse and query the Unity scene to find particular objects, uses something similar to CSS selectors to identify game objects.
Stars: ✭ 63 (-19.23%)
Mutual labels:  unity, unity3d
Sentry Unity
Sentry SDK for Unity3d
Stars: ✭ 66 (-15.38%)
Mutual labels:  unity, unity3d
Erbium
🤺Third Person Character Controller for unity🤺
Stars: ✭ 61 (-21.79%)
Mutual labels:  unity, unity3d
Unity Hierarchy Folders
Specialized folder objects for Unity Hierarchy.
Stars: ✭ 62 (-20.51%)
Mutual labels:  unity, unity3d
3d Game Shaders For Beginners
🎮 A step-by-step guide to implementing SSAO, depth of field, lighting, normal mapping, and more for your 3D game.
Stars: ✭ 11,698 (+14897.44%)
Mutual labels:  unity, unity3d
4dviewstest
4DViews volumetric video + Unity
Stars: ✭ 71 (-8.97%)
Mutual labels:  unity, unity3d

Weaver

A a code weaver built for use in Unity Engine. Based very heavily off of Fody. Implmented using Mono.Cecil.

What is Code Weaving?

Weaving refers to the process of injecting functionality into an existing program. This can be done conceptually at a number of levels:

  • Source code weaving would inject source code lines before the code is compiled
  • IL weaving (for .NET) adds the code as IL instructions in the assembly

A great example of this is the Unity Project Updater. It uses both versions of code weaving on your project. It uses text replacing for unsupported code in your source files and IL weaving for compiled dlls.

Weaver for now only uses IL Weaving which runs once every time an assembly is recompiled.

Features

  • Hooked into Unity callbacks to run automatically.
  • Filter only the assemblies you want to weave.
  • Validation for end user.
  • Custom logger.
  • Utility functions to write MSIL.

How To Use

Weaver is run using a single ScriptableObjects you will need to create a new instance for your project. Int Unity use the create menu to create a new instance.

Right click in the Project Window Create/Weaver/Settings

You Only Need One: Only one instance should exist in your project since every operation only needs to happen once.

Weaved Assemblies

When you create a new instance by default Weaver will not edit any assemblies. It is up to you to define which assemblies you want to be modified. Click on the + icon on the bottom right and a context menu will pop up with all the valid assemblies you can target. You can also disable the assemblies in this list by unchecking the check box beside it's name. This will stop them from being edited.

Menu Content: The assemblies in the menu are populated with reflection and will be found if they they are anywhere ein the Unity Project.

Components

Weaver is built around it's components as they are what do the weaving of the assemblies. Weaver itself is just a provider of information for the components. They get notified when they should run and on which assemblies they should run against.

To add a new component use the (+) button to open the menu and pick any option.

There Can Only Be One: You can only have one instance of each component as having more would be useless.

Adding New Componet Types: The component menu uses reflection to find all types that inherit from WeaverComponent and are not abstract and are part of the EditorAssembly. Any new classes that match thoese rules will populate inside the menu.

Logs

To make the process a bit more clear but also not spam to your console Weaver logs all it's contents to it's own console on the ScriptableObject. Errors are also logged to the Unity console because that is important.

Toggling Weaver

If you would like Weaver to not run while in your project you can uncheck Is Enabled in the settings object. You also have the option to define if Weaver will run depending on the Script Symbols defined in Unity.

You can use any flag like UNITY_EDITOR or the inverse flag !UNITY_EDITOR. Weaver will only run if all flags are active.

Current Extensions

  • Method Timer - Any method with the MethodTimerAttribute will be timed using Stopwatch and logged to the console.

  • Profile Sample - Any method with the ProfileSample attribute will be have a profile sample injected into the method. The sample name will be the name of the method.

  • Property Changed : Invoke a callback whenever a property is marked with the [OnChanged(string callback)] attribute..

Git Sub Modules

  • Capture Groups: Used to generate the screen shots because I am too lazy to do that by hand. All code is under the preproc CAPTURE_GROUPS so feel free to remove this if you copy over the code.

Meta

Handcrafted by Byron Mayne [twittergithub]

Released under the MIT License.

If you have any feedback or suggestions for Weaver feel free to contact me.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].