Giter Club home page Giter Club logo

r.unity's Introduction

R.Unity

Get strong typed, autocompleted Unity string resources like Scenes, Tags, Layers, Shaders and Resources.

R.Unity is inspired from R.swift

Why use this?

It makes your code that uses resources:

  • Editor menu checked, no more incorrect strings that make your app crash at runtime.
  • Autocompleted, never have to guess that resource name again.

Currently you type:

var tag = GameObject.FindGameObjectWithTag("Player");
var font = new Font("Arial");
item.layer = LayerMask.NameToLayer("UI");
canvas.sortingLayerID = 1579608521;
var shader = Shader.Find("AR/TangoARRender");
SceneManager.LoadSceneAsync("Scenes/public");

With R.Unity it becomes:

var tag = GameObject.FindGameObjectWithTag(RUnity.TagNames.Player);
var font = new Font(RUnity.FontNames.Arial);
item.layer = LayerMask.NameToLayer(RUnity.Layers.Names.UI);
canvas.sortingLayerID = RUnity.SortingLayers.Ids.Baskground;
var shader = RUnity.ShaderNames.Builtin.AR_Slash_TangoARRender;
SceneManager.LoadSceneAsync(RUnity.SceneNames.Scenes_Slash_public);

Features

After installing R.Unity into your project you can use the RUnity static class to access resouces. If the static class is outated just run Tools/RUnity/Generate/All menu and RUnity will correct any missing/changed/added resources.

RUnity currently supports theses type of reousrces:

[TODO : Write example] [TODO : Navigate to example]

  • FontTarget
  • LayerTarget
  • NavMeshAreaNameTarget
  • ResourcesTarget
  • SceneNameTarget
  • ShaderTarget
  • SortingLayerTarget
  • TagTarget

Installation

[TODO : Add UnityPakcage] [TODO : AssetStore?]

Limitation

[TODO : Errorhandling when type mismatch or type-miss generated.]

License

R.Unity is created by Ikiru Yoshizaki and released under a MIT License.

r.unity's People

Contributors

guitarrapc avatar

Stargazers

 avatar

Watchers

 avatar  avatar

r.unity's Issues

Typed Resources

Files in the /Resources

  • Pick up Resources name for Root
  • Pick up Resources name for non-Root
  • Duplicate Resource name handling.
    • 1st, depth-first search item for duplicate resource name.
    • 2nd, abc order search item for duplicate resource name.

Typed Shaders

  • Hard code BuiltinShader.
  • Search CustomShader.
  • Detect Duplicate Name with Builtin Shader.
  • Detect Duplicate Name with Custom Shaders.

Typed SceneName

  • Pickup SceneNames
    • from Editor to pre-build
  • Generate C# Class
    • Static Class & Readonly Static Field
  • Sample Component
  • Invalid Characer check
    • First char
    • Inside
  • Upper Typed Field First Char
  • Offer Typed Structure
  • Offer Editor Menu
  • Offer Pre-build Sample

Logger

Add Custom Logger extension point.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.