11,000 種類を超える 5 つ星アセット
8.5 万人以上の顧客による評価
10 万人を超えるフォーラムメンバーが支持
すべてのアセットを Unity が審査済み
Unity のバージョン | ビルトイン | URP | HDRP |
---|---|---|---|
6000.0.32f1 | 互換性がある | 互換性がある | 互換性がある |
2023.2.20f1 | 互換性がある | 互換性がある | 互換性がある |
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;
```