コード例 #1
0
        private void generateNewCommand()
        {
            PlayerCommand playerCommand = generatePlayerCommandWithNoBoom();

            playerCommand.IsBoomUsed = unityService.GetKeyDown(boomKey);

            if (hasCommandChanged(playerCommand))
            {
                setNewCommand(playerCommand);
            }
        }
コード例 #2
0
    private void Update()
    {
        if (mode == 0)
        {
            shield.transform.Rotate(0, 30 * Time.deltaTime, 0); //rotate shield
        }

        //checks if p or m is pressed to pause the game and get rid of the minimap
        //respectively

        if (UnityService.GetKeyDown("p") == true)
        {
            if (pauseScreen.activeInHierarchy == true)
            {
                pauseScreen.SetActive(false);
            }
            else
            {
                pauseScreen.SetActive(true);
            }

            Pause();
        }

        if (UnityService.GetKeyDown("m") == true)
        {
            if (miniMap.activeInHierarchy == true)
            {
                miniMap.SetActive(false);
            }
            else
            {
                miniMap.SetActive(true);
            }
        }

        // If player dies
        if (health <= 0)
        {
            Lose();
        }
    }