Exemple #1
0
    // Use this for initialization
    void Start()
    {
        thisBtn = GetComponent <Button>();
        thisBtn.onClick.AddListener(openInfo);

        // should get from http request
        foreach (GamingInfo.storeInfoWithID item in GamingInfo.storeInfo)
        {
            if (shopID == item.id)
            {
                shopName.text = item.info.shopName;
                break;
            }
        }
        if (GetFavShopList.ifStoreOpen(shopID) == true)
        {
            category.text = "營業中"; // temp
            open.color    = new Color(223 / 255f, 161 / 255f, 105 / 255f);
        }
        else
        {
            category.text = "休息中"; // temp
            open.color    = new Color(161 / 255f, 156 / 255f, 151 / 255f);
        }
    }
    void removeItem()
    {
        Debug.Log("remove:" + shopID);
        // remove it from fav list

        for (int i = 0; i < PlayerInfo.fav_shopID_list.Count; ++i)
        {
            if (shopID == PlayerInfo.fav_shopID_list[i])
            {
                PlayerInfo.fav_shopID_list.RemoveAt(i);
                break;
            }
        }
        GetFavShopList.refreshContent();
    }