Initial Commit
This commit is contained in:
+52
@@ -0,0 +1,52 @@
|
||||
#if !NOT_UNITY3D
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using ModestTree;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Zenject
|
||||
{
|
||||
[NoReflectionBaking]
|
||||
public class EmptyGameObjectProvider : IProvider
|
||||
{
|
||||
readonly DiContainer _container;
|
||||
readonly GameObjectCreationParameters _gameObjectBindInfo;
|
||||
|
||||
public EmptyGameObjectProvider(
|
||||
DiContainer container, GameObjectCreationParameters gameObjectBindInfo)
|
||||
{
|
||||
_gameObjectBindInfo = gameObjectBindInfo;
|
||||
_container = container;
|
||||
}
|
||||
|
||||
public bool IsCached
|
||||
{
|
||||
get { return false; }
|
||||
}
|
||||
|
||||
public bool TypeVariesBasedOnMemberType
|
||||
{
|
||||
get { return false; }
|
||||
}
|
||||
|
||||
public Type GetInstanceType(InjectContext context)
|
||||
{
|
||||
return typeof(GameObject);
|
||||
}
|
||||
|
||||
public void GetAllInstancesWithInjectSplit(
|
||||
InjectContext context, List<TypeValuePair> args, out Action injectAction, List<object> buffer)
|
||||
{
|
||||
Assert.IsEmpty(args);
|
||||
|
||||
injectAction = null;
|
||||
|
||||
var gameObj = _container.CreateEmptyGameObject(_gameObjectBindInfo, context);
|
||||
buffer.Add(gameObj);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user