Beispiel #1
0
        private void Interactions()
        {
            if (Input.GetKeyDown(KeyCodeConsts.USE))
            {
                interactionTrigger.Interact(INPUT_TYPE.USE);
            }

            if (Input.GetKeyDown(KeyCodeConsts.CANCEL))
            {
                interactionTrigger.Interact(INPUT_TYPE.CANCEL);
            }
        }
    // Update is called once per frame
    void Update()
    {
        if (SpawnEnemies)
        {
            spawnAI();

            if (hasCompleted())
            {
                SpawnEnemies = false;
                completeTrigger.Interact();
            }
        }
    }
Beispiel #3
0
    void Update()
    {
        if (gm.gameOver)
        {
            return;
        }

        if (Input.GetButtonDown("Pause"))
        {
            gm.SwapPauseState();
            return;
        }

        if (gm.gamePaused)
        {
            return;
        }

        if (Input.GetButtonDown("Interact"))
        {
            if (interactionTrigger.CanInteract)
            {
                interactionTrigger.Interact();
            }
        }

        if (Input.GetButtonDown("Fire1"))
        {
            player.FireEquipedWeapon();
        }

        if (Input.GetButton("Fire1"))
        {
            if (player.CurrentWeaponIsWaterGun())
            {
                if (player.waterGun.IsFiring)
                {
                    player.FireEquipedWeapon();
                }
            }
        }

        if (Input.GetButtonDown("Fire2"))
        {
            player.ThrowGrenade();
        }

        if (Input.GetButtonDown("Fire3"))
        {
            player.Pet();
        }

        float mouseScroll = Input.GetAxisRaw("Mouse ScrollWheel");

        if (ScrollWheelReady)
        {
            if (mouseScroll != 0f)
            {
                if (mouseScroll > 0f)
                {
                    player.EquipNextWeapon();
                }
                else
                {
                    player.EquipPreviousWeapon();
                }
                scrollWheelCountdown = scrollWheelDelay;
            }
        }
        else
        {
            scrollWheelCountdown -= Time.deltaTime;
        }
    }