001 002 003 004 005 006 007 008 009 010 011 012 013 014 015 016 017 018 019 020 021 022 | void Awake() { if (!GameSettings.hasLaunched) { GameSettings.hasLaunched = true ; if (PlayerPrefs.GetString( "last_launch" , "" ) == "" ) { // first launch PlayerPrefs.SetString( "last_launch" , DateTime.Today.ToShortDateString()); PlayerPrefs.SetInt( "number_of_launch" , 1); } else { if (PlayerPrefs.GetString( "last_launch" , "" ) != DateTime.Today.ToShortDateString()) { GameSettings.newDay = true ; PlayerPrefs.SetInt( "number_of_launch" , PlayerPrefs.GetInt( "number_of_launch" ) + 1); } PlayerPrefs.SetString( "last_launch" , DateTime.Today.ToShortDateString()); } PlayerPrefs.Save(); } } |
001 002 003 004 005 006 007 008 | if (GameSettings.newDay && PlayerPrefs.GetInt( "number_of_launch" ) > 3) { GameSettings.newDay = false ; GameSettings.coins += 10; PlayerPrefs.SetInt( "coins" , GameSettings.coins); PlayerPrefs.Save(); Snowman.instance.message( "+ 10 coin" ); } |