public static void Clear(Action function) { if (function == null) { return; } if (functionDict.ContainsKey(function)) { SetInterval interval = functionDict[function]; functionDict.Remove(function); Destroy(interval); interval.fun = null; } }
public static void Start(Action function, float delay, bool isIgnoreTimeScale = true) { Clear(function); if (function == null) { return; } if (MainEntry.Instance == null) { return; } SetInterval interval = MainEntry.Instance.gameObject.AddComponent <SetInterval>(); interval.Add(function, delay, isIgnoreTimeScale); functionDict.Add(function, interval); }
// Verifies whether there is a subscriber to the OnFirstNoteChange and OnSecondNoteChange // If there is any tells them about the new defined interval private void tellAboutNewInterval() { SetInterval handler = OnFirstNoteChange; if (handler != null) { //*****************PENDIENTE: borrar Debug.Log("1ra nota: " + firstNoteName); handler(firstNoteName); } handler = OnSecondNoteChange; if (handler != null) { //*****************PENDIENTE: borrar Debug.Log("2da nota: " + secondNoteName); handler(secondNoteName); } }
public override void Handle(Page page) { var i = SetInterval?.Interval(page); if (i != null) { Interval = i.Value; } if (Stopper != null) { if (!Stopper.NeedStop(page, this)) { page.AddTargetRequests(GenerateRequests(page)); page.MissExtractTargetUrls = true; } } else { page.AddTargetRequests(GenerateRequests(page)); page.MissExtractTargetUrls = true; } }