示例#1
0
 public void Release()
 {
     if (AudioManager.isReady)
     {
         m_audioContext.Release();
         if (m_worldMusicRequest != null)
         {
             AudioManager.StopWorldMusic(m_worldMusicRequest);
         }
     }
     m_worldMusicRequest = null;
 }
示例#2
0
 public IEnumerator Initialize()
 {
     RenderSettings.set_ambientLight(m_ambientColor);
     m_cameraHandler.Initialize(m_mapData, m_mapCharacterObject.get_transform());
     if (AudioManager.isReady)
     {
         m_audioContext.Initialize();
         m_worldMusicRequest = AudioManager.LoadWorldMusic(m_musicGroup, m_ambianceGroup, m_audioContext);
         while (m_worldMusicRequest.state == AudioWorldMusicRequest.State.Loading)
         {
             yield return(null);
         }
     }
 }
示例#3
0
        public IEnumerator Initialize()
        {
            CameraHandler.AddMapRotationListener(OnMapRotationChanged);
            FightStatus local       = FightStatus.local;
            int         regionCount = m_mapDefinition.regionCount;

            m_movementContexts = new FightMapMovementContext[regionCount];
            for (int i = 0; i < regionCount; i++)
            {
                FightStatus fightStatus = FightLogicExecutor.GetFightStatus(i);
                fightStatus.EntitiesChanged += OnEntitiesChanged;
                FightMapMovementContext fightMapMovementContext = new FightMapMovementContext(fightStatus.mapStatus, fightStatus);
                if (fightStatus == local)
                {
                    m_localMovementContext = fightMapMovementContext;
                }
                m_movementContexts[i] = fightMapMovementContext;
            }
            if (m_localMovementContext != null)
            {
                IMapStateProvider stateProvider = m_localMovementContext.stateProvider;
                m_targetContext = new FightMapTargetContext(stateProvider);
            }
            BoxCollider mapCollider = CreateCollider();

            InitializeHandlers(mapCollider, giveUserControl: false);
            MonsterSpawnCellDefinition monsterSpawnCellDefinition = m_bossFightMapResources.monsterSpawnCellDefinition;

            if (null != monsterSpawnCellDefinition)
            {
                yield return(monsterSpawnCellDefinition.Initialize());

                m_monsterSpawnCellDictionary = new Dictionary <int, GameObject>();
            }
            if (AudioManager.isReady)
            {
                m_audioContext.Initialize();
                m_worldMusicRequest = AudioManager.LoadWorldMusic(m_musicGroup, m_ambianceGroup, m_audioContext);
                while (m_worldMusicRequest.state == AudioWorldMusicRequest.State.Loading)
                {
                    yield return(null);
                }
            }
        }
示例#4
0
        public void Release()
        {
            CameraHandler.RemoveMapRotationListener(OnMapRotationChanged);
            if (FightLogicExecutor.isValid)
            {
                int regionCount = m_mapDefinition.regionCount;
                for (int i = 0; i < regionCount; i++)
                {
                    FightStatus fightStatus = FightLogicExecutor.GetFightStatus(i);
                    if (fightStatus != null)
                    {
                        fightStatus.EntitiesChanged -= OnEntitiesChanged;
                    }
                }
            }
            MonsterSpawnCellDefinition monsterSpawnCellDefinition = m_bossFightMapResources.monsterSpawnCellDefinition;

            if (null != monsterSpawnCellDefinition)
            {
                foreach (GameObject value in m_monsterSpawnCellDictionary.Values)
                {
                    monsterSpawnCellDefinition.DestroyInstance(value);
                }
                m_monsterSpawnCellDictionary.Clear();
                m_monsterSpawnCellDictionary = null;
                monsterSpawnCellDefinition.Release();
            }
            if (AudioManager.isReady)
            {
                m_audioContext.Release();
            }
            m_worldMusicRequest     = null;
            m_movementContexts      = null;
            m_localMovementContext  = null;
            m_activeMovementContext = null;
            m_targetContext         = null;
        }