Get strong typed, autocompleted resources like scenes, tags and layers in C# Unity projects
It makes your code that uses resources:
- Compile time checked, no more incorrect strings that make your application crash at runtime
- Autocompleted, never have to guess that scene name again
Currently you type:
string sceneName = "Level1";
LayerMask layer = LayerMask.NameToLayer("TransparentFX");
GameObject go = FindGameObjectsWithTag("Bullets"); // seriously, never use FindGameObjectsWithTag though
Animator.Play("IdleState");
With R.Unity it becomes:
string sceneName = R.Scene.Level1;
LayerMask layer = R.Layer.TransparentFXMask;
GameObject go = FindGameObjectsWithTag(R.Tag.Bullets); // seriously, never use FindGameObjectsWithTag though
Animator.Play(R.Animator.PlayerAnimator.IdleState);
Right now it doesn't auto compile everytime you add a new animation, scene or a tag yet. You can manually trigger R.Unity by running:
Tools > R.cs > Rebuild
This repository has UPM support. Install it with:
npm install -g openupm-cli
openupm add com.m0rph3v5.runity
This is based on the idea of mac-cain13 and his work on R.Swift