Пример #1
0
    public static GameObject CreateBackpackCloth(ContainerData ContainerData, Vector3 worldPos, Transform parent = null,
                                                 ClothingVariantType CVT = ClothingVariantType.Default, int variant = -1, GameObject PrefabOverride = null)
    {
        if (Instance.uniBackpack == null)
        {
            Logger.LogError("UniBackPack Prefab not found", Category.SpriteHandler);
            return(null);
        }

        GameObject clothObj;

        if (PrefabOverride != null)
        {
            clothObj = PoolManager.PoolNetworkInstantiate(PrefabOverride, worldPos, parent);
        }
        else
        {
            clothObj = PoolManager.PoolNetworkInstantiate(Instance.uniBackpack, worldPos, parent);
        }

        var _Clothing = clothObj.GetComponent <Clothing>();
        var Item      = clothObj.GetComponent <ItemAttributes>();
        var Storage   = clothObj.GetComponent <StorageObject>();

        _Clothing.SpriteInfo = StaticSpriteHandler.SetupSingleSprite(ContainerData.Sprites.Equipped);
        Item.SetUpFromClothingData(ContainerData.Sprites, ContainerData.ItemAttributes);
        _Clothing.SetSynchronise(ConD: ContainerData);
        Storage.SetUpFromStorageObjectData(ContainerData.StorageData);
        return(clothObj);
    }
Пример #2
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);
    }
Пример #3
0
    private static GameObject CreateBackpackCloth(ContainerData ContainerData, Vector3?worldPos = null, Transform parent = null,
                                                  ClothingVariantType CVT = ClothingVariantType.Default, int variant     = -1, GameObject PrefabOverride = null)
    {
        if (uniBackpack == null)
        {
            uniBackpack = GetPrefabByName("UniBackPack");
        }
        if (uniBackpack == null)
        {
            Logger.LogError("UniBackPack Prefab not found", Category.SpriteHandler);
            return(null);
        }

        GameObject clothObj;

        if (PrefabOverride != null && PrefabOverride != uniBackpack)
        {
            clothObj = Spawn.ServerPrefab(PrefabOverride, worldPos, parent).GameObject;
        }
        else
        {
            clothObj = Spawn.ServerPrefab(uniBackpack, worldPos, parent).GameObject;
        }

        var _Clothing = clothObj.GetComponent <Clothing>();
        var Item      = clothObj.GetComponent <ItemAttributes>();

        _Clothing.SpriteInfo = StaticSpriteHandler.SetupSingleSprite(ContainerData.Sprites.Equipped);
        Item.SetUpFromClothingData(ContainerData.Sprites, ContainerData.ItemAttributes);
        _Clothing.SetSynchronise(ConD: ContainerData);
        return(clothObj);
    }
Пример #4
0
    public static GameObject CreateHeadsetCloth(HeadsetData headsetData, Vector3 worldPos, Transform parent = null,
                                                ClothingVariantType CVT = ClothingVariantType.Default, int variant = -1, GameObject PrefabOverride = null)
    {
        if (Instance.uniHeadSet == null)
        {
            Logger.LogError("UniHeadSet Prefab not found", Category.SpriteHandler);
            return(null);
        }

        GameObject clothObj;

        if (PrefabOverride != null)
        {
            clothObj = PoolManager.PoolNetworkInstantiate(PrefabOverride, worldPos, parent);
        }
        else
        {
            clothObj = PoolManager.PoolNetworkInstantiate(Instance.uniHeadSet, worldPos, parent);
        }

        var _Clothing = clothObj.GetComponent <Clothing>();
        var Item      = clothObj.GetComponent <ItemAttributes>();
        var Headset   = clothObj.GetComponent <Headset>();

        _Clothing.SpriteInfo = StaticSpriteHandler.SetupSingleSprite(headsetData.Sprites.Equipped);
        _Clothing.SetSynchronise(HD: headsetData);
        Item.SetUpFromClothingData(headsetData.Sprites, headsetData.ItemAttributes);
        Headset.EncryptionKey = headsetData.Key.EncryptionKey;
        return(clothObj);
    }
Пример #5
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;
    }
Пример #6
0
    private void SyncStage(PlantSpriteStage newStage)
    {
        if (newStage == plantSyncStage)
        {
            return;
        }

        plantSyncStage = newStage;
        switch (plantSyncStage)
        {
        case PlantSpriteStage.None:
            plantSprite.PushClear();
            break;

        case PlantSpriteStage.FullyGrown:
            plantSprite.Infos = StaticSpriteHandler.SetupSingleSprite(plantData.FullyGrownSprite);
            plantSprite.PushTexture();
            break;

        case PlantSpriteStage.Dead:
            plantSprite.Infos = StaticSpriteHandler.SetupSingleSprite(plantData.DeadSprite);
            plantSprite.PushTexture();
            break;

        case PlantSpriteStage.Growing:
            plantSprite.Infos = StaticSpriteHandler.SetupSingleSprite(plantData.GrowthSprites[growingPlantStage]);
            plantSprite.PushTexture();
            break;
        }
    }
Пример #7
0
 public void SetUpFood()
 {
     SyncPlant(plantData.Name);
     SpriteHandler.Infos = StaticSpriteHandler.SetupSingleSprite(plantData.ProduceSprite);
     SpriteHandler.PushTexture();
     SetupChemicalContents();
     SyncSize(0.5f + (plantData.Potency / 100f));
 }
Пример #8
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();
 }
Пример #9
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());
        }
    }
Пример #10
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);
 }
Пример #11
0
    private static GameObject CreateCloth(ClothingData ClothingData, Vector3?worldPos = null, Transform parent = null,
                                          ClothingVariantType CVT = ClothingVariantType.Default, int variant   = -1, GameObject PrefabOverride = null)
    {
        if (uniCloth == null)
        {
            uniCloth = GetPrefabByName("UniCloth");
        }
        if (uniCloth == null)
        {
            Logger.LogError("UniCloth Prefab not found", Category.SpriteHandler);
            return(null);
        }

        GameObject clothObj;

        if (PrefabOverride != null && PrefabOverride != uniCloth)
        {
            clothObj = Spawn.ServerPrefab(PrefabOverride, worldPos, parent).GameObject;
        }
        else
        {
            clothObj = Spawn.ServerPrefab(uniCloth, worldPos, parent).GameObject;
        }

        var _Clothing = clothObj.GetComponent <Clothing>();
        var Item      = clothObj.GetComponent <ItemAttributes>();

        _Clothing.SpriteInfo = StaticSpriteHandler.SetUpSheetForClothingData(ClothingData, _Clothing);
        _Clothing.SetSynchronise(CD: ClothingData);
        Item.SetUpFromClothingData(ClothingData.Base, ClothingData.ItemAttributes);
        switch (CVT)
        {
        case ClothingVariantType.Default:
            if (variant > -1)
            {
                if (!(ClothingData.Variants.Count >= variant))
                {
                    Item.SetUpFromClothingData(ClothingData.Variants[variant], ClothingData.ItemAttributes);
                }
            }

            break;

        case ClothingVariantType.Skirt:
            Item.SetUpFromClothingData(ClothingData.DressVariant, ClothingData.ItemAttributes);
            break;

        case ClothingVariantType.Tucked:
            Item.SetUpFromClothingData(ClothingData.Base_Adjusted, ClothingData.ItemAttributes);
            break;
        }

        clothObj.name = ClothingData.name;
        return(clothObj);
    }
Пример #12
0
 public void SyncPlant(string _PlantSyncString)
 {
     PlantSyncString = _PlantSyncString;
     if (!isServer)
     {
         if (DefaultPlantData.PlantDictionary.ContainsKey(PlantSyncString))
         {
             plantData = DefaultPlantData.PlantDictionary[PlantSyncString].plantData;
         }
     }
     Sprite.Infos = StaticSpriteHandler.SetupSingleSprite(plantData.PacketsSprite);
     Sprite.PushTexture();
 }
Пример #13
0
    //set up the sprites / config of this instance using the cloth data
    private void TryInit()
    {
        if (clothData is ClothingData clothingData)
        {
            var item = GetComponent <ItemAttributesV2>();
            spriteInfo = SetUpSheetForClothingData(clothingData);
            SetUpFromClothingData(clothingData.Base);

            switch (variantType)
            {
            case ClothingVariantType.Default:
                if (variantIndex > -1)
                {
                    if (!(clothingData.Variants.Count >= variantIndex))
                    {
                        SetUpFromClothingData(clothingData.Variants[variantIndex]);
                    }
                }

                break;

            case ClothingVariantType.Skirt:
                SetUpFromClothingData(clothingData.DressVariant);
                break;

            case ClothingVariantType.Tucked:
                SetUpFromClothingData(clothingData.Base_Adjusted);
                break;
            }
        }
        else if (clothData is ContainerData containerData)
        {
            var Item = GetComponent <ItemAttributesV2>();
            this.spriteInfo = StaticSpriteHandler.SetupSingleSprite(containerData.Sprites.Equipped);
            SetUpFromClothingData(containerData.Sprites);
        }
        else if (clothData is BeltData beltData)
        {
            var Item = GetComponent <ItemAttributesV2>();
            this.spriteInfo = StaticSpriteHandler.SetupSingleSprite(beltData.sprites.Equipped);
            SetUpFromClothingData(beltData.sprites);
        }
        else if (clothData is HeadsetData headsetData)
        {
            var Item    = GetComponent <ItemAttributesV2>();
            var Headset = GetComponent <Headset>();
            this.spriteInfo = StaticSpriteHandler.SetupSingleSprite(headsetData.Sprites.Equipped);
            SetUpFromClothingData(headsetData.Sprites);
            Headset.EncryptionKey = headsetData.Key.EncryptionKey;
        }
    }
        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;
        }
Пример #17
0
    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();
        }
Пример #20
0
    public void ReceiveMessage(string plantString, int growingStage, PlantSpriteStage spriteStage,
                               bool harvestSync, bool weedSync, bool waterSync, bool nutrimentSync)
    {
        plantSyncString = plantString;

        SyncHarvest(harvestSync);
        SyncWeed(weedSync);
        SyncWater(waterSync);
        SyncNutriment(nutrimentSync);

        if (DefaultPlantData.PlantDictionary.ContainsKey(plantSyncString))
        {
            plantData = DefaultPlantData.PlantDictionary[plantSyncString].plantData;
        }

        growingPlantStage = growingStage;

        plantSyncStage = spriteStage;
        switch (plantSyncStage)
        {
        case PlantSpriteStage.None:
            plantSprite.PushClear();
            break;

        case PlantSpriteStage.FullyGrown:
            plantSprite.Infos = StaticSpriteHandler.SetupSingleSprite(plantData.FullyGrownSprite);
            plantSprite.PushTexture();
            break;

        case PlantSpriteStage.Dead:
            plantSprite.Infos = StaticSpriteHandler.SetupSingleSprite(plantData.DeadSprite);
            plantSprite.PushTexture();
            break;

        case PlantSpriteStage.Growing:
            plantSprite.Infos =
                StaticSpriteHandler.SetupSingleSprite(plantData.GrowthSprites[growingPlantStage]);
            plantSprite.PushTexture();
            break;
        }
    }
Пример #21
0
 public void SyncPlant(string _PlantSyncString)
 {
     PlantSyncString = _PlantSyncString;
     if (!isServer)
     {
         if (DefaultPlantData.PlantDictionary.ContainsKey(PlantSyncString))
         {
             plantData = DefaultPlantData.PlantDictionary[PlantSyncString].plantData;
         }
     }
     SpriteHandler.Infos = StaticSpriteHandler.SetupSingleSprite(plantData.ProduceSprite);
     SpriteHandler.PushTexture();
     if (ItemAttributesV2 == null)
     {
         ItemAttributesV2 = this.GetComponent <ItemAttributesV2>();
     }
     if (isServer && ItemAttributesV2 != null)
     {
         ItemAttributesV2.ServerSetArticleDescription(plantData.Description);
         ItemAttributesV2.ServerSetArticleName(plantData.Plantname);
     }
     this.name = plantData.Plantname;
 }
Пример #22
0
    //Attempt to apply the data to the Clothing Item
    private void TryInit()
    {
        if (Initialised != true)
        {
            if (clothingData != null)
            {
                if (clothingData.ItemAttributes.itemName != "")
                {
                    this.name = clothingData.ItemAttributes.itemName;
                }
                else
                {
                    this.name = clothingData.name;
                }

                var _Clothing = GetComponent <Clothing>();
                var Item      = GetComponent <ItemAttributes>();
                _Clothing.SpriteInfo = StaticSpriteHandler.SetUpSheetForClothingData(clothingData, this);
                Item.SetUpFromClothingData(clothingData.Base, clothingData.ItemAttributes);

                switch (Type)
                {
                case ClothingVariantType.Default:
                    if (Variant > -1)
                    {
                        if (!(clothingData.Variants.Count >= Variant))
                        {
                            Item.SetUpFromClothingData(clothingData.Variants[Variant], clothingData.ItemAttributes);
                        }
                    }

                    break;

                case ClothingVariantType.Skirt:
                    Item.SetUpFromClothingData(clothingData.DressVariant, clothingData.ItemAttributes);
                    break;

                case ClothingVariantType.Tucked:
                    Item.SetUpFromClothingData(clothingData.Base_Adjusted, clothingData.ItemAttributes);
                    break;
                }

                Initialised = true;
            }
            else if (containerData != null)
            {
                if (containerData.ItemAttributes.itemName != "")
                {
                    this.name = containerData.ItemAttributes.itemName;
                }
                else
                {
                    this.name = containerData.name;
                }

                var Item    = GetComponent <ItemAttributes>();
                var Storage = GetComponent <StorageObject>();
                this.SpriteInfo = StaticSpriteHandler.SetupSingleSprite(containerData.Sprites.Equipped);
                Item.SetUpFromClothingData(containerData.Sprites, containerData.ItemAttributes);
                Storage.SetUpFromStorageObjectData(containerData.StorageData);
                Initialised = true;
            }
            else if (headsetData != null)
            {
                if (headsetData.ItemAttributes.itemName != "")
                {
                    this.name = headsetData.ItemAttributes.itemName;
                }
                else
                {
                    this.name = headsetData.name;
                }

                var Item    = GetComponent <ItemAttributes>();
                var Headset = GetComponent <Headset>();
                this.SpriteInfo = StaticSpriteHandler.SetupSingleSprite(headsetData.Sprites.Equipped);
                Item.SetUpFromClothingData(headsetData.Sprites, headsetData.ItemAttributes);
                Headset.EncryptionKey = headsetData.Key.EncryptionKey;
                Initialised           = true;
            }
        }
    }
Пример #23
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();
        }
    }