示例#1
0
    public override void update()
    {
        if (GameDad.setmode == null || GameDad.linedrawn_hook == null)
        {
            // the hooks are not set up, we should wait for the other scripts
            // setmode should come from starinstantiator
            // and linedrawn_hook should come from launch
            return;
        }
        bool space = Input.GetKey("space");

        if (GameDad.headset_button_is_pushed != null && GameDad.headset_button_is_pushed())
        {
            space = true;
        }
        if (GameDad.gamesover) // no button once the game is over
        {
            space = false;
        }
        if (space)
        {
            if (pressed == false)
            {
                space_pressed();
            }
            updateline();
        }
        else
        {
            if (pressed == true)
            {
                space_release();
            }
        }
    }