Example #1
0
 public Contractor()
 {
     updateRateType  = UpdateRateType.Fixed;
     updateYieldType = new WaitForFixedUpdate();
     updateRate      = .02f;
     Duration        = 1f;
 }
Example #2
0
        public Contractor(System.Action onComplete, float duration = 1f)
        {
            updateRateType  = UpdateRateType.Fixed;
            updateYieldType = new WaitForFixedUpdate();
            updateRate      = .02f;

            OnComplete = onComplete;
            Duration   = duration;
        }
Example #3
0
 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
     }
 }
Example #4
0
 public void SetCustomYieldType(YieldInstruction yeildType)
 {
     updateRateType  = UpdateRateType.Custom;
     updateYieldType = yeildType;
 }
Example #5
0
 public void SetCustomUpdateRate(float customRate)
 {
     updateRate      = customRate;
     updateRateType  = UpdateRateType.Custom;
     updateYieldType = new WaitForSeconds(customRate);
 }