Exemplo n.º 1
0
    // Use this for initialization
    void Start()
    {
        panelUpdater = this.GetComponent <WardrobePreviewPanelUpdater>();
        pageText     = GameObject.Find("PageText").GetComponent <Text>();
        //filterField = GameObject.Find("FilterField").GetComponent<InputField>();

        raceString   = "human";
        genderString = "male";

        genderDropdown.ClearOptions();
        genderDropdown.AddOptions(WardrobeStuff.genderMap.Keys.ToList());
        raceDropdown.ClearOptions();
        raceDropdown.AddOptions(WardrobeStuff.raceMap.Keys.ToList());
        appearanceDropdown.ClearOptions();
        updateRaceGender();

        slotChangeDropdown.ClearOptions();
        List <DOption> slotOptions = new List <DOption>();

        foreach (GearSlot slot in Enum.GetValues(typeof(GearSlot)))
        {
            DOption option = new DOption(slot.ToString(), slot);
            option.userObject = slot;
            slotOptions.Add(option);
        }
        slotChangeDropdown.AddOptions(slotOptions.Cast <Dropdown.OptionData>().ToList());

        DBInst.progress += (m) => progress = m;
        DBInst.loadOrCallback((d) => {
            db = d;
        });
    }
Exemplo n.º 2
0
    public void itemClicked()
    {
        if (item != null)
        {
            WardrobePreviewPanelUpdater wppu = GameObject.Find("Wardrobe").GetComponent <WardrobePreviewPanelUpdater>();
            Toggle toggle = GetComponentInChildren <Toggle>();

            GearSlot slot = item.allowedSlots.First();
            if (!mainPaperdoll.slotSet(slot))
            {
                mainPaperdoll.setGearSlotKey(slot, item.key);
                wppu.toggle(this, true);
            }
            else
            {
                long oldKey = mainPaperdoll.getGearSlot(slot);
                if (oldKey == item.key)
                {
                    mainPaperdoll.clearGearSlot(slot);
                    wppu.toggle(this, false);
                }
                else
                {
                    mainPaperdoll.setGearSlotKey(slot, item.key);
                    wppu.toggle(this, true);
                }
            }
        }
    }