示例#1
0
 private void RegisterMonoBehaviours(GameObject obj, IDIContext sceneContext, IRemoteObjectsRecord ror)
 {
     ContextMonoBehaviour[] behaviours = obj.GetComponents <ContextMonoBehaviour>();
     foreach (ContextMonoBehaviour mb in behaviours)
     {
         sceneContext.InjectDependencies(mb);
     }
 }
示例#2
0
        private void RegisterRemoteObject(object instance, bool hashOnly = false)
        {
            if (!RemoteObjectsHelper.IsRemoteObject(instance))
            {
                return;
            }
            IRemoteObjectsRecord remoteRecord = (IRemoteObjectsRecord)this.ResolveInternal(typeof(IRemoteObjectsRecord), null, null, false);

            if (!hashOnly)
            {
                remoteRecord.Register(instance);
            }
            else
            {
                IRemoteObjectsHash hash = (IRemoteObjectsHash)this.ResolveInternal(typeof(IRemoteObjectsHash), null, null, false);
                hash.Register(instance);
            }
        }