コード例 #1
0
 private void equip()
 {
     if (!equipped)
     {
         UserUnlockable.changeActiveWeapon(thisWeapon.getWeaponIndex());
         Market.Instance.unequip();
         equipped     = true;
         valueUI.text = "EQUIPED";
     }
 }
コード例 #2
0
ファイル: SaveSystem.cs プロジェクト: HassenBenAbid/FearNot
    public static void load()
    {
        string path = Application.persistentDataPath + "/profile.sav";

        if (File.Exists(path))
        {
            BinaryFormatter formatter = new BinaryFormatter();
            FileStream      stream    = new FileStream(path, FileMode.OpenOrCreate);

            playerProfile profile = formatter.Deserialize(stream) as playerProfile;

            UserUnlockable.addMoney(profile.money);
            UserUnlockable.changeActiveWeapon(profile.activeWeapon);
            UserUnlockable.setAllWeapons(profile.weapons);
            UserUnlockable.setAllItems(profile.items);

            stream.Close();
        }
        else
        {
            Debug.LogError("ERROR!");
        }
    }