public void OnDestroy() { head = null; cur = null; next = null; instance = null; }
protected void AddToAnimatedList() { if (this.animating || !Application.isPlaying || !base.gameObject.activeInHierarchy) { return; } this.animating = true; SpriteAnimationPump.Add(this); }
void Awake() { #if STOP_ON_LEVEL_LOAD _timeScale = 1f; isPaused = false; pumpIsRunning = false; pumpIsDone = true; #else DontDestroyOnLoad(this); #endif instance = this; }
// Adds the sprite to the list of currently // animating sprites: protected override void AddToAnimatedList() { // Check to see if the coroutine is running, // and if not, start it: // if (!SpriteAnimationPump.pumpIsRunning) // SpriteAnimationPump.Instance.StartAnimationPump(); // If we're already animating, then we're // already in the list, no need to add again. // Also, if we're inactive, also don't add: if (animating || !Application.isPlaying || !gameObject.active) { return; } animating = true; SpriteAnimationPump.Add(this); }
// Adds the sprite to the list of currently // animating sprites: protected override void AddToAnimatedList() { // Check to see if the coroutine is running, // and if not, start it: // if (!SpriteAnimationPump.pumpIsRunning) // SpriteAnimationPump.Instance.StartAnimationPump(); // If we're already animating, then we're // already in the list, no need to add again. // Also, if we're inactive, also don't add: #if UNITY_4_0 || UNITY_4_1 || UNITY_4_2 || UNITY_4_3 || UNITY_4_4 || UNITY_4_5 || UNITY_4_6 || UNITY_4_7 || UNITY_4_8 || UNITY_4_9 if (animating || !Application.isPlaying || !gameObject.activeInHierarchy) #else if (animating || !Application.isPlaying || !gameObject.active) #endif { return; } animating = true; currentlyAnimating = true; SpriteAnimationPump.Add(this); }
void Awake() { instance = this; DontDestroyOnLoad(this); }
public void OnDestroy() { instance = null; }
protected void RemoveFromAnimatedList() { SpriteAnimationPump.Remove(this); this.animating = false; }
// Removes the sprite from the list of currently // animating sprites: protected override void RemoveFromAnimatedList() { SpriteAnimationPump.Remove(this); animating = false; }