Example #1
0
    private void Initialize(int modelindex, float modelrotation, string model, string bodytone, string eye, GameController gameController, string dress = "", string wig = "", string ornament = "", string shoe = "")
    {
        dressData      = new DressData();
        femaleWigData  = new FemaleWigData();
        ornamentData   = new OrnamentData();
        shoeData       = new ShoeData();
        backgroundData = new BackGroundData();

        modelindex    = modelIndex;
        modelRotation = modelrotation;
        modelNameame  = model;
        bodytoneName  = bodytone;
        eyeName       = eye;
        dressName     = dress;
        wigName       = wig;
        ornamentName  = ornament;
        shoeName      = shoe;
        gameController.currentBackgroundProperty.CopyTo(ref backgroundProperty);
        backgroundName = backgroundProperty.backGroundName;
        isShowingMale  = gameController.isShowingMale;
    }
Example #2
0
    public void ReCheckData(GameController gameController)
    {
        Debug.Log("Recheck started");
        dressData      = new DressData();
        femaleWigData  = new FemaleWigData();
        ornamentData   = new OrnamentData();
        shoeData       = new ShoeData();
        backgroundData = new BackGroundData();
        maleData       = new MaleData();
        gameController.currentBackgroundProperty.CopyTo(ref backgroundProperty);
        maleData.maleIsShowing = isShowingMale = gameController.isShowingMale;
        this.bodyToneColor     = new float[] { 0.5f, gameController.femaleModelImageObject.GetComponent <Image>().color.g, 0.5f, 1f };


        try
        {
            Debug.Log("checking dress property");
            if (dressProperty != null || dressProperty.imgName != "" || dressProperty.imgName != null)
            {
                dressData.EncodeData(dressProperty, gameController.currentDressColor);
                Debug.Log(string.Format("Dress color is {0} {1} {2} {3}", dressData.pColor[0], dressData.pColor[1], dressData.pColor[2], dressData.pColor[3]));
                dressName = dressProperty.imgName;
            }
            Debug.Log("after if checking dress property");
        }
        catch //(Exception e)
        {
            Debug.Log("error checking dress property");
            Debug.Log(string.Format("Dress recheck Error : "));// {0}",e.Message));
        }


        try
        {
            Debug.Log("checking female wig property");
            if (femaleWigProperty != null || femaleWigProperty.imgName != "" || femaleWigProperty.imgName != null)
            {
                femaleWigData.EncodeData(femaleWigProperty, gameController.currentWigColor);

                wigName = femaleWigProperty.imgName;
            }
        }
        catch                                                // (Exception e)
        {
            Debug.Log(string.Format("Wig rechec Error : ")); // {0}",e.Message));
        }



        try
        {
            Debug.Log("checking ornament property");
            if (ornamentProperty != null || ornamentProperty.imgName != "" || ornamentProperty.imgName != null)
            {
                ornamentData.EncodeData(ornamentProperty);

                ornamentName = ornamentProperty.imgName;
            }
        }
        catch                                                     //(Exception e)
        {
            Debug.Log(string.Format("Ornament rechec Error : ")); // {0}",e.Message));
        }


        try
        {
            Debug.Log("checking shoe property");
            if (shoeProperty != null || shoeProperty.imgName != "" || shoeProperty.imgName != null)
            {
                shoeData.EncodeData(shoeProperty, gameController.currentShoeColor);

                shoeName = shoeProperty.imgName;
            }
        }
        catch //(Exception e)
        {
            Debug.Log("error checking shoe property");
            Debug.Log(string.Format("Shoe recheck Error "));// {0}",e.Message));
        }


        Debug.Log("Encoding male data");
        maleData.EncodeData(gameController);

        Debug.Log("Encoding background property");
        backgroundData.EncodeData(backgroundProperty);
        //Debug.Log(string.Format("Recheck data : background name :{0}  background path {1} ", backgroundData.backGroundName, backgroundData.backGroundPath));
        Debug.Log(string.Format("male data : male showing : {0}  Wearing wig : {1}  wearing tie : {2}", maleData.maleIsShowing, maleData.isWearingWig, maleData.isWearingTie));
    }
Example #3
0
    public void Initialize(int modelindex, float modelrotation, string model, string bodytone, string eye, GameController gameController, DressProperties dressproperty = null, FemaleWigProperties wigproperty = null, OrnamentProperties ornamentproperty = null, ShoeProperties shoeproperty = null)
    {
        Debug.Log("Initializing started");
        dressData              = new DressData();
        femaleWigData          = new FemaleWigData();
        ornamentData           = new OrnamentData();
        shoeData               = new ShoeData();
        backgroundData         = new BackGroundData();
        maleData               = new MaleData();
        modelIndex             = modelindex;
        modelRotation          = modelrotation;
        modelNameame           = model;
        bodytoneName           = bodytone;
        eyeName                = eye;
        this.dressProperty     = dressproperty;
        this.femaleWigProperty = wigproperty;
        this.ornamentProperty  = ornamentproperty;
        this.shoeProperty      = shoeproperty;
        this.bodyToneColor     = new float[] { 0.5f, gameController.femaleModelImageObject.GetComponent <Image>().color.g, 0.5f, 1f };
        gameController.currentBackgroundProperty.CopyTo(ref backgroundProperty);


        //gameController.currentBackgroundProperty.CopyTo(ref backgroundProperty);
        isShowingMale = gameController.isShowingMale;

        if (gameController.isShowingMale)
        {
            maleData.maleIsShowing = true;
            //maleWigProperty.Clone(gameController.currentMaleWigProperty);
            //maleTieProperty.Clone(gameController.currentMaleTieProperty);



            maleData.EncodeData(gameController);
        }
        else
        {
            maleData.maleIsShowing = false;
        }
        if (dressProperty != null)
        {
            Debug.Log("dress property  initialized");
            dressData.EncodeData(dressProperty, gameController.currentDressColor);

            dressName = dressProperty.imgName;
        }
        if (femaleWigProperty != null)
        {
            femaleWigData.EncodeData(femaleWigProperty, gameController.currentWigColor);

            wigName = femaleWigProperty.imgName;
        }
        if (ornamentProperty != null)
        {
            ornamentData.EncodeData(ornamentProperty);

            ornamentName = ornamentProperty.imgName;
        }
        if (shoeProperty != null)
        {
            shoeData.EncodeData(shoeProperty, gameController.currentShoeColor);

            shoeName = shoeProperty.imgName;
        }
        backgroundData.EncodeData(backgroundProperty);
        Debug.Log("Initialize completed");
    }