- Home /
animation control by time/clock
Hi all
Maybe my question will look stupid, I am really a beginner with Unity. I'd like make a mesh to change during a certain lenght of time using simple scale animation. But I'd like it to happen even when the game is turn off. Does anybody know how I could do that?
Cheers
Answer by GesterX · May 05, 2011 at 10:03 AM
Since the game is not running it is impossible to run any code.
The best way to solve your problem is to use the javascript functions for getting the time and data (see here) when the game ends and save it to the PlayerPrefs. When the game begins find the current time and date again. Then calculate the difference in between the two times and alter your mesh accordingly.
That is not right - you can run scripts while game is not running.
Answer by Paulius-Liekis · May 05, 2011 at 07:59 PM
There is special attribute for running scripts in Editor mode. See this: http://unity3d.com/support/documentation/ScriptReference/ExecuteInEditMode.html
But animations won't run themselves you will have to update time and Sample animation manually. I think that should work.