Beispiel #1
0
        void IModuleDependency <FunctionalityInjectionModule> .ConnectDependency(FunctionalityInjectionModule dependency)
        {
            m_FIModule = dependency;
            // TODO: Collect all scenes and add islands if modules persist between scene loads
#if UNITY_EDITOR
            var session = Application.isPlaying ?
                          MARSSession.Instance :
                          MarsRuntimeUtils.GetMarsSessionInActiveScene();
#else
            var session = MARSSession.Instance;
#endif

            // TODO: Don't load modules for non-MARS scenes
            if (session == null)
            {
                return;
            }

            FunctionalityIsland island = null;

            if (session.island)
            {
                island = session.island;
            }

#if UNITY_EDITOR
            if (Application.isPlaying && m_SimulateInPlayMode)
            {
                if (m_SimulateDiscovery)
                {
                    if (m_SimulatedDiscoveryIsland == null)
                    {
                        Debug.LogWarning("There is no simulated discovery island set in the MARSSceneModule to be used for play mode simulation");
                        return;
                    }

                    island = m_SimulatedDiscoveryIsland;
                }
                else
                {
                    if (m_SimulationIsland == null)
                    {
                        Debug.LogWarning("There is no simulation island set in the MARSSceneModule to be used for play mode simulation");
                        return;
                    }

                    island = m_SimulationIsland;
                }
            }
#endif
            if (island)
            {
                dependency.AddIsland(island);
            }
        }
        void IModuleDependency <FunctionalityInjectionModule> .ConnectDependency(FunctionalityInjectionModule dependency)
        {
            if (!m_SimulationIsland)
            {
                Debug.LogWarning("You need to set the simulation island", this);
                return;
            }

            if (!m_SimulatedDiscoveryIsland)
            {
                Debug.LogWarning("You need to set the simulated discovery island", this);
                return;
            }

            if (EditorApplication.isPlaying)
            {
                return;
            }

            m_FIModule = dependency;
            m_FIModule.AddIsland(m_SimulationIsland);
            m_FIModule.AddIsland(m_SimulatedDiscoveryIsland);
        }
 void IModuleDependency <FunctionalityInjectionModule> .ConnectDependency(FunctionalityInjectionModule dependency)
 {
     m_FIModule = dependency;
 }
Beispiel #4
0
 public void ConnectDependency(FunctionalityInjectionModule dependency)
 {
     m_FIModule = dependency;
 }