Example #1
0
    // Update is called once per frame
    void Update()
    {
        if (!gameController.IsPaused())
        {
            timer -= Time.deltaTime;
            if (timer <= 0)
            {
                invencible = false;
            }
            moveInput.x = Input.GetAxis("Horizontal");
            moveInput.y = Input.GetAxis("Vertical");

            transform.Translate(moveInput * Time.deltaTime * moveSpeed);

            anim.SetBool("isMoving", (moveInput.x != 0 || moveInput.y != 0));
            CheckFlip();

            if (Input.GetButtonDown("Fire3") && InDistanceFromVan())
            {
                GameObject van = GameObject.FindGameObjectWithTag("Van");
                inkLevel.Refill();
                vans.DestroyVan();
                vanIsHereText.SetActive(false);
            }
            if (Input.GetButtonDown("Jump"))
            {
                deliveries.Deliver();
            }
        }
    }