Exemple #1
0
 public void OnEnable()
 {
     // This is stupid but necessary because the scale comes in all weird
     RectTransform.localScale = Vector3.zero;
     Co2.WaitForFixedUpdate(() => {
         RectTransform.localScale = Vector3.one;
     });
 }
Exemple #2
0
 void GiveWarning()
 {
     if (warningCount < warningMax)
     {
         warningCount++;
         Status = LoanStatus.Late;
     }
     else
     {
         LoanManager.Defaulted = true;
         Status = LoanStatus.Defaulted;
         Co2.WaitForFixedUpdate(() => { Group.Remove(this); });
     }
 }
Exemple #3
0
 public void AddTime()
 {
     elapsedTime++;
     if (elapsedTime > settings.GracePeriod)
     {
         /*if (PlayerItemGroup.Count < Payment) {
          *      GiveWarning ();
          *      elapsedTime --;
          * } else {
          * }*/
         Status = LoanStatus.Repayment;
         PlayerItemGroup.Remove(Payment);
     }
     if (elapsedTime == settings.GracePeriod + settings.RepaymentLength)
     {
         Co2.WaitForFixedUpdate(() => { Group.Remove(this); });
     }
     if (onUpdate != null)
     {
         onUpdate();
     }
 }
Exemple #4
0
 protected override void OnEnable()
 {
     base.OnEnable();
     Co2.WaitForFixedUpdate(() => {
         if (gameObject.activeSelf)
         {
             GridPoint gp = Element as GridPoint;
             if (gp != null)
             {
                 pbar = UI.Instance.CreateProgressBar(gp.Position);
             }
             else
             {
                 Connection c = Element as Connection;
                 if (c != null)
                 {
                     pbar = UI.Instance.CreateProgressBar(c.Center);
                 }
             }
         }
     });
 }
Exemple #5
0
    public void TestRepeat(PerformerTask repeat)
    {
        PerformableTasks.Add(repeat);
        repeat.onEnd += (PerformerTask task) => {
            Co2.WaitForFixedUpdate(() => {
                if (repeat.Performing)
                {
                    Debug.Log("Repeat test succeeded :)");
                }
                else
                {
                    Debug.Log("Repeat test failed :(");
                }
                repeat.Stop();
            });
        };

        if (!repeat.Settings.Repeat)
        {
            throw new System.Exception("The task '" + repeat.GetType() + "' will not repeat because its data model has Repeat set to false");
        }

        repeat.Start();
    }