示例#1
0
    public static void DeleteNode(GameObject node)
    {
        if (node.tag == "CentralTopic")
        {
            // remember the name of the map
            string mapName = GameObject.FindObjectOfType <MindMap>().mapName;
            EasySave.Save("ResetMapName", mapName);
            EasySave.Save("isMapReset", true);
            SceneManager.LoadScene(0);
        }

        foreach (var go in node.GetComponent <Node>().nextNodes)
        {
            if (go != null)
            {
                DeleteNode(go);
            }
        }

        //delete relationship
        Destroy(node.GetComponent <Node>().relationship);

        // delete node
        Destroy(node);
    }
示例#2
0
 private void CheckFirstInit()
 {
     //If no key, then save 0 coins in bank.
     if (!EasySave.HasKey <string>("BankCoins"))
     {
         EasySave.Save("BankCoins", crypto.Encrypt(0));
     }
 }
示例#3
0
 private void OnApplicationQuit()
 {
     EasySave.Save("Lvl0Cleared", Lvl0Cleared);
     EasySave.Save("Lvl1Cleared", Lvl1Cleared);
     EasySave.Save("Lvl2Cleared", Lvl2Cleared);
     EasySave.Save("Lvl3Cleared", Lvl3Cleared);
     EasySave.Save("Lvl4Cleared", Lvl4Cleared);
     EasySave.Save("Lvl5Cleared", Lvl5Cleared);
 }
示例#4
0
 private void OnApplicationPause(bool pause)
 {
     EasySave.Save("Lvl0Cleared", Lvl0Cleared);
     EasySave.Save("Lvl1Cleared", Lvl1Cleared);
     EasySave.Save("Lvl2Cleared", Lvl2Cleared);
     EasySave.Save("Lvl3Cleared", Lvl3Cleared);
     EasySave.Save("Lvl4Cleared", Lvl4Cleared);
     EasySave.Save("Lvl5Cleared", Lvl5Cleared);
 }
示例#5
0
    public void AddCoins(int Coins)
    {
        int BankCoins = getBankCoins();

        BankCoins += Coins;

        EasySave.Save("BankCoins", crypto.Encrypt(BankCoins));

        ((DeathSG)UIManager.Instance.DeathSG).UpdateBankTMP();
    }
示例#6
0
    private void Start()
    {
        // Get Rid of this line of code when game is finished
        FirstRunCompleted = true;


        if (!FirstRunCompleted)
        {
            FirstRunCompleted = true;
            EasySave.Save("FirstRun", FirstRunCompleted);
        }
        CreditsPanel.SetActive(false);
    }
示例#7
0
 /// <summary>
 /// Checks score against high score and saves if higher
 /// </summary>
 private void CheckHigherScore()
 {
     // If new high score
     if (score > highScore)
     {
         highScore = score;
         EasySave.Save("highscore", crypto.Encrypt(highScore)); // Store high score
         ((DeathSG)UIManager.Instance.DeathSG).UpdateScoresTMP("new highscore\n" + score, "");
     }
     else
     {
         ((DeathSG)UIManager.Instance.DeathSG).UpdateScoresTMP("score " + score, "high score " + highScore);
     }
 }
示例#8
0
    /// <param name="Coins"></param>
    /// <returns>True if successful deduction</returns>
    public bool DeductCoins(int Coins)
    {
        int BankCoins = getBankCoins();

        if (BankCoins >= Coins)
        {
            BankCoins -= Coins;

            EasySave.Save("BankCoins", crypto.Encrypt(BankCoins));
            ((DeathSG)UIManager.Instance.DeathSG).UpdateBankTMP();

            return(true);
        }
        return(false);
    }
示例#9
0
 void settings()
 {
     print("yomom" + Settings.gameObject.activeInHierarchy);
     if (!Settings.gameObject.activeInHierarchy)
     {
         print("imdoinit");
         Settings.gameObject.SetActive(true);
         Time.timeScale = 0;
     }
     else
     {
         Time.timeScale = 1;
         Settings.gameObject.SetActive(false);
         EasySave.Save("collsize", collsize);
         EasySave.Save("size", size);
         EasySave.Save("speed", speed);
         EasySave.Save("frequency", Frequency);
     }
 }
示例#10
0
    private void Awake()
    {
        //Pass whatever you want to save in the function.
        EasySave.Save("my-int", 42);
        EasySave.Save("my-class", new MyClass(231, new List <int> {
            23, 33
        }));

        //Load your values with the key as a parameter and specify the type in the <>.
        Debug.Log("Loaded int: " + EasySave.Load <int>("my-int"));
        Debug.Log("Loaded MyClass: \n" + EasySave.Load <MyClass>("my-class"));

        //Loading with default value: defaultValue is returned if the key doesn't exist.
        Debug.Log("Loaded string: \"" + EasySave.Load("key", "Default Value") + "\"");

        //Does a key exist
        Debug.Log("The key \"int-key\" exists: " + EasySave.HasKey <int>("int-key"));
        Debug.Log("The key \"my-int\" exists: " + EasySave.HasKey <int>("my-int"));

        //Delete a key and it's values
        EasySave.Delete <int>("my-int");
        Debug.Log("The key \"my-int\" has been deleted. ");
    }