private void GrabEquipment()
    {
        GetEquipment      get     = GameObject.Find("Canvas").transform.Find("EquipmentDetail").Find("Viewport").Find("Content").GetComponent <GetEquipment>();
        List <GameObject> entries = get.GetEntries();
        SqlCommand        comm    = new SqlCommand("add_Owns", dbService.getConnection());

        comm.CommandType = System.Data.CommandType.StoredProcedure;
        SqlParameter username = comm.Parameters.Add("@Username", System.Data.SqlDbType.VarChar);

        username.Value = dbService.GetUsername();
        SqlParameter equipmentName = comm.Parameters.Add("@EquipmentName", System.Data.SqlDbType.VarChar);
        SqlParameter rarity        = comm.Parameters.Add("@Rarity", System.Data.SqlDbType.VarChar);

        foreach (GameObject obj in entries)
        {
            Toggle temp = obj.GetComponent <Toggle>();
            if (temp.isOn)
            {
                equipmentName.Value = obj.transform.Find("Label").Find("Name").GetComponent <Text>().text;
                rarity.Value        = obj.transform.Find("Label").Find("Rarity").GetComponent <Text>().text;
                comm.ExecuteNonQuery();
            }
        }
        comm             = new SqlCommand("Level_Up", dbService.getConnection());
        comm.CommandType = System.Data.CommandType.StoredProcedure;
        username         = comm.Parameters.Add("@Username", System.Data.SqlDbType.VarChar);
        username.Value   = dbService.GetUsername();
        comm.ExecuteNonQuery();
        dbService.SetDungeonName("");
        DontDestroyOnLoad(dbService);
        SceneManager.LoadScene("DisplayDungeon");
    }
Esempio n. 2
0
        public static void Main(string[] args)
        {
            //eventually clear out this area to further abstract
            //add further classes and/or projects to control further aspects, ie playable class management, inventory configuration, attack creation, etc.
            List <Weapon> Weapons = new List <Weapon>();

            var weaponList = GetEquipment.GetAllWeapons();

            foreach (var weapon in weaponList)
            {
                Weapon w = new Weapon();
                w.Name       = weapon.Name;
                w.DamageDie  = weapon.Damage.Damage_Dice;
                w.DamageType = weapon.Damage.Damage_Type.Name;
                w.Properties = new List <string>();
                foreach (var property in weapon.Properties)
                {
                    w.Properties.Add(property.Name);
                }
                Weapons.Add(w);
            }
            foreach (var w in Weapons)
            {
                Console.WriteLine(w.ToString());
            }
        }
    private void ToggleAll()
    {
        GetEquipment      get     = GameObject.Find("Canvas").transform.Find("EquipmentDetail").Find("Viewport").Find("Content").GetComponent <GetEquipment>();
        List <GameObject> entries = get.GetEntries();

        foreach (GameObject obj in entries)
        {
            Toggle temp = obj.GetComponent <Toggle>();
            temp.isOn = toggle;
        }
        toggle = !toggle;
    }
Esempio n. 4
0
    public static string C2SGetEquipment()
    {
        GetEquipment data = new GetEquipment();

        return(JsonMapper.ToJson(data));
    }