I still don't know what "disable" means, but I think it's better to put a script on the object (if any) and put the flag "Processing in progress" in order to determine "Unprocessable Time".
bool isActive=false;
public void StartAction() {
if(isActive) return;// Do nothing because it is "Processing"
StartCoroutine (DoAction());
}
Enumerator DoAction() {
isActive = true;
// Something to do with it
yield return new WaitForSeconds (10.0f); // 10 seconds
isActive=false;
}
Why don't you copy the object and put it back in n seconds?
Why don't you record the time you last ran on the static member and implement it in a way that allows you to wait when running the method compared to the current time?
It might be a little complicated when there are multiple objects at once...
© 2024 OneMinuteCode. All rights reserved.