Drives all sprite animation using a coroutine. A SpriteAnimationPump instance will be automatically created by the first sprite created in the scene.
Inheritance: MonoBehaviour
Exemplo n.º 1
0
 public void OnDestroy()
 {
     head     = null;
     cur      = null;
     next     = null;
     instance = null;
 }
Exemplo n.º 2
0
 protected void AddToAnimatedList()
 {
     if (this.animating || !Application.isPlaying || !base.gameObject.activeInHierarchy)
     {
         return;
     }
     this.animating = true;
     SpriteAnimationPump.Add(this);
 }
Exemplo n.º 3
0
    void Awake()
    {
#if STOP_ON_LEVEL_LOAD
        _timeScale    = 1f;
        isPaused      = false;
        pumpIsRunning = false;
        pumpIsDone    = true;
#else
        DontDestroyOnLoad(this);
#endif
        instance = this;
    }
Exemplo n.º 4
0
    // 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);
    }
Exemplo n.º 5
0
    // 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);
    }
Exemplo n.º 6
0
 void Awake()
 {
     instance = this;
     DontDestroyOnLoad(this);
 }
Exemplo n.º 7
0
 public void OnDestroy()
 {
     instance = null;
 }
Exemplo n.º 8
0
 protected void RemoveFromAnimatedList()
 {
     SpriteAnimationPump.Remove(this);
     this.animating = false;
 }
Exemplo n.º 9
0
 // Removes the sprite from the list of currently
 // animating sprites:
 protected override void RemoveFromAnimatedList()
 {
     SpriteAnimationPump.Remove(this);
     animating = false;
 }
	void Awake()
	{
		instance = this;
		DontDestroyOnLoad(this);
	}
	public void OnDestroy()
	{
		instance = null;
	}
Exemplo n.º 12
0
	void Awake()
	{
#if STOP_ON_LEVEL_LOAD
		_timeScale = 1f;
		isPaused = false;
		pumpIsRunning = false;
		pumpIsDone = true;
#else
		DontDestroyOnLoad(this);
#endif
		instance = this;
	}
Exemplo n.º 13
0
	public void OnDestroy()
	{
		head = null;
		cur = null;
		next = null;
		instance = null;
	}