best way too add a delay after a mouse click selection before the next click

I am curious whats the best way to add a delay to the mouse between selections of say a second or so that wont allow the clicks to be stacked and registered later?

so click once wait 1 second allow another click wait one second repeat etc....

Here is a simple code, if this is what you are looking for,

var TimeT:float = 0;
function Update () {
TimeT += Time.deltaTime;
if(Input.GetMouseButton(0)&&TimeT > 1)
{
    //Other Code
    TimeT = 0;
}
}

Hope this helps!

Hi,

For this, I use a lock property that I set when the user click and then call Invoke to unlock it. It's slightly cleaner in the Update function and gives you more flexibility to improve and the tailor the behavior:

using UnityEngine;
using System.Collections;

public class lockInput : MonoBehaviour {

    private bool _inputLocked;
    public float inputlockingTime = 1f;

    void UnlockInput(){
        _inputLocked = false;
    }

    void LockInput(){
        _inputLocked = true;
        Invoke("UnlockInput",inputlockingTime);
    }

    public bool isInputLocked(){
        return _inputLocked;
    }

    void Update () {

        if (Input.GetMouseButtonDown(0)){
            if ( isInputLocked() ){
                Debug.LogWarning("Input locked");
            }else{
                Debug.Log("Hello!");
                LockInput();
            }
        }
    }

}

Bye,

Jean