예제 #1
0
    public void CreateOffers()
    {
        Vector3   originPosition  = offerOrigin.transform.localPosition;
        Transform parentTransform = offerOrigin.transform.parent;

        activeOfferNumber = 0;
        foreach (GameObject generatedOffer in generatedOffers)
        {
            Destroy(generatedOffer);
        }
        generatedOffers.Clear();
        CommonElements common = CommonElements.instance;

        foreach (Connector.JsonData.Room room in common.lastJsonDataWrapper.jsonDatas[0].ROOMS)
        {
            GameObject offer = Instantiate(offerPrefab, originPosition, Quaternion.identity) as GameObject;
            offer.transform.SetParent(parentTransform, false);

            OfferPanel offerPanel = offer.GetComponent <OfferPanel>();
            offerPanel.title.text       = room.title;
            offerPanel.actualUsers.text = Random.Range(1, Int32.Parse(room.maxUsr)) + "/" + room.maxUsr;
            offerPanel.userName.text    = CommonElements.instance.userNames[Int32.Parse(room.hID) - 1];
            offerPanel.backImage.sprite = CommonElements.instance.facesList[Int32.Parse(room.hID) - 1];
            offerPanel.description.text = room.descr;
            generatedOffers.Add(offer);
            offer.SetActive(false);
        }
        offerOrigin = generatedOffers[activeOfferNumber];
        generatedOffers[activeOfferNumber].SetActive(true);
    }
예제 #2
0
 void ExchangeInfomationGLOBAL_DataCurrentParametrUpdate(object sender, DataMarketParametrEventArgs e)
 {
     BidPanel.UpdateFreeValue(e.DataNew.Bid);
     OfferPanel.UpdateFreeValue(e.DataNew.Offer);
 }