示例#1
0
    private void SetSprites()
    {
        SpriteManagement   spriteManagement   = new SpriteManagement();
        GeneCodeManagement geneCodeManagement = new GeneCodeManagement();
        SpriteSelector     selector;
        bool  isMale;
        Chibi chibi;

        // Child
        selector = child.GetComponent <SpriteSelector>();
        isMale   = geneCodeManagement.IsMale(childGenes.Gender);
        chibi    = geneCodeManagement.GetChibiFromChild(childGenes, isMale);

        spriteManagement.SetSpriteFromChibiObject(selector, isMale, chibi);

        //Father
        selector = father.GetComponent <SpriteSelector>();
        isMale   = geneCodeManagement.IsMale(fatherGenes.Gender);
        chibi    = geneCodeManagement.GetChibiFromChibiGenes(fatherGenes, isMale);

        spriteManagement.SetSpriteFromChibiObject(selector, isMale, chibi);

        //Mother
        selector = mother.GetComponent <SpriteSelector>();
        isMale   = geneCodeManagement.IsMale(motherGenes.Gender);
        chibi    = geneCodeManagement.GetChibiFromChibiGenes(motherGenes, isMale);

        spriteManagement.SetSpriteFromChibiObject(selector, isMale, chibi);
    }
    private void DisplayChild(Child child, GameObject childObject)
    {
        SpriteManagement   spriteManagement   = new SpriteManagement();
        GeneCodeManagement geneCodeManagement = new GeneCodeManagement();
        SpriteSelector     childSelector      = childObject.GetComponent <SpriteSelector>();
        bool  isMale = geneCodeManagement.IsMale(child.Gender);
        Chibi chibi  = geneCodeManagement.GetChibiFromChild(child, isMale);

        spriteManagement.SetSpriteFromChibiObject(childSelector, isMale, chibi);
    }
示例#3
0
 private void GetSpriteNames(List <GenePair> genePairList)
 {
     genderCode       = genePairList[4].ConcatenateGenePairs();
     isMale           = manageCode.IsMale(genderCode);
     genderSpritename = manageCode.GetSpritenameFromGeneCode("gender", genderCode, isMale);
     skinCode         = genePairList[0].ConcatenateGenePairs();
     skinIndex        = manageCode.GetIndexFromGeneCode("skin", skinCode, isMale);
     eyesCode         = genePairList[1].ConcatenateGenePairs();
     eyesIndex        = manageCode.GetIndexFromGeneCode("eyes", eyesCode, isMale);
     hairCode         = genePairList[2].ConcatenateGenePairs();
     hairColor        = manageCode.GetColorFromGeneCode(hairCode);
     mouthCode        = genePairList[3].ConcatenateGenePairs();
     mouthIndex       = manageCode.GetIndexFromGeneCode("mouth", mouthCode, isMale);
 }