I need help in zooming an object using double tap in my android device

So in the game scene i have an object (cube), i wanna deploy this in my android phone (just a small demo). so when we double tap the object it should zoom in smoothly, and when we double tap it should zoom out smoothly, can anyone give me some ideas. it would be appreciated.

the following code i took from another post. I hope this can help

   if (Input.touchCount == 1 && Input.GetTouch(0).phase == TouchPhase.Began)
             {
                 tapCount++;
             }
             if (tapCount > 0)
             {
                 doubleTapTimer += Time.deltaTime;
             }
             if (tapCount >= 2)
             {
                 //Decrease camera filed of view code here
                 doubleTapTimer = 0.0f;
                 tapCount = 0;
             }
             if (doubleTapTimer > 0.5f)
             {
                 doubleTapTimer = 0f;
                 tapCount = 0;
             }

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PinchZoom : MonoBehaviour
{
public float perspectiveZoomSpeed = 0.5f; // The rate of change of the field of view in perspective mode.
public float orthoZoomSpeed = 0.5f; // The rate of change of the orthographic size in orthographic mode.
public float ZoomInMax=80.0f, ZoomInMin=24.0f;

void Update()
{
    // If there are two touches on the device...
    if (Input.touchCount == 2)
    {
        // Store both touches.
        Touch touchZero = Input.GetTouch(0);
        Touch touchOne = Input.GetTouch(1);

        // Find the position in the previous frame of each touch.
        Vector2 touchZeroPrevPos = touchZero.position - touchZero.deltaPosition;
        Vector2 touchOnePrevPos = touchOne.position - touchOne.deltaPosition;

        // Find the magnitude of the vector (the distance) between the touches in each frame.
        float prevTouchDeltaMag = (touchZeroPrevPos - touchOnePrevPos).magnitude;
        float touchDeltaMag = (touchZero.position - touchOne.position).magnitude;

        // Find the difference in the distances between each frame.
        float deltaMagnitudeDiff = prevTouchDeltaMag - touchDeltaMag;

        // If the camera is orthographic...
       // if (camera.isOrthoGraphic)
        if(Camera.main.orthographic)
        {
            // ... change the orthographic size based on the change in distance between the touches.
            Camera.main.orthographicSize += deltaMagnitudeDiff * orthoZoomSpeed;

            // Make sure the orthographic size never drops below zero.
            Camera.main.orthographicSize = Mathf.Max(Camera.main.orthographicSize, 0.1f);
        }
        else
        {
            // Otherwise change the field of view based on the change in distance between the touches.
           // if (Camera.main.fieldOfView > ZoomInMin && Camera.main.fieldOfView < ZoomInMax)
            //{
                Camera.main.fieldOfView += deltaMagnitudeDiff * perspectiveZoomSpeed; 
           // }

            // Clamp the field of view to make sure it's between 0 and 180.
            Camera.main.fieldOfView = Mathf.Clamp(Camera.main.fieldOfView, 24.0f, 80.0f);
        }
    }
    // -------------------Code for Zooming Out------------
    if (Input.GetAxis("Mouse ScrollWheel") < 0)
    {
        if (Camera.main.fieldOfView<=ZoomInMax)
            Camera.main.fieldOfView +=2;
        if (Camera.main.orthographicSize<=20)
            Camera.main.orthographicSize +=0.5f;

    }
    // ---------------Code for Zooming In------------------------
    if (Input.GetAxis("Mouse ScrollWheel") > 0)
    {
        if (Camera.main.fieldOfView>ZoomInMin)
            Camera.main.fieldOfView -=2;
        if (Camera.main.orthographicSize>=1)
            Camera.main.orthographicSize -=0.5f;
    }

    // -------Code to switch camera between Perspective and Orthographic--------
    if (Input.GetKeyUp(KeyCode.B ))
    {
        if (Camera.main.orthographic==true)
            Camera.main.orthographic=false;
        else
            Camera.main.orthographic=true;
    }
}

}