public static int LoadBestRecord(GameSystem.Mode mode, GameSystem.ModeType modeType) { string finalKey = string.Format(KeyBestScore, (int)mode, (int)modeType); int defaultValue = (modeType == GameSystem.ModeType.PassLevel ? 1 : 0); return(LoadIntValue(finalKey, defaultValue)); }
public static void RequestGameLeaderboard(GameSystem.Mode mode, GameSystem.ModeType modeType, MonoBehaviour target, KTPlayLeaderboard.Callback callback, int startIndex = 0) { if (Application.platform == RuntimePlatform.IPhonePlayer || Application.platform == RuntimePlatform.Android) { string leaderboardId = LeaderboardIDs[(int)mode][(int)modeType]; Debug.Log("request leaderboard ID of game:" + leaderboardId); KTPlayLeaderboard.GlobalLeaderboard(leaderboardId, startIndex, Constant.TOP_RANK_COUNT, target, callback); } }
/** * (ATAN((POWER(A2;1.4)- I2/2) / (I2/4)) + 1.57) / 3.14 * 110 - 10 */ public static int computePercentByScore(GameSystem.Mode mode, GameSystem.ModeType modeType, int score) { Debug.Log("HighScore:" + HighScores.ToString()); float param = (float)HighScores[(int)mode][(int)modeType]; Debug.Log("Param:" + param.ToString()); int percent = (int)((Mathf.Atan((Mathf.Pow((float)score, 1.1f) - (param / 2.0f)) / (param / 4.0f)) + Mathf.PI / 2.0f) / Mathf.PI * 110.0f - 10.0f); return(percent); }
public static void ReportScore(GameSystem.Mode mode, GameSystem.ModeType modeType, int score) { if (Application.platform == RuntimePlatform.IPhonePlayer || Application.platform == RuntimePlatform.Android) { if (KTAccountManager.IsLoggedIn()) { string leaderboardId = LeaderboardIDs[(int)mode][(int)modeType]; KTPlayLeaderboard.ReportScore(score, leaderboardId, LeaderboardTarget, LeaderboardCallback); } } }
public static bool LoadModeUnlock(GameSystem.Mode mode) { string finalKey = string.Format(KeyModeUnlock, (int)mode); if (mode == GameSystem.Mode.Classic || mode == GameSystem.Mode.Dual) { return(true); } else { return(LoadBoolValue(finalKey, false)); } }
public static Wave GetPassLevelWaveData(GameSystem.Mode mode, int waveNumber) { waveNumber = (waveNumber - 1) / 3 + 1; int gridLength = 3; if (gridLength == 7) { int finalCount = 0; if (waveNumber > 74) { finalCount = 27; } else { finalCount = (gridLength - 1) + (waveNumber - 1 - passLevelCountForLength[gridLength - 4]); } return(new Wave(gridLength, gridLength, finalCount)); } while (waveNumber > passLevelCountForLength[gridLength - 3] && gridLength != 7) { gridLength++; } int blockCount = 0; if (gridLength == 3) { blockCount = (gridLength - 1) + (waveNumber - 1); } else { blockCount = (gridLength - 1) + (waveNumber - 1 - passLevelCountForLength[gridLength - 4]); } return(new Wave(gridLength, gridLength, blockCount)); }
public void SetRecommendMode(GameSystem.Mode mode) { recommendMode = mode; }
public static void SaveModeUnlock(GameSystem.Mode mode, bool unlock) { string finalKey = string.Format(KeyModeUnlock, (int)mode); SaveBoolValue(finalKey, unlock); }
public static void SaveBestRecord(GameSystem.Mode mode, GameSystem.ModeType modeType, int record) { string finalKey = string.Format(KeyBestScore, (int)mode, (int)modeType); SaveIntValue(finalKey, record); }
public static void SaveModeEntered(GameSystem.Mode mode, bool entered) { string finalKey = string.Format(KeyModeEntered, (int)mode); SaveBoolValue(finalKey, entered); }
public static int HellLevelIndex(GameSystem.Mode mode) { return(LevelData.wavesInfo[(int)mode].Length - 1); }
public static int NormalLevelMaxIndex(GameSystem.Mode mode) { return(LevelData.wavesInfo[(int)mode].Length - 2); }