Update Project
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
#if !NOT_UNITY3D
|
||||
|
||||
namespace Zenject
|
||||
{
|
||||
public interface IPrefabProvider
|
||||
{
|
||||
UnityEngine.Object GetPrefab(InjectContext context);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3b63b8088376c9a499e7f506a237392d
|
||||
timeCreated: 1461708049
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,27 @@
|
||||
#if !NOT_UNITY3D
|
||||
|
||||
using ModestTree;
|
||||
|
||||
namespace Zenject
|
||||
{
|
||||
[NoReflectionBaking]
|
||||
public class PrefabProvider : IPrefabProvider
|
||||
{
|
||||
readonly UnityEngine.Object _prefab;
|
||||
|
||||
public PrefabProvider(UnityEngine.Object prefab)
|
||||
{
|
||||
Assert.IsNotNull(prefab);
|
||||
_prefab = prefab;
|
||||
}
|
||||
|
||||
public UnityEngine.Object GetPrefab(InjectContext _)
|
||||
{
|
||||
return _prefab;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3628433a045792f4297abd34b5a1a34c
|
||||
timeCreated: 1461708049
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,29 @@
|
||||
#if !NOT_UNITY3D
|
||||
|
||||
using ModestTree;
|
||||
using UnityEngine;
|
||||
using System;
|
||||
|
||||
namespace Zenject
|
||||
{
|
||||
[NoReflectionBaking]
|
||||
public class PrefabProviderCustom : IPrefabProvider
|
||||
{
|
||||
readonly Func<InjectContext, UnityEngine.Object> _getter;
|
||||
|
||||
public PrefabProviderCustom(Func<InjectContext, UnityEngine.Object> getter)
|
||||
{
|
||||
_getter = getter;
|
||||
}
|
||||
|
||||
public UnityEngine.Object GetPrefab(InjectContext context)
|
||||
{
|
||||
var prefab = _getter(context);
|
||||
Assert.That(prefab != null, "Custom prefab provider returned null");
|
||||
return prefab;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f6f578cfe9da346348878e4a26617ee0
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,31 @@
|
||||
#if !NOT_UNITY3D
|
||||
|
||||
using ModestTree;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Zenject
|
||||
{
|
||||
[NoReflectionBaking]
|
||||
public class PrefabProviderResource : IPrefabProvider
|
||||
{
|
||||
readonly string _resourcePath;
|
||||
|
||||
public PrefabProviderResource(string resourcePath)
|
||||
{
|
||||
_resourcePath = resourcePath;
|
||||
}
|
||||
|
||||
public UnityEngine.Object GetPrefab(InjectContext context)
|
||||
{
|
||||
var prefab = (GameObject)Resources.Load(_resourcePath);
|
||||
|
||||
Assert.That(prefab != null,
|
||||
"Expected to find prefab at resource path '{0}'", _resourcePath);
|
||||
|
||||
return prefab;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6fa6b8670ec5932489c4102d45d987ff
|
||||
timeCreated: 1461708051
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user