Beispiel #1
0
 // Use this for initialization
 void Start()
 {
     InitializeShopGoods();
     shopPane           = GameObject.FindGameObjectWithTag("ShopPane").GetComponent <DuloGames.UI.UIWindow>();
     shopPaneController = shopPane.GetComponent <ShopPaneController>();
     inventory          = GameObject.FindGameObjectWithTag("Inventory").GetComponent <DuloGames.UI.UIWindow>();
 }
    // Update is called once per frame
    void Update()
    {
        if (shop == null)
        {
            shop = GameObject.FindGameObjectWithTag("ShopPane").GetComponent <DuloGames.UI.UIWindow>();
        }
        if (costArea != null)
        {
            if (shop.IsOpen && !costArea.activeSelf)
            {
                costArea.SetActive(true);
            }
            else if (!shop.IsOpen && costArea.activeSelf)
            {
                costArea.SetActive(false);
            }
        }
        if (!details)
        {
            return;
        }
        if (!initialized && name != null)
        {
            initialized = true;
            details.SetActive(false);
            nameText.text = name;
            switch (quality)
            {
            case 0:
                foldoutBackground.color = GetComponent <Image>().color = Color.white;
                break;

            case 1:
                foldoutBackground.color = GetComponent <Image>().color = Color.red;
                break;

            case 2:
                foldoutBackground.color = GetComponent <Image>().color = new Color(1, 0.647f, 0);
                break;

            case 3:
                foldoutBackground.color = GetComponent <Image>().color = Color.yellow;
                break;

            case 4:
                foldoutBackground.color = GetComponent <Image>().color = Color.green;
                break;

            case 5:
                foldoutBackground.color = GetComponent <Image>().color = Color.blue;
                break;

            case 6:
                foldoutBackground.color = GetComponent <Image>().color = new Color(111f / 255f, 0, 1f);
                break;

            case 7:
            default:
                foldoutBackground.color = GetComponent <Image>().color = new Color(0.5f, 0, 0.5f);
                break;
            }
            var eds = GetComponent <EquipDropSlot>();
            if (eds != null)
            {
                eds.startingColor = GetComponent <Image>().color;
            }
            if (number < 0)
            {
                return;
            }
            foreach (Transform child in arrowContainer.transform)
            {
                Destroy(child.gameObject);
            }
            if (GetComponent <ShopItemController>() != null)
            {
                UpdateArrowsForShopItem();
                return;
            }
            UpdateArrows();
        }
    }