Ejemplo n.º 1
0
        protected override void Awake()
        {
            Random.InitState(0);
            base.Awake();

            var moduleLoader = ModuleLoaderCore.instance;

            moduleLoader.ReloadModules();
            m_Db = moduleLoader.GetModule <MARSDatabase>();

            m_PipelinesModule = moduleLoader.GetModule <QueryPipelinesModule>();
            var pipelineModuleDependency = (IModuleDependency <MARSDatabase>)m_PipelinesModule;

            pipelineModuleDependency.ConnectDependency(m_Db);

            var pipelinesModule = (IModule)m_PipelinesModule;

            pipelinesModule.LoadModule();

            m_QueryBackend = moduleLoader.GetModule <MARSQueryBackend>();
            var queryBackendDependency = (IModuleDependency <QueryPipelinesModule>)m_QueryBackend;

            queryBackendDependency.ConnectDependency(m_PipelinesModule);

            var queryBackendModule = (IModule)m_QueryBackend;

            queryBackendModule.LoadModule();

            m_TestObject = new GameObject();
            m_TestObject.SetActive(false);
            m_TestObject.AddComponent <Camera>();
            m_CameraOffsetProvider = m_TestObject.AddComponent <CameraOffsetProvider>();
        }
        public void Setup()
        {
            QuerySimulationModule.TestMode = true;
            m_Db = new MARSDatabase();
            var dbModule = (IModule)m_Db;

            dbModule.LoadModule();

            m_Pipeline = new StandaloneQueryPipeline(m_Db);
            m_Pipeline.SetupData();

            // creating our own instance of the query backend doesn't work because
            // we'll get the error about multiple instance of scriptable settings.
            m_QueryBackend          = ModuleLoaderCore.instance.GetModule <MARSQueryBackend>();
            m_QueryBackend.Pipeline = m_Pipeline;
            var queryBackendModule = (IModule)m_QueryBackend;

            queryBackendModule.LoadModule();
        }
 void IModuleDependency <MARSQueryBackend> .ConnectDependency(MARSQueryBackend dependency)
 {
     m_QueryBackend = dependency;
 }