protected override void OnDestroy() { if (this == LoadingIndicator.instance) { LoadingIndicator.instance = null; } base.OnDestroy(); }
protected override void Awake() { base.Awake(); LoadingIndicator.instance = this; if (this.introOutro && this.introOutro.Animation) { UICache.OptimizeAnimPairOnetime(this.introOutro); } }
void Update() { if (!this.activate) { return; } if (this.IsDone) { LoadingIndicator.SetActiveWithDelay(false, 0); } }
public static void Close(bool immediate = false) { var inst = LoadingIndicator.instance; if (!inst) { return; } inst.list.Clear(); if (immediate) { LoadingIndicator.SetActiveWithDelay(false, 0); } }
public static void On(IsDoneCallback callback, float delay = 0) { if (null == callback) { throw new Exception("LOADING_INDICATOR:ON:EXCEPT:BAD_CALLBACK"); } var inst = LoadingIndicator.instance; if (!inst) { return; } inst.list.AddLast(callback); LoadingIndicator.SetActiveWithDelay(true, delay); }