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

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