Ejemplo n.º 1
0
    public static void SaveWeapon(WeaponStoreUI weapon)
    {
        BinaryFormatter formatter = new BinaryFormatter();

        string     path   = Application.persistentDataPath + "/Weapon.dat";
        FileStream stream = new FileStream(path, FileMode.Create);

        WeaponData data = new WeaponData(weapon);

        formatter.Serialize(stream, data);
        stream.Close();
    }
Ejemplo n.º 2
0
    public WeaponData(WeaponStoreUI store)
    {
        W.Clear();
        for (int i = 0; i < store.weapon.Length; i++)
        {
            weapon weapon = new weapon();
            weapon.id          = store.weapon[i].id;
            weapon.checkBuy    = store.weapon[i].checkBuy;
            weapon.checkUse    = store.weapon[i].checkUse;
            weapon.damage      = store.weapon[i].damage;
            weapon.damageSkill = store.weapon[i].skillDamage;

            W.Add(weapon);
        }
    }
Ejemplo n.º 3
0
 private void Start()
 {
     weaponStoreUI = GetComponentInParent <WeaponStoreUI>();
     info          = GameObject.FindGameObjectWithTag("storeWeapon").GetComponent <InfoStoreUI>();
     mySeft        = GetComponent <Image>();
 }