Code Monkey home page Code Monkey logo

unpauseme's Introduction

Don't Pause Me


Use for make Unity3D animations and particles not pause when you set the Time.timeScale to 0. It's useful when you want to play some pause menu animation or make some good effect while the game is paused by setting Time.timeScale 0.


How to use:

  • Download and add every thing to your project

  • For Unity3D animation: Start a coroutine with below method to play the animation to ignore timeScale: Play(string clipName, bool ignoreTimeScale,Action onComplete) For example, you want to play an unpause-animation name "anim1" in gameObject, do this StartCoroutine( gameObject.animation.Play("anim1",true,() => Debug.Log("onComplete"))); You will get a chance to notified by a completion Action when the animation finished.

BE CAUSION. You have to add use StartCoroutine in calling this Play extension method, or the script will not work!

  • For Particles For Legacy particles, add UnpauseParticleEmitter.cs as a component to the gameObject in which a Particle Emitter attached. And for Shuriken particles, add UnpauseParticleSystem.cs as a component to the gameObject in which a Particle System attached. Done.

*Tips: If you use iTween for some animation, you can use the ignoretimescale parameter to ignore timeScale. See more in iTween's docs.(http://itween.pixelplacement.com/)


You can also find a simple demo in the /DemoScene/UnpauseMe.unity

Enjoy!

Version 1.0

@onevcat, http://onevcat.com

unpauseme's People

Contributors

onevcat avatar

Stargazers

GoldenSlime avatar luzhou avatar Tinkingli avatar Luckey_Sun avatar Álvaro Rodríguez avatar superlee avatar MelodySo avatar Sheh伟伟 avatar aBaO avatar  avatar Chen Tao avatar saladfork avatar  avatar Sergey avatar

Watchers

James Cloos avatar  avatar  avatar

unpauseme's Issues

I got this error when i created this scriopt

The body of AnimationPlayIgnoreTimeScale.Play(this UnityEngine.Animation, string, bool, System.Action)' cannot be an iterator block becauseIEnumerator' is not an iterator interface type

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.