public Contractor() { updateRateType = UpdateRateType.Fixed; updateYieldType = new WaitForFixedUpdate(); updateRate = .02f; Duration = 1f; }
public Contractor(System.Action onComplete, float duration = 1f) { updateRateType = UpdateRateType.Fixed; updateYieldType = new WaitForFixedUpdate(); updateRate = .02f; OnComplete = onComplete; Duration = duration; }
public void SetUpdateRate(UpdateRateType type) { updateRateType = type; if (updateRateType == UpdateRateType.Fixed) { updateYieldType = new WaitForFixedUpdate(); updateRate = UnityEngine.Time.fixedDeltaTime; } else if (updateRateType == UpdateRateType.Frame) { updateYieldType = new WaitForEndOfFrame(); updateRate = UnityEngine.Time.deltaTime; } else { //custom makes no assumptions on what the user wants } }
public void SetCustomYieldType(YieldInstruction yeildType) { updateRateType = UpdateRateType.Custom; updateYieldType = yeildType; }
public void SetCustomUpdateRate(float customRate) { updateRate = customRate; updateRateType = UpdateRateType.Custom; updateYieldType = new WaitForSeconds(customRate); }