public static void PlayUI(this ParticleLoader loader, Renderer r, int deltaRQ, Action <ParticleControl> loadCallback = null, Action <ParticleControl> endCallback = null) { if (loader == null) { return; } UIPanel p = loader.GetComponentInParent <UIPanel>(); if (p != null) { loader.Play(particle => { if (particle != null) { particle.SetRqDelta(r, deltaRQ); } else { Assert.IsNotNull(particle); } loadCallback.Call(particle); }, endCallback); } else { loader.Play(loadCallback, endCallback); } }
void OnEnable() { if (Platform.isEditor) { Assert.IsNull(GetComponent <UIWidget>()); Assert.IsTrue(GetComponents <UIPivot>().Length == 1, "Name {0}. More than one Pivot", name); } InvalidateLayout(); }