Update Project
This commit is contained in:
+25
@@ -0,0 +1,25 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace Zenject.Tests.Factories.BindFactoryOne
|
||||
{
|
||||
//[CreateAssetMenu(fileName = "Bar", menuName = "Installers/Bar")]
|
||||
public class Bar : ScriptableObject
|
||||
{
|
||||
[Inject]
|
||||
public void Init(string value)
|
||||
{
|
||||
Value = value;
|
||||
}
|
||||
|
||||
public string Value
|
||||
{
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
public class Factory : PlaceholderFactory<string, Bar>
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cd7da28b2b2c71a419e9eb3722a9b7b6
|
||||
timeCreated: 1487540990
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace Zenject.Tests.Factories.BindFactoryOne
|
||||
{
|
||||
public interface IFoo
|
||||
{
|
||||
string Value
|
||||
{
|
||||
get;
|
||||
}
|
||||
}
|
||||
|
||||
public class IFooFactory : PlaceholderFactory<string, IFoo>
|
||||
{
|
||||
}
|
||||
|
||||
public class Foo : MonoBehaviour, IFoo
|
||||
{
|
||||
[Inject]
|
||||
public void Init(string value)
|
||||
{
|
||||
Value = value;
|
||||
}
|
||||
|
||||
public string Value
|
||||
{
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
public class Factory : PlaceholderFactory<string, Foo>
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 01d5660ddd4f5d440a15f6ae003cd42a
|
||||
timeCreated: 1459036978
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
namespace Zenject.Tests.Factories.BindFactoryOne
|
||||
{
|
||||
public class FooInstaller : MonoInstaller
|
||||
{
|
||||
string _param1;
|
||||
|
||||
[Inject]
|
||||
public void Init(string param1)
|
||||
{
|
||||
_param1 = param1;
|
||||
}
|
||||
|
||||
public override void InstallBindings()
|
||||
{
|
||||
Container.BindInstance(_param1).WhenInjectedInto<Foo>();
|
||||
Container.Bind<Foo>().FromNewComponentOnNewGameObject().AsTransient();
|
||||
}
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a4c5304e14d4ebf40a4d40c6c382964d
|
||||
timeCreated: 1460646778
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user