Set delay time to spawn object
<p>I have the SpawnScript (Below)
I want to create a function within the SPAWN, so I can put the minimum and maximum  delay time that an object can be created by the inspector.</p>

<pre><code> using System.Collections;
using System.Collections.Generic;

public class SpawnController : MonoBehaviour
{

    public float maxWidth;
    public float minWidth;

    public float minTime;
    public float maxTime;

    public float rateSpawn;
    private float currentRateSpawn;

    public GameObject tubePrefab;

    public int maxSpawnTubes;

    public List&lt;GameObject&gt; tubes;

    // Use this for initialization
    void Start ()
    {


        for (int i = 0; i &lt; maxSpawnTubes; i++) {
            GameObject tempTube = Instantiate (tubePrefab) as GameObject;
            tubes.Add (tempTube);
            tempTube.SetActive (false);

        }

        currentRateSpawn = rateSpawn;

    }

    // Update is called once per frame
    void Update ()
    {

        currentRateSpawn += Time.deltaTime;
        if (currentRateSpawn &gt; rateSpawn) {
            currentRateSpawn = 0;
            Spawn ();
        }
    }

    private void Spawn ()
    {

        float randWitdh = Random.Range (minWidth, maxWidth);

        GameObject tempTube = null;

        for (int i = 0; i &lt; maxSpawnTubes; i++) {
            if (tubes [i].activeSelf == false) {
                tempTube = tubes [i];
                break;
            }
        }

        if (tempTube != null)
            tempTube.transform.position = new Vector3 (randWitdh, transform.position.y, transform.position.z);
        tempTube.SetActive (true);
    }
}
</code></pre>