vietanhva993 / UnityConstants

Generate code to replace Unity magic strings

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

License:MIT License


Languages

Language:C# 100.0%