private void Update() { if (IsWaiting) { return; } if (following) { Follow.TriggerUpdate(); } else { Vector3 velocity = Follow.PhysicsController.CurrentVelocity; if (velocity == Vector3.zero) { TimerTracker.SetTimer(idleWaitTimerID, idleWaitDuration); } } }
protected bool UseItem(Item.Type type) { bool used = false; int amountUsed = 0; switch (type) { default: break; case Item.Type.RepairKit: used = true; amountUsed = 1; break; } if (used) { TimerTracker.SetTimer(itemUseCooldownTimerID, itemUseCooldownDuration); OnItemUsed?.Invoke(type, amountUsed); } return(used); }
public void Activate() { if (isActivated || ignore) { return; } if (!isRepeatable && activationCount > 0) { return; } if (isTimedPrompt) { PR.PromptSendRequest(text, text); TimerTracker.SetTimer(text, promptDuration); TimerTracker.SetFinishAction(text, Deactivate); } else { PR.PromptSendRequest(text, text); } SetIsActivated(true); activationCount++; }