Addressables Source Generator View on Asset Store (opens in new tab)

Package details

Latest version
1.0
Last updated
First released
Unity version
2023.2.20 or later
Package size
46 KB
Files
12
Favorites
8
Views in the past week
4

Price tracking

Last checked
Tracked since
Lowest recorded
Free on

Keywords

Addressables Source Generator

by Denis535 (opens in new tab)

No ratings yet

This is an add-on to Addressables that gives you the ability to use your assets in a very convenient way with compile-time checking.

Price Free

Get it free on Asset Store (opens in new tab)

Affiliate link · Purchases support this site

Price history

Last 6 months

USD
Price history for Addressables Source Generator, 6 months Current Free; lowest Free; highest Free in this period. $0 Jun Jul Aug Sep Oct Nov

Asset preview

1 / 2

Addressables Source Generator screenshot 1

Addressables Source Generator screenshot 1

About this asset

Overview

This package is an add-on to Addressables that gives you the ability to use your assets in a very convenient way with compile-time checking.

How to generate source codes

You can use an `AddressablesSourceGenerator` asset.

```

var generator = AssetDatabase.LoadAssetAtPath<AddressableSourceGenerator>( AssetDatabase.GUIDToAssetPath( AssetDatabase.FindAssets( "t:AddressableSourceGenerator" ).Single() ) );

generator.Generate();

```

Or you can use an `ResourcesSourceGenerator` and `LabelsSourceGenerator` classes.

```

var settings = AddressableAssetSettingsDefaultObject.Settings;

new ResourcesSourceGenerator().Generate( "Assets/UnityEngine.AddressableAssets/R.cs", "UnityEngine.AddressableAssets", "R", settings );

new LabelsSourceGenerator().Generate( "Assets/UnityEngine.AddressableAssets/L.cs", "UnityEngine.AddressableAssets", "L", settings );

```

Example of generated source codes

It generates source codes that looks something like this:

```

namespace UnityEngine.AddressableAssets {

public static class @R {

public static class @MyProject {

public static class @Scenes {

public const string @MainScene = "MyProject/Scenes/MainScene.unity";

public const string @GameScene = "MyProject/Scenes/GameScene.unity";

}

}

}

public static class @L {

public const string @default = "default";

public const string @Scene = "scene";

}

}

```

How to use generated source codes

You can use your assets very easily:

```

var address = R.MyProject.Scenes.MainScene;

var label = L.Scene;

```

From the publisher's Asset Store listing.

Technical details

  • Easy use of all addresses and labels.
  • Compiler-time checking.

Compatibility

Render pipelines supported in each Unity version
Unity version Built-in URP HDRP Custom
6000.0.32f1 Compatible Compatible Compatible Compatible
2023.2.20f1 Compatible Compatible Compatible Compatible

As listed on the Asset Store.