IEnumerator Animator() { isAnimating = true; if (screenGlow != null) { screenGlow.SetActive(true); } while (isOn) { if (sprites.Count == 0) { if (onSprites.Texture != null) { sprites = SpriteFunctions.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; }
private SpriteData SetUpSheetForClothingData(ClothingData clothingData) { var SpriteInfos = new SpriteData(); SpriteInfos.List = new List <List <List <SpriteHandler.SpriteInfo> > >(); int c = 0; SpriteInfos.List.Add(SpriteFunctions.CompleteSpriteSetup(clothingData.Base.Equipped)); variantStore[ClothingVariantType.Default] = c; c++; if (clothingData.Base_Adjusted.Equipped.Texture != null) { SpriteInfos.List.Add(SpriteFunctions.CompleteSpriteSetup(clothingData.Base_Adjusted.Equipped)); variantStore[ClothingVariantType.Tucked] = c; c++; } if (clothingData.DressVariant.Equipped.Texture != null) { SpriteInfos.List.Add(SpriteFunctions.CompleteSpriteSetup(clothingData.DressVariant.Equipped)); variantStore[ClothingVariantType.Skirt] = c; c++; } if (clothingData.Variants.Count > 0) { foreach (var Variant in clothingData.Variants) { SpriteInfos.List.Add(SpriteFunctions.CompleteSpriteSetup(Variant.Equipped)); variantStore[ClothingVariantType.Skirt] = c; c++; } } return(SpriteInfos); }
public void SetupCustomisations() { if (ThisCharacter.UnderwearName != "None") { clothes["underwear"].spriteHandler.spriteData = new SpriteData(); clothes["underwear"].spriteHandler.spriteData.List.Add(SpriteFunctions.CompleteSpriteSetup( PlayerCustomisationDataSOs.Instance.Get( CustomisationType.Underwear, ThisCharacter.Gender, ThisCharacter.UnderwearName ).Equipped)); clothes["underwear"].spriteHandler.PushTexture(); } if (ThisCharacter.SocksName != "None") { clothes["socks"].spriteHandler.spriteData = new SpriteData(); clothes["socks"].spriteHandler.spriteData.List.Add(SpriteFunctions.CompleteSpriteSetup( PlayerCustomisationDataSOs.Instance.Get( CustomisationType.Socks, ThisCharacter.Gender, ThisCharacter.SocksName ).Equipped)); clothes["socks"].spriteHandler.PushTexture(); } if (ThisCharacter.FacialHairName != "None") { ColorUtility.TryParseHtmlString(ThisCharacter.FacialHairColor, out var newColor); clothes["beard"].spriteHandler.spriteData = new SpriteData(); clothes["beard"].spriteHandler.spriteData.List.Add(SpriteFunctions.CompleteSpriteSetup( PlayerCustomisationDataSOs.Instance.Get( CustomisationType.FacialHair, ThisCharacter.Gender, 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.spriteData = new SpriteData(); clothes["Hair"].spriteHandler.spriteData.List.Add(SpriteFunctions.CompleteSpriteSetup( PlayerCustomisationDataSOs.Instance.Get( CustomisationType.HairStyle, ThisCharacter.Gender, ThisCharacter.HairStyleName ).Equipped)); clothes["Hair"].spriteHandler.SetColor(newColor); clothes["Hair"].spriteHandler.PushTexture(); } }
private void RefreshSocks() { var pcd = PlayerCustomisationDataSOs.Instance.Get( CustomisationType.Socks, currentCharacter.SocksName ); socksSpriteController.sprites = SpriteFunctions.CompleteSpriteSetup(pcd); socksSpriteController.UpdateSprite(); }
private void RefreshUnderwear() { var pcd = PlayerCustomisationDataSOs.Instance.Get( CustomisationType.Underwear, currentCharacter.UnderwearName ); underwearSpriteController.sprites = SpriteFunctions.CompleteSpriteSetup(pcd); underwearSpriteController.UpdateSprite(); }
private void AddSprites() { foreach (var Data in Sprites) { if (spriteData.List == null) { spriteData.List = new List <List <List <SpriteInfo> > >(); } spriteData.List.Add(SpriteFunctions.CompleteSpriteSetup(Data)); } }
private void SetupSprite(SpriteSheetAndData spriteSheetAndData, string clothesDictKey, Color?color = null) { clothes[clothesDictKey].spriteHandler.spriteData = new SpriteData(); clothes[clothesDictKey].spriteHandler.spriteData.List.Add(SpriteFunctions.CompleteSpriteSetup(spriteSheetAndData)); if (color != null) { clothes[clothesDictKey].spriteHandler.SetColor(color.Value); } clothes[clothesDictKey].spriteHandler.PushTexture(); }
private void RefreshUnderwear() { if (playerCustomisationData[PlayerCustomisation.Underwear].ContainsKey(currentCharacter.underwearName)) { underwearSpriteController.sprites = SpriteFunctions.CompleteSpriteSetup(playerCustomisationData[PlayerCustomisation.Underwear][currentCharacter.underwearName].Equipped); } else { underwearSpriteController.sprites = null; } underwearSpriteController.UpdateSprite(); }
/// <summary> /// Used to Set sprite handlers internal buffer to the single Texture specified and set Sprite /// </summary> /// <param name="_SpriteSheetAndData">specified Texture.</param> /// <param name="_variantIndex">Variant index.</param> public void SetSprite(SpriteSheetAndData _SpriteSheetAndData, int _variantIndex = 0) { spriteData.List.Clear(); spriteData.List.Add(SpriteFunctions.CompleteSpriteSetup(_SpriteSheetAndData)); variantIndex = _variantIndex; if (Initialised) { PushTexture(); } else { SetSpriteOnStartUp = true; } }
private void RefreshSocks() { if (playerCustomisationData[PlayerCustomisation.Socks].ContainsKey(currentCharacter.socksName)) { socksSpriteController.sprites = SpriteFunctions.CompleteSpriteSetup(playerCustomisationData[PlayerCustomisation.Socks][currentCharacter.socksName].Equipped); } else { socksSpriteController.sprites = null; } socksSpriteController.UpdateSprite(); }
private void RefreshHair() { var pcd = PlayerCustomisationDataSOs.Instance.Get( CustomisationType.HairStyle, currentCharacter.HairStyleName ); hairSpriteController.sprites = SpriteFunctions.CompleteSpriteSetup(pcd); hairSpriteController.UpdateSprite(); Color setColor = Color.black; ColorUtility.TryParseHtmlString(currentCharacter.HairColor, out setColor); hairSpriteController.image.color = setColor; hairColor.color = setColor; }
private void RefreshGender() { genderText.text = currentCharacter.Gender.ToString(); if (currentCharacter.Gender == Gender.Female) { headSpriteController.sprites = SpriteFunctions.CompleteSpriteSetup(playerTextureData.Female.Head); torsoSpriteController.sprites = SpriteFunctions.CompleteSpriteSetup(playerTextureData.Female.Torso); } else { headSpriteController.sprites = SpriteFunctions.CompleteSpriteSetup(playerTextureData.Male.Head); torsoSpriteController.sprites = SpriteFunctions.CompleteSpriteSetup(playerTextureData.Male.Torso); } headSpriteController.UpdateSprite(); torsoSpriteController.UpdateSprite(); }
/// <summary> /// Set this sprite handler to be capable of displaying the elements defined in _Info and sets it to display as the element in _Info indicated by _spriteIndex and _variantIndex /// </summary> /// <param name="_Info">The list of sprites</param> /// <param name="_spriteIndex">Initial Sprite index.</param> /// <param name="_variantIndex">Initial Variant index.</param> public void SetInfo(List <SpriteSheetAndData> _Info, int _spriteIndex = 0, int _variantIndex = 0) { spriteIndex = _spriteIndex; variantIndex = _variantIndex; spriteData.List = new List <List <List <SpriteInfo> > >(); foreach (var Data in _Info) { spriteData.List.Add(SpriteFunctions.CompleteSpriteSetup(Data)); } if (Initialised) { PushTexture(); } else { SetSpriteOnStartUp = true; } }
private void RefreshFacialHair() { if (playerCustomisationData[PlayerCustomisation.FacialHair].ContainsKey(currentCharacter.facialHairName)) { facialHairSpriteController.sprites = SpriteFunctions.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.spriteData = new SpriteData(); clothes["underwear"].spriteHandler.spriteData.List.Add(SpriteFunctions.CompleteSpriteSetup( Spawn.PlayerCustomisationData[ PlayerCustomisation.Underwear][ThisCharacter.underwearName].Equipped)); clothes["underwear"].spriteHandler.PushTexture(); } if (ThisCharacter.socksName != "None") { clothes["socks"].spriteHandler.spriteData = new SpriteData(); clothes["socks"].spriteHandler.spriteData.List.Add(SpriteFunctions.CompleteSpriteSetup( Spawn.PlayerCustomisationData[ PlayerCustomisation.Socks][ThisCharacter.socksName].Equipped)); clothes["socks"].spriteHandler.PushTexture(); } if (ThisCharacter.facialHairName != "None") { ColorUtility.TryParseHtmlString(ThisCharacter.facialHairColor, out var newColor); clothes["beard"].spriteHandler.spriteData = new SpriteData(); clothes["beard"].spriteHandler.spriteData.List.Add(SpriteFunctions.CompleteSpriteSetup( Spawn.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.spriteData = new SpriteData(); clothes["Hair"].spriteHandler.spriteData.List.Add(SpriteFunctions.CompleteSpriteSetup( Spawn.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 = SpriteFunctions.CompleteSpriteSetup(playerTextureData.Base.Torso); headSpriteController.sprites = SpriteFunctions.CompleteSpriteSetup(playerTextureData.Base.Head); RarmSpriteController.sprites = SpriteFunctions.CompleteSpriteSetup(playerTextureData.Base.ArmRight); LarmSpriteController.sprites = SpriteFunctions.CompleteSpriteSetup(playerTextureData.Base.ArmLeft); RlegSpriteController.sprites = SpriteFunctions.CompleteSpriteSetup(playerTextureData.Base.LegRight); LlegSpriteController.sprites = SpriteFunctions.CompleteSpriteSetup(playerTextureData.Base.LegLeft); RHandSpriteController.sprites = SpriteFunctions.CompleteSpriteSetup(playerTextureData.Base.HandRight); LHandSpriteController.sprites = SpriteFunctions.CompleteSpriteSetup(playerTextureData.Base.HandLeft); eyesSpriteController.sprites = SpriteFunctions.CompleteSpriteSetup(playerTextureData.Base.Eyes); }
public void SexSetupBodySprites(RaceVariantTextureData Variant) { ColorUtility.TryParseHtmlString(ThisCharacter.SkinTone, out var newColor); if (Variant.Torso.Texture != null) { clothes["body_torso"].spriteHandler.spriteData = new SpriteData(); clothes["body_torso"].spriteHandler.spriteData.List.Add(SpriteFunctions.CompleteSpriteSetup(Variant.Torso)); clothes["body_torso"].spriteHandler.SetColor(newColor); clothes["body_torso"].spriteHandler.PushTexture(); } if (Variant.LegRight.Texture != null) { clothes["body_rightleg"].spriteHandler.spriteData = new SpriteData(); clothes["body_rightleg"].spriteHandler.spriteData.List .Add(SpriteFunctions.CompleteSpriteSetup(Variant.LegRight)); clothes["body_rightleg"].spriteHandler.SetColor(newColor); clothes["body_rightleg"].spriteHandler.PushTexture(); } if (Variant.LegLeft.Texture != null) { clothes["body_leftleg"].spriteHandler.spriteData = new SpriteData(); clothes["body_leftleg"].spriteHandler.spriteData.List .Add(SpriteFunctions.CompleteSpriteSetup(Variant.LegLeft)); clothes["body_leftleg"].spriteHandler.SetColor(newColor); clothes["body_leftleg"].spriteHandler.PushTexture(); } if (Variant.ArmRight.Texture != null) { clothes["body_rightarm"].spriteHandler.spriteData = new SpriteData(); clothes["body_rightarm"].spriteHandler.spriteData.List .Add(SpriteFunctions.CompleteSpriteSetup(Variant.ArmRight)); clothes["body_rightarm"].spriteHandler.SetColor(newColor); clothes["body_rightarm"].spriteHandler.PushTexture(); } if (Variant.ArmLeft.Texture != null) { clothes["body_leftarm"].spriteHandler.spriteData = new SpriteData(); clothes["body_leftarm"].spriteHandler.spriteData.List .Add(SpriteFunctions.CompleteSpriteSetup(Variant.ArmLeft)); clothes["body_leftarm"].spriteHandler.SetColor(newColor); clothes["body_leftarm"].spriteHandler.PushTexture(); } if (Variant.Head.Texture != null) { clothes["body_head"].spriteHandler.spriteData = new SpriteData(); clothes["body_head"].spriteHandler.spriteData.List.Add(SpriteFunctions.CompleteSpriteSetup(Variant.Head)); clothes["body_head"].spriteHandler.SetColor(newColor); clothes["body_head"].spriteHandler.PushTexture(); } if (Variant.HandRight.Texture != null) { clothes["body_right_hand"].spriteHandler.spriteData = new SpriteData(); clothes["body_right_hand"].spriteHandler.spriteData.List .Add(SpriteFunctions.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.spriteData = new SpriteData(); clothes["body_left_hand"].spriteHandler.spriteData.List .Add(SpriteFunctions.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.spriteData = new SpriteData(); clothes["eyes"].spriteHandler.spriteData.List.Add(SpriteFunctions.CompleteSpriteSetup(Variant.Eyes)); clothes["eyes"].spriteHandler.SetColor(newColor); clothes["eyes"].spriteHandler.PushTexture(); } }