Пример #1
0
        protected void InitializeHandlers(BoxCollider mapCollider, bool giveUserControl)
        {
            //IL_000e: Unknown result type (might be due to invalid IL or missing references)
            CameraHandler current = CameraHandler.current;

            current.Initialize(m_mapDefinition, mapCollider.get_bounds(), giveUserControl);
            m_inputHandler = new FightMapInputHandler(mapCollider, current);
        }
Пример #2
0
        private void Awake()
        {
            //IL_004a: Unknown result type (might be due to invalid IL or missing references)
            //IL_004f: Unknown result type (might be due to invalid IL or missing references)
            //IL_005b: Unknown result type (might be due to invalid IL or missing references)
            //IL_0060: Unknown result type (might be due to invalid IL or missing references)
            //IL_0065: Unknown result type (might be due to invalid IL or missing references)
            //IL_0070: Unknown result type (might be due to invalid IL or missing references)
            //IL_0075: Unknown result type (might be due to invalid IL or missing references)
            CameraHandler  current        = CameraHandler.current;
            DirectionAngle directionAngle = (null != current) ? current.mapRotation : DirectionAngle.None;
            float          num            = 180f - 45f * (float)directionAngle;
            float          num2           = 0f - m_maxTiltAngle + 2f * m_maxTiltAngle * Random.get_value();

            this.get_transform().set_rotation(Quaternion.AngleAxis(num, Vector3.get_up()) * Quaternion.AngleAxis(num2, this.get_transform().get_right()) * this.get_transform().get_rotation());
        }
Пример #3
0
 public FightMapInputHandler([NotNull] Collider collider, [CanBeNull] CameraHandler cameraHandler)
 {
     //IL_0045: Unknown result type (might be due to invalid IL or missing references)
     //IL_004a: Unknown result type (might be due to invalid IL or missing references)
     if (null == collider)
     {
         throw new ArgumentNullException("collider");
     }
     m_camera                = ((null == cameraHandler) ? Camera.get_main() : cameraHandler.camera);
     m_cameraHandler         = cameraHandler;
     m_collider              = collider;
     m_previousMousePosition = InputUtility.pointerPosition;
     if (cameraHandler != null)
     {
         cameraHandler.onMoved       = (Action <CameraHandler>)Delegate.Combine(cameraHandler.onMoved, new Action <CameraHandler>(ForceUpdate));
         cameraHandler.onZoomChanged = (Action <CameraHandler>)Delegate.Combine(cameraHandler.onZoomChanged, new Action <CameraHandler>(ForceUpdate));
     }
 }
Пример #4
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);
                }
            }
        }
Пример #5
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;
        }
Пример #6
0
 private void ForceUpdate(CameraHandler cameraHandler)
 {
     m_forceUpdate = true;
 }