GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - ZenitechSoftware/UnityResourceGenerator: Automatically generate helper functions for Unity resources

BranchesTags
Open more actions menu

Latest commit

 

History

89 Commits
89 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
.nuke
.nuke
 
 
.vscode
.vscode
 
 
Documentation
Documentation
 
 
UnityResourceGenerator.Build
UnityResourceGenerator.Build
 
 
UnityResourceGenerator
UnityResourceGenerator
 
 
.gitignore
.gitignore
 
 
CHANGELOG.md
CHANGELOG.md
 
 
LICENSE.md
LICENSE.md
 
 
README.md
README.md
 
 
ServeDocsLocal.ps1
ServeDocsLocal.ps1
 
 
UnityResourceGenerator.sln
UnityResourceGenerator.sln
 
 
build.cmd
build.cmd
 
 
build.ps1
build.ps1
 
 
build.sh
build.sh
 
 

Repository files navigation

Unity Resource Generator openupm GitHub tag (latest SemVer) Publish Publish To GitHub Pages

Automatically generate a helper class for Resources.Load in Unity with the press of a button.

Generate Button

With this folder structure:

Assets/
├─ Resources/
│  ├─ Coin.prefab
│  ├─ Coin.mp3
├─ Scenes/
│  ├─ CoinRain.unity

The following helper class is generated:

using UnityEngine;
using UnityEngine.SceneManagement;

namespace Sample
{
    // ReSharper disable PartialTypeWithSinglePart
    public static partial class ResourcePaths
    {

        public static partial class Scenes
        {
            public const string CoinRain = "Scenes/CoinRain";

            public static void LoadCoinRain(LoadSceneMode mode = LoadSceneMode.Single) =>
                SceneManager.LoadScene(CoinRain, mode);

            public static AsyncOperation LoadAsyncCoinRain(LoadSceneMode mode = LoadSceneMode.Single) =>
                SceneManager.LoadSceneAsync(CoinRain, mode);
        }

        public static partial class Prefabs
        {
            public const string Coin = "Coin";
            public static GameObject LoadCube() => Resources.Load<GameObject>(Coin);
        }

        public static partial class AudioClips
        {
            public const string Coin = "Coin";
            public static AudioClip LoadCoin() => Resources.Load<AudioClip>(Coin);
        }
    }
}

Installation

Use OpenUPM to install the package.

openupm add com.autsoft.unityresourcegenerator

Documentation

For the complete documentation, visit the website.

About

Automatically generate helper functions for Unity resources

autsoft.github.io/UnityResourceGenerator/

Topics

unity

Resources

Readme
MIT license
Activity
Custom properties

Stars

6 stars

Watchers

5 watching

Forks

1 fork
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.