public static void CreateDifficultyObject() { DifficultyObject asset = ScriptableObject.CreateInstance <DifficultyObject>(); AssetDatabase.CreateAsset(asset, AssetDatabase.GetAssetPath(Selection.activeObject) + "/NewDifficulty.asset"); AssetDatabase.SaveAssets(); EditorUtility.FocusProjectWindow(); Selection.activeObject = asset; }
void ChooseDifficulty() { difficulty = PlayerPrefs.GetString("difficulty", "easy"); if (difficulty != "easy" && difficulty != "medium" && difficulty != "hard") { difficulty = "easy"; } if (difficulty == "easy") { currentDifficulty = easy; } else if (difficulty == "medium") { currentDifficulty = medium; } else { currentDifficulty = hard; } }