Skip to content

Generate code to replace Unity magic strings

License

Notifications You must be signed in to change notification settings

kichul1122/UnityConstants

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Unity Constants

Based on UnityToolbag by Nick Gravelyn.

UnityConstants generates a C# script containing various Unity magic strings. Currently it works with:

  • Tags
  • Sorting layers
  • Layers
  • Scenes
  • Inputs
  • Audio mixer parameters
  • Animator controller parameters

It will generate a file similar to this:

namespace UnityConstants
{
    public static class Tags
    {
        public const string Untagged = "Untagged";
        public const string MainCamera = "MainCamera";
        public const string Player = "Player";
    }

    public static class SortingLayers
    {
        public const int Default = 0;
        public const int Foreground = 7;
    }

    public static class Layers
    {
        public const int Default = 0;
        public const int TransparentFX = 1;
        public const int IgnoreRaycast = 2;
    }

    public static class Scenes
    {
        public const int MainMenu = 0;
        public const int Tutorial = 1;
    }
}

Installation

Copy the Scripts folder into your project's Assets folder.

Usage

Use the Edit/Generate Unity Constants menu item to generate a UnityConstants.cs file.

License

Unity Constants is licensed under the MIT license.

About

Generate code to replace Unity magic strings

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages