Example #1
0
    string GenerateBundleLabel(BundleManager.Bundle b)
    {
        string result = "";

        for (int n = 0; n < b.types.Length; n++)
        {
            switch (b.types[n])
            {
            case FlowerType.Common:
                result += "C";
                break;

            case FlowerType.Seasonal:
                result += "S";
                break;

            case FlowerType.Rare:
                result += "R";
                break;

            case FlowerType.Unique:
                result += "U";
                break;
            }
            if (n < b.types.Length - 1)
            {
                result += " + ";
            }
        }
        return(result);
    }
Example #2
0
 public void SetBundle(BundleManager.Bundle bundle)
 {
     this.bundle     = bundle;
     bundleText.text = GenerateBundleLabel(bundle);
     sellButton.GetComponentInChildren <Text>().text = $"${bundle.value}";
     SetActive();
     sellButton.onClick.AddListener(OnSellButtonPress);
 }
    public void AddBundle(BundleManager.Bundle bundle)
    {
        GameObject newBundle = Instantiate(bundleListEntryPrefab, parentGroup.transform);

        newBundle.GetComponent <BundleListEntry>().SetBundle(bundle);
        FlowerType type = bundle.types[0];

        if (bundle.types.All(t => t == type))
        {
            newBundle.transform.SetAsLastSibling();
        }
    }