Example #1
0
    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;
    }
Example #2
0
    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;
        }
    }