Esempio n. 1
0
    /// <summary>
    /// Update method called each frame ( when the game is not in pause )
    /// Checking if input button click and calling fire is pressed
    /// </summary>
    /// <param name="deltaTime"></param>
    public override void CustomUpdate(float deltaTime)
    {
        base.CustomUpdate(deltaTime);

        // get if input down
        bool firePressed = Input.GetButtonDown("Fire1");

        if (firePressed)
        {
            // calling fire
            _entityFire.Fire();
        }
    }
Esempio n. 2
0
    /// <summary>
    /// method call every frame ( is game is not paused )
    /// getting the mouse click, if clicked, callig to the entity to fire
    /// </summary>
    /// <param name="deltaTime"></param>
    public override void CustomUpdate(float deltaTime)
    {
        base.CustomUpdate(deltaTime);

        // getting the button 0 ( left button ) from the mouse
        bool firePressed = Input.GetMouseButtonDown(0);

        if (firePressed)
        {
            // calling to fire
            _entityFire.Fire();
        }
    }