- Home /
MMO Timer?
I want to make a MMO game like grepolis and i want to make raw materials to produce. For example the wood is 0 and after 60 seconds became 10, but when you close the google the game produce the materials.
Comment
Answer by Benifir · Aug 31, 2013 at 10:18 AM
I might use a Finite State Machine, and switch states every time the timer hits zero. You can make a simple timer by saying
private float _timer = 60.0f;
public void StartTimer() {
_timer -= Time.deltaTime
if(_timer =< 0)
_timer = 0;
if(_timer = 0)
//Do Something
}
okay but if you close the browser and open that again the materials will became zero
Your answer
Follow this Question
Related Questions
How to reduce draw calls resulting from character models in an MMO? 0 Answers
Mysteries of yield 1 Answer
C# yield error 3 Answers