예제 #1
0
 public void Clone(MaleWigProperties fwp)
 {
     this.wigColor             = new float[] { fwp.wigColor[0], fwp.wigColor[1], fwp.wigColor[2], fwp.wigColor[3] };
     this.imgName              = fwp.imgName;
     this.finalImageUrl        = fwp.finalImageUrl;
     this.wearingCode          = fwp.wearingCode;
     this.mfType               = fwp.mfType;
     this.finalSavePath        = fwp.finalSavePath;
     this.lockStatus           = fwp.lockStatus;
     this.serializedJsonObject = fwp.serializedJsonObject;
     this.gameController       = fwp.gameController;
     this.mo = fwp.mo;
 }
 public void Clone(ShoeProperties sp)
 {
     this.shoeColor            = new float[] { sp.shoeColor[0], sp.shoeColor[1], sp.shoeColor[2], sp.shoeColor[3] };
     this.imgName              = sp.imgName;
     this.finalImageUrl        = sp.finalImageUrl;
     this.wearingCode          = sp.wearingCode;
     this.mfType               = sp.mfType;
     this.finalSavePath        = sp.finalSavePath;
     this.lockStatus           = sp.lockStatus;
     this.serializedJsonObject = sp.serializedJsonObject;
     this.gameController       = sp.gameController;
     this.mo = sp.mo;
 }
예제 #3
0
 public void Clone(DressProperties dp)
 {
     this.dressColor           = new float[] { dp.dressColor[0], dp.dressColor[1], dp.dressColor[2], dp.dressColor[3] };
     this.imgName              = dp.imgName;
     this.finalImageUrl        = dp.finalImageUrl;
     this.wearingCode          = dp.wearingCode;
     this.mfType               = dp.mfType;
     this.finalSavePath        = dp.finalSavePath;
     this.lockStatus           = dp.lockStatus;
     this.serializedJsonObject = dp.serializedJsonObject;
     this.gameController       = dp.gameController;
     this.mo = dp.mo;
 }
예제 #4
0
    public void InitializeOrnamentProperty(MiniJsonObject m)
    {
        if (gameController == null)
        {
            gameController = GameObject.FindGameObjectWithTag("GameController").GetComponent <GameController>();
        }

        if (rfm == null)
        {
            rfm = GameObject.FindGameObjectWithTag("ResourceFileManager").GetComponent <ResourceFileManager>();
        }
        propertyType = "ornament";

        GetComponent <Button>().onClick.RemoveAllListeners();
        GetComponent <Button>().onClick.AddListener(InvokeUseThisOrnament);

        mo = m;
        serializedJsonObject = mo.ToString(); //MiniJSON.jsonEncode(m);


        wearingCode = mo.GetField("type_id", -1);

        imgName = mo.GetField("icon", "");

        lockStatus = mo.GetField("lock_status", "false");

        if (!gameController.IsPaidUser && lockStatus == "true")
        {
            //GetComponent<Button>().interactable = false; // may we need to change this..?
            transform.GetChild(0).gameObject.SetActive(true);
        }


        switch (wearingCode)
        {
        case 1:     //download female dress
        {
            if (imgName != "")
            {
                finalImageUrl = string.Format(rfm.imageUrlFormat, imgName);
                finalSavePath = Path.Combine(rfm.dataPathDict["dressFemaleDataPath"], imgName);


                //StartCoroutine(DownloadImage(finalImageUrl, finalSavePath));

                //UpdateDownloadInfo();
            }
            break;
        }

        case 2:      //download female wig
        {
            if (imgName != "")
            {
                finalImageUrl = string.Format(rfm.imageUrlFormat, imgName);
                finalSavePath = Path.Combine(rfm.dataPathDict["wigFemaleDataPath"], imgName);


                //StartCoroutine(DownloadImage(finalImageUrl, finalSavePath));

                //UpdateDownloadInfo();
            }
            break;
        }

        case 3:      //download female ornament
        {
            if (imgName != "")
            {
                finalImageUrl = string.Format(rfm.imageUrlFormat, imgName);
                finalSavePath = Path.Combine(rfm.dataPathDict["ornamentFemaleDataPath"], imgName);


                //StartCoroutine(DownloadImage(finalImageUrl, finalSavePath));

                //UpdateDownloadInfo();
            }
            break;
        }

        case 4:      //download female shoe
        {
            if (imgName != "")
            {
                finalImageUrl = string.Format(rfm.imageUrlFormat, imgName);
                finalSavePath = Path.Combine(rfm.dataPathDict["shoeFemaleDataPath"], imgName);


                //StartCoroutine(DownloadImage(finalImageUrl, finalSavePath));

                //UpdateDownloadInfo();
            }
            break;
        }

        case 5:     //download male wig
        {
            if (imgName != "")
            {
                finalImageUrl = string.Format(rfm.imageUrlFormat, imgName);
                finalSavePath = Path.Combine(rfm.dataPathDict["wigMaleDataPAth"], imgName);


                //StartCoroutine(DownloadImage(finalImageUrl, finalSavePath));

                //UpdateDownloadInfo();
            }
            break;
        }

        case 6:     // download male tie
        {
            if (imgName != "")
            {
                finalImageUrl = string.Format(rfm.imageUrlFormat, imgName);
                finalSavePath = Path.Combine(rfm.dataPathDict["tieMaleDataPath"], imgName);


                //StartCoroutine(DownloadImage(finalImageUrl, finalSavePath));

                //UpdateDownloadInfo();
            }
            break;
        }

        default:
        {
            break;
        }
        }

        _isInitialized = true;
        StartCoroutine(SetImage());
    }
    public void InitializeShoeProperty(string jsonString, Color sc)
    {
        if (jsonString == "" || jsonString == null)
        {
            IsInitialized = false;
            return;
        }
        MiniJsonObject m = new MiniJsonObject(jsonString);

        if (gameController == null)
        {
            gameController = GameObject.FindGameObjectWithTag("GameController").GetComponent <GameController>();
        }

        if (rfm == null)
        {
            rfm = GameObject.FindGameObjectWithTag("ResourceFileManager").GetComponent <ResourceFileManager>();
        }
        propertyType = "shoe";

        //GetComponent<Button>().onClick.RemoveAllListeners();
        //GetComponent<Button>().onClick.AddListener(UseThisDress);

        mo = m;
        serializedJsonObject = mo.ToString(); //MiniJSON.jsonEncode(mo);

        wearingCode = mo.GetField("type_id", -1);

        imgName = mo.GetField("icon", "");

        lockStatus = mo.GetField("lock_status", "false");

        //if (!gameController.IsPaidUser && lockStatus == "true")
        //{
        //    GetComponent<Button>().interactable = false;
        //    transform.GetChild(0).gameObject.SetActive(true);
        //}

        switch (wearingCode)
        {
        case 1:     //download female dress
        {
            if (imgName != "")
            {
                finalImageUrl = string.Format(rfm.imageUrlFormat, imgName);
                finalSavePath = Path.Combine(rfm.dataPathDict["dressFemaleDataPath"], imgName);
                //finalSavePath = Path.Combine(rfm.dataPathDict["thumb_dressFemaleDataPath"], imgName);


                //StartCoroutine(DownloadImage(finalImageUrl, finalSavePath));

                //UpdateDownloadInfo();
            }
            break;
        }

        case 2:      //download female wig
        {
            if (imgName != "")
            {
                finalImageUrl = string.Format(rfm.imageUrlFormat, imgName);
                finalSavePath = Path.Combine(rfm.dataPathDict["wigFemaleDataPath"], imgName);
                //finalSavePath = Path.Combine(rfm.dataPathDict["thumb_wigFemaleDataPath"], imgName);


                //StartCoroutine(DownloadImage(finalImageUrl, finalSavePath));

                //UpdateDownloadInfo();
            }
            break;
        }

        case 3:      //download female ornament
        {
            if (imgName != "")
            {
                finalImageUrl = string.Format(rfm.imageUrlFormat, imgName);
                finalSavePath = Path.Combine(rfm.dataPathDict["ornamentFemaleDataPath"], imgName);
                //finalSavePath = Path.Combine(rfm.dataPathDict["thumb_ornamentFemaleDataPath"], imgName);


                //StartCoroutine(DownloadImage(finalImageUrl, finalSavePath));

                //UpdateDownloadInfo();
            }
            break;
        }

        case 4:      //download female shoe
        {
            if (imgName != "")
            {
                finalImageUrl = string.Format(rfm.imageUrlFormat, imgName);
                finalSavePath = Path.Combine(rfm.dataPathDict["shoeFemaleDataPath"], imgName);
                //finalSavePath = Path.Combine(rfm.dataPathDict["thumb_shoeFemaleDataPath"], imgName);


                //StartCoroutine(DownloadImage(finalImageUrl, finalSavePath));

                //UpdateDownloadInfo();
            }
            break;
        }

        case 5:     //download male wig
        {
            if (imgName != "")
            {
                finalImageUrl = string.Format(rfm.imageUrlFormat, imgName);
                finalSavePath = Path.Combine(rfm.dataPathDict["wigMaleDataPAth"], imgName);
                //finalSavePath = Path.Combine(rfm.dataPathDict["thumb_wigMaleDataPAth"], imgName);


                //StartCoroutine(DownloadImage(finalImageUrl, finalSavePath));

                //UpdateDownloadInfo();
            }
            break;
        }

        case 6:     // download male tie
        {
            if (imgName != "")
            {
                finalImageUrl = string.Format(rfm.imageUrlFormat, imgName);
                finalSavePath = Path.Combine(rfm.dataPathDict["tieMaleDataPath"], imgName);
                //finalSavePath = Path.Combine(rfm.dataPathDict["thumb_tieMaleDataPath"], imgName);


                //StartCoroutine(DownloadImage(finalImageUrl, finalSavePath));

                //UpdateDownloadInfo();
            }
            break;
        }

        default:
        {
            break;
        }
        }

        shoeColor      = new float[] { sc.r, sc.g, sc.b, sc.a };
        _isInitialized = true;
        print("successfully init shoeproperty");
        //StartCoroutine(SetImage());
    }
 public void ReplaceObject(MiniJsonObject obj, int index)
 {
     jsonArray [index] = obj.GetHashTable;
 }
 public void AddObject(MiniJsonObject obj)
 {
     jsonArray.Add(obj.GetHashTable);
 }
 public MiniJsonObject Get(int i)
 {
     //if(child == null)
     child = new MiniJsonObject(jsonArray [i] as Hashtable);
     return(child);
 }