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; }); }
void GiveWarning() { if (warningCount < warningMax) { warningCount++; Status = LoanStatus.Late; } else { LoanManager.Defaulted = true; Status = LoanStatus.Defaulted; Co2.WaitForFixedUpdate(() => { Group.Remove(this); }); } }
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(); } }
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); } } } }); }
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(); }