예제 #1
0
    void UpdateState()
    {
        Move();
        if (m_CurrentTime >= m_TimeBetweenActions)
        {
            BossStates action = (BossStates)UnityEngine.Random.Range(0, Enum.GetNames(typeof(BossStates)).Length);
            switch (action)
            {
            case BossStates.ATTACK_1:
                m_SpaceshipBehaviour.UsePrimaryInventorySlot(FireType.SINUSOIDAL);
                break;

            case BossStates.ATTACK_2:
                m_SpaceshipBehaviour.UsePrimaryInventorySlot(FireType.CIRCLE);
                break;

            case BossStates.ATTACK_3:
                m_InventoryBehaviour.SetSecondarySlot(ItemType.Missile);
                m_SpaceshipBehaviour.UseSecondaryInventorySlot();
                break;

            case BossStates.INVULNERAVILITY:
                m_InventoryBehaviour.SetSecondarySlot(ItemType.Invulnerability);
                m_SpaceshipBehaviour.UseSecondaryInventorySlot();
                break;
            }
            m_CurrentTime = 0;
        }

        if (!m_IsRageMode && m_SpaceshipBehaviour.m_Health <= m_MaxHealth / 2)
        {
            EnterRageMode();
        }
    }
예제 #2
0
    void ProcessInput()
    {
        float moveHorizontal = Input.GetAxis("Horizontal");
        float moveVertical   = Input.GetAxis("Vertical");

        m_MainSpaceshipBehaviour.Move(moveHorizontal, moveVertical);

        if (Input.GetButton("Fire1"))
        {
            m_MainSpaceshipBehaviour.UsePrimaryInventorySlot(FireType.DEFAULT);
        }

        if (Input.GetButton("Fire2"))
        {
            m_MainSpaceshipBehaviour.UseSecondaryInventorySlot();
        }
    }