Skip to content

Instantly share code, notes, and snippets.

@tsubaki tsubaki/Sample.cs
Last active Mar 1, 2019

Embed
What would you like to do?
ResourceManagerの超小さい例
using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.ResourceManagement;
class Sample : MonoBehaviour
{
void Start()
{
// 初期化
// アセットをロードする方法(Provider)を登録
ResourceManager.ResourceProviders.Add( new LegacyResourcesProvider());
ResourceManager.InstanceProvider = new InstanceProvider();
// 生成する対象(Location)を生成
var location = new LegacyResourcesLocation("Obj");
var instanceParam = new InstantiationParameters(Vector3.zero, Quaternion.identity, null);
// ResourceManagerに対象(Location)を渡して、ロードしてもらう。方法はResourceManagerは知っている
ResourceManager.ProvideInstance<GameObject>(location, instanceParam);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.