public static float GetPlayerNormalSpeed(float playerInitSpeed) { if (GameConst.instance.gameMode == 0) { float coefficient = (GameConst.Level != 1) ? (float)(GameConst.Level - 1) / 17 : 0; return(playerInitSpeed + (int)(35 * (1 - Mathf.Exp(-(coefficient))))); } else if (GameConst.instance.gameMode == 1) { return(playerInitSpeed + ((GameConst.Level - 1) * LevelDesigner.speedUp(0))); } else { return(playerInitSpeed); } }
public void LevelChanger(float playerMAX) { gunScript.StopGun(); Level = LevelDesigner.levelUp(Level); Player.instance.speed.z = LevelDesigner.speedUp(Player.instance.speed.z); Player.instance.normalSpeed = Player.instance.speed.z; if (gameMode == 0) { Debug.Log("Level Finish Has Started"); StartCoroutine(LevelEndedState(playerMAX)); } else if (gameMode == 1) { Debug.Log("Endless Finish Has Started"); StartCoroutine(LevelChangeState(playerMAX, Player.instance.speed.z)); } }