Exemplo n.º 1
0
    public override void OnRoomExit()
    {
        m_gcSwarm.OnRoomExit();
        m_gcBarrier.OnRoomExit();
        MoveTowardPlayer_RoomObject gc = m_gcSwarm.GetComponent <MoveTowardPlayer_RoomObject>();

        if (null != gc)
        {
            gc.OnRoomExit();
        }
    }
Exemplo n.º 2
0
    public override void OnRoomEnter()
    {
        // Has this room been completed before?
        if (GameGlobals.TestGameEvent(Types.s_iGE_SwarmKilled))
        {
            m_gcSwarm.OnRoomExit();
            m_gcBarrier.TurnOffInstant(true);
            m_gcDoorLeft.CloseInstant();
            m_gcDoorBottom.CloseInstant();
            return;
        }



        m_gcBarrier.OnRoomEnter();
        m_gcSwarm.OnRoomEnter();
        MoveTowardPlayer_RoomObject gc = m_gcSwarm.GetComponent <MoveTowardPlayer_RoomObject>();

        if (null != gc)
        {
            gc.OnRoomEnter();
        }

        // First Entry, just shuffle them out of the bottom of the screen
        if (!GameGlobals.TestGameEvent(Types.s_iGE_Robotron2))
        {
            m_gcDoorRight.CloseInstant();
            if (!m_gcDoorLeft.GetIsClosed())
            {
                TimerManager.AddTimer(Types.s_fDUR_RoomEntryDoorCloseDelay, CloseDoorsFirstEntry);
            }
            m_bCheckSwarmHealth = false;
            m_gcSwarm.gameObject.GetComponent <MoveTowardPlayer_RoomObject>().enabled = false;
        }
        // Second entry, lock them in until they kill the swarm...
        else
        {
            m_gcBarrier.TurnOffInstant(true);
            m_gcDoorLeft.CloseInstant();
            m_gcDoorRight.CloseInstant();
            m_gcSwarm.gameObject.GetComponent <MoveTowardPlayer_RoomObject>().enabled = true;
            TimerManager.AddTimer(Types.s_fDUR_RoomEntryDoorCloseDelay, CloseDoorSecondEntry);
            m_bCheckSwarmHealth = true;
        }
    }