Beispiel #1
0
    private SpriteData SetUpSheetForClothingData(ClothingData clothingData)
    {
        var SpriteInfos = new SpriteData();

        SpriteInfos.List = new List <List <List <SpriteDataHandler.SpriteInfo> > >();
        int c = 0;

        SpriteInfos.List.Add(StaticSpriteHandler.CompleteSpriteSetup(clothingData.Base.Equipped));
        variantStore[ClothingVariantType.Default] = c;
        c++;

        if (clothingData.Base_Adjusted.Equipped.Texture != null)
        {
            SpriteInfos.List.Add(StaticSpriteHandler.CompleteSpriteSetup(clothingData.Base_Adjusted.Equipped));
            variantStore[ClothingVariantType.Tucked] = c;
            c++;
        }

        if (clothingData.DressVariant.Equipped.Texture != null)
        {
            SpriteInfos.List.Add(StaticSpriteHandler.CompleteSpriteSetup(clothingData.DressVariant.Equipped));
            variantStore[ClothingVariantType.Skirt] = c;
            c++;
        }
        if (clothingData.Variants.Count > 0)
        {
            foreach (var Variant in clothingData.Variants)
            {
                SpriteInfos.List.Add(StaticSpriteHandler.CompleteSpriteSetup(Variant.Equipped));
                variantStore[ClothingVariantType.Skirt] = c;
                c++;
            }
        }
        return(SpriteInfos);
    }
Beispiel #2
0
    IEnumerator Animator()
    {
        isAnimating = true;
        if (screenGlow != null)
        {
            screenGlow.SetActive(true);
        }

        while (isOn)
        {
            if (sprites.Count == 0)
            {
                if (onSprites.Texture != null)
                {
                    sprites = StaticSpriteHandler.CompleteSpriteSetup(onSprites);
                }
            }

            spriteRenderer.sprite = sprites[0][sIndex].sprite;
            Delay = sprites[0][sIndex].waitTime;
            sIndex++;
            if (sIndex == sprites[0].Count)
            {
                sIndex = 0;
            }

            yield return(WaitFor.Seconds(Delay));
        }

        isAnimating = false;
    }
Beispiel #3
0
    //deSerialise is the sprite data so It is in an Usable format
    public void DeSerializeT()
    {
        //List.Clear();
        //Used to initialise the dictionaries With the appropriate data from each layer
        List <SpriteHListPoint> TopParentList = new List <SpriteHListPoint>();
        List <SpriteHListPoint> MidParentList = new List <SpriteHListPoint>();
        List <SpriteHListPoint> BotListPoint  = new List <SpriteHListPoint>();

        foreach (var ListPoint in Serialized)
        {
            if (ListPoint.inlistID == 0)
            {
                TopParentList.Add(ListPoint);
            }
            else if (ListPoint.sprite != null)
            {
                BotListPoint.Add(ListPoint);
            }
            else
            {
                MidParentList.Add(ListPoint);
            }
        }

        int i = 0;

        //Using this information using the ID to assess which layer and therefore which list it would be in
        foreach (var Top in TopParentList)
        {
            int c = 0;
            List.Add(new List <List <SpriteHandler.SpriteInfo> >());
            foreach (var Mid in MidParentList.Where(m => m.inlistID == Top.listID))
            {
                List[i].Add(new List <SpriteHandler.SpriteInfo>());
                foreach (var Bot in BotListPoint.Where(m => m.inlistID == Mid.listID))
                {
                    List[i][c].Add(new SpriteHandler.SpriteInfo()
                    {
                        sprite   = Bot.sprite,
                        waitTime = Bot.waitTime
                    });
                }
                c++;
            }
            i++;
        }
        if (SpriteAndData?.Texture != null)
        {
            List.Add(StaticSpriteHandler.CompleteSpriteSetup(SpriteAndData));
        }
        else if (List.Count == 0)
        {
            List.Add(new List <List <SpriteHandler.SpriteInfo> >());
            List[0].Add(new List <SpriteHandler.SpriteInfo>());
            List[0][0].Add(new SpriteHandler.SpriteInfo());
        }
    }
Beispiel #4
0
 private void SetUpFromClothingData(EquippedData equippedData)
 {
     spriteDataHandler.Infos = new SpriteData();
     spriteDataHandler.Infos.List.Add(StaticSpriteHandler.CompleteSpriteSetup(equippedData.InHandsLeft));
     spriteDataHandler.Infos.List.Add(StaticSpriteHandler.CompleteSpriteSetup(equippedData.InHandsRight));
     inventoryIcon.Infos = new SpriteData();
     inventoryIcon.Infos.List.Add(StaticSpriteHandler.CompleteSpriteSetup(equippedData.ItemIcon));
     inventoryIcon.PushTexture();
 }
Beispiel #5
0
 public void SetUpFromClothingData(EquippedData equippedData, ItemAttributesData itemAttributes)
 {
     spriteDataHandler.Infos = new SpriteData();
     spriteDataHandler.Infos.List.Add(StaticSpriteHandler.CompleteSpriteSetup(equippedData.InHandsLeft));
     spriteDataHandler.Infos.List.Add(StaticSpriteHandler.CompleteSpriteSetup(equippedData.InHandsRight));
     InventoryIcon.Infos = new SpriteData();
     InventoryIcon.Infos.List.Add(StaticSpriteHandler.CompleteSpriteSetup(equippedData.ItemIcon));
     InventoryIcon.PushTexture();
     AttributesFromCD(itemAttributes);
 }
        private void RefreshSocks()
        {
            if (playerCustomisationData[PlayerCustomisation.Socks].ContainsKey(currentCharacter.socksName))
            {
                socksSpriteController.sprites =
                    StaticSpriteHandler.CompleteSpriteSetup(playerCustomisationData[PlayerCustomisation.Socks][currentCharacter.socksName].Equipped);
            }

            else
            {
                socksSpriteController.sprites = null;
            }
            socksSpriteController.UpdateSprite();
        }
        private void RefreshUnderwear()
        {
            if (playerCustomisationData[PlayerCustomisation.Underwear].ContainsKey(currentCharacter.underwearName))
            {
                underwearSpriteController.sprites =
                    StaticSpriteHandler.CompleteSpriteSetup(playerCustomisationData[PlayerCustomisation.Underwear][currentCharacter.underwearName].Equipped);
            }
            else
            {
                underwearSpriteController.sprites = null;
            }

            underwearSpriteController.UpdateSprite();
        }
        private void RefreshFacialHair()
        {
            if (playerCustomisationData[PlayerCustomisation.FacialHair].ContainsKey(currentCharacter.facialHairName))
            {
                facialHairSpriteController.sprites =
                    StaticSpriteHandler.CompleteSpriteSetup(playerCustomisationData[PlayerCustomisation.FacialHair][currentCharacter.facialHairName].Equipped);
            }
            else
            {
                facialHairSpriteController.sprites = null;
            }
            facialHairSpriteController.UpdateSprite();
            Color setColor = Color.black;

            ColorUtility.TryParseHtmlString(currentCharacter.facialHairColor, out setColor);
            facialHairSpriteController.image.color = setColor;
            facialColor.color = setColor;
        }
    public void SetupCustomisations()
    {
        if (ThisCharacter.underwearName != "None")
        {
            clothes["underwear"].spriteHandler.Infos = new SpriteData();
            clothes["underwear"].spriteHandler.Infos.List.Add(StaticSpriteHandler.CompleteSpriteSetup(
                                                                  ClothFactory.Instance.playerCustomisationData[
                                                                      PlayerCustomisation.Underwear][ThisCharacter.underwearName].Equipped));
            clothes["underwear"].spriteHandler.PushTexture();
        }

        if (ThisCharacter.socksName != "None")
        {
            clothes["socks"].spriteHandler.Infos = new SpriteData();
            clothes["socks"].spriteHandler.Infos.List.Add(StaticSpriteHandler.CompleteSpriteSetup(
                                                              ClothFactory.Instance.playerCustomisationData[
                                                                  PlayerCustomisation.Socks][ThisCharacter.socksName].Equipped));
            clothes["socks"].spriteHandler.PushTexture();
        }


        if (ThisCharacter.facialHairName != "None")
        {
            ColorUtility.TryParseHtmlString(ThisCharacter.facialHairColor, out var newColor);
            clothes["beard"].spriteHandler.Infos = new SpriteData();
            clothes["beard"].spriteHandler.Infos.List.Add(StaticSpriteHandler.CompleteSpriteSetup(
                                                              ClothFactory.Instance.playerCustomisationData[
                                                                  PlayerCustomisation.FacialHair][ThisCharacter.facialHairName].Equipped));
            clothes["beard"].spriteHandler.SetColor(newColor);
            clothes["beard"].spriteHandler.PushTexture();
        }

        if (ThisCharacter.hairStyleName != "None")
        {
            ColorUtility.TryParseHtmlString(ThisCharacter.hairColor, out var newColor);
            clothes["Hair"].spriteHandler.Infos = new SpriteData();
            clothes["Hair"].spriteHandler.Infos.List.Add(StaticSpriteHandler.CompleteSpriteSetup(
                                                             ClothFactory.Instance.playerCustomisationData[
                                                                 PlayerCustomisation.HairStyle][ThisCharacter.hairStyleName].Equipped));
            clothes["Hair"].spriteHandler.SetColor(newColor);
            clothes["Hair"].spriteHandler.PushTexture();
        }
    }
        void OnEnable()
        {
            LoadSettings();
            colorPicker.gameObject.SetActive(false);
            colorPicker.onValueChanged.AddListener(OnColorChange);
            var copyStr = JsonUtility.ToJson(currentCharacter);

            lastSettings = JsonUtility.FromJson <CharacterSettings>(copyStr);
            DisplayErrorText("");

            torsoSpriteController.sprites = StaticSpriteHandler.CompleteSpriteSetup(playerTextureData.Base.Torso);
            headSpriteController.sprites  = StaticSpriteHandler.CompleteSpriteSetup(playerTextureData.Base.Head);
            RarmSpriteController.sprites  = StaticSpriteHandler.CompleteSpriteSetup(playerTextureData.Base.ArmRight);
            LarmSpriteController.sprites  = StaticSpriteHandler.CompleteSpriteSetup(playerTextureData.Base.ArmLeft);
            RlegSpriteController.sprites  = StaticSpriteHandler.CompleteSpriteSetup(playerTextureData.Base.LegRight);
            LlegSpriteController.sprites  = StaticSpriteHandler.CompleteSpriteSetup(playerTextureData.Base.LegLeft);
            RHandSpriteController.sprites = StaticSpriteHandler.CompleteSpriteSetup(playerTextureData.Base.HandRight);
            LHandSpriteController.sprites = StaticSpriteHandler.CompleteSpriteSetup(playerTextureData.Base.HandLeft);
            eyesSpriteController.sprites  = StaticSpriteHandler.CompleteSpriteSetup(playerTextureData.Base.Eyes);
        }
        private void RefreshGender()
        {
            genderText.text = currentCharacter.Gender.ToString();
            currentCharacter.RefreshGenderBodyParts();


            if (currentCharacter.Gender == Gender.Female)
            {
                headSpriteController.sprites  = StaticSpriteHandler.CompleteSpriteSetup(playerTextureData.Female.Head);
                torsoSpriteController.sprites = StaticSpriteHandler.CompleteSpriteSetup(playerTextureData.Female.Torso);
            }
            else
            {
                headSpriteController.sprites  = StaticSpriteHandler.CompleteSpriteSetup(playerTextureData.Male.Head);
                torsoSpriteController.sprites = StaticSpriteHandler.CompleteSpriteSetup(playerTextureData.Male.Torso);
            }

            headSpriteController.UpdateSprite();
            torsoSpriteController.UpdateSprite();
        }
Beispiel #12
0
    public void SexSetupBodySprites(RaceVariantTextureData Variant)
    {
        ColorUtility.TryParseHtmlString(ThisCharacter.skinTone, out var newColor);

        if (Variant.Torso.Texture != null)
        {
            clothes["body_torso"].spriteHandler.Infos = new SpriteData();
            clothes["body_torso"].spriteHandler.Infos.List.Add(StaticSpriteHandler.CompleteSpriteSetup(Variant.Torso));
            clothes["body_torso"].spriteHandler.SetColor(newColor);
            clothes["body_torso"].spriteHandler.PushTexture();
        }


        if (Variant.LegRight.Texture != null)
        {
            clothes["body_rightleg"].spriteHandler.Infos = new SpriteData();
            clothes["body_rightleg"].spriteHandler.Infos.List
            .Add(StaticSpriteHandler.CompleteSpriteSetup(Variant.LegRight));
            clothes["body_rightleg"].spriteHandler.SetColor(newColor);
            clothes["body_rightleg"].spriteHandler.PushTexture();
        }


        if (Variant.LegLeft.Texture != null)
        {
            clothes["body_leftleg"].spriteHandler.Infos = new SpriteData();
            clothes["body_leftleg"].spriteHandler.Infos.List
            .Add(StaticSpriteHandler.CompleteSpriteSetup(Variant.LegLeft));
            clothes["body_leftleg"].spriteHandler.SetColor(newColor);
            clothes["body_leftleg"].spriteHandler.PushTexture();
        }

        if (Variant.ArmRight.Texture != null)
        {
            clothes["body_rightarm"].spriteHandler.Infos = new SpriteData();
            clothes["body_rightarm"].spriteHandler.Infos.List
            .Add(StaticSpriteHandler.CompleteSpriteSetup(Variant.ArmRight));
            clothes["body_rightarm"].spriteHandler.SetColor(newColor);
            clothes["body_rightarm"].spriteHandler.PushTexture();
        }


        if (Variant.ArmLeft.Texture != null)
        {
            clothes["body_leftarm"].spriteHandler.Infos = new SpriteData();
            clothes["body_leftarm"].spriteHandler.Infos.List
            .Add(StaticSpriteHandler.CompleteSpriteSetup(Variant.ArmLeft));
            clothes["body_leftarm"].spriteHandler.SetColor(newColor);
            clothes["body_leftarm"].spriteHandler.PushTexture();
        }


        if (Variant.Head.Texture != null)
        {
            clothes["body_head"].spriteHandler.Infos = new SpriteData();
            clothes["body_head"].spriteHandler.Infos.List.Add(StaticSpriteHandler.CompleteSpriteSetup(Variant.Head));
            clothes["body_head"].spriteHandler.SetColor(newColor);
            clothes["body_head"].spriteHandler.PushTexture();
        }


        if (Variant.HandRight.Texture != null)
        {
            clothes["body_right_hand"].spriteHandler.Infos = new SpriteData();
            clothes["body_right_hand"].spriteHandler.Infos.List
            .Add(StaticSpriteHandler.CompleteSpriteSetup(Variant.HandRight));
            clothes["body_right_hand"].spriteHandler.SetColor(newColor);
            clothes["body_right_hand"].spriteHandler.PushTexture();
        }


        if (Variant.HandLeft.Texture != null)
        {
            clothes["body_left_hand"].spriteHandler.Infos = new SpriteData();
            clothes["body_left_hand"].spriteHandler.Infos.List
            .Add(StaticSpriteHandler.CompleteSpriteSetup(Variant.HandLeft));
            clothes["body_left_hand"].spriteHandler.SetColor(newColor);
            clothes["body_left_hand"].spriteHandler.PushTexture();
        }

        ColorUtility.TryParseHtmlString(ThisCharacter.eyeColor, out newColor);
        if (Variant.Eyes.Texture != null)
        {
            clothes["eyes"].spriteHandler.Infos = new SpriteData();
            clothes["eyes"].spriteHandler.Infos.List.Add(StaticSpriteHandler.CompleteSpriteSetup(Variant.Eyes));
            clothes["eyes"].spriteHandler.SetColor(newColor);
            clothes["eyes"].spriteHandler.PushTexture();
        }
    }