public void ChangeGender() { playerMare = !playerMare; if (playerMare) { genderText.text = "Женский"; } else { genderText.text = "Мужской"; } ExamplePony.playerMare = playerMare; ExamplePony.SetNewValues(); }
private void Start() { _audi = GetComponent <AudioSource>(); if (Ini.FileExists("Save.sv")) { Ini.LoadFile("Save.sv"); ExamplePony.playerMare = Ini.Get("Player_mare") == "1"; ExamplePony.Beard.SetActive(Ini.Get("Player_beard") == "1"); ExamplePony.randomHair = Convert.ToInt32(Ini.Get("Player_hair")); ExamplePony.SetNewValues(); ExamplePony.HairAnim.GetComponent <SpriteRenderer>().color = ExamplePony.Beard.GetComponent <SpriteRenderer>().color = SaveLoadGame.LoadColor("Player_hairColor"); ExamplePony.GetComponent <SpriteRenderer>().color = SaveLoadGame.LoadColor("Player_bodyColor"); ExamplePony.anims[1].GetComponent <SpriteRenderer>().color = SaveLoadGame.LoadColor("Player_flagColor"); ExamplePony.anims[2].GetComponent <SpriteRenderer>().color = SaveLoadGame.LoadColor("Player_eyesColor"); ExamplePony.gameObject.SetActive(true); for (int i = 0; i < ExamplePony.anims.Length; i++) { ExamplePony.anims[i].SetBool("sit", true); } ExamplePony.HairAnim.SetBool("sit", true); if (ExamplePony.Beard.activeSelf) { ExamplePony.Beard.GetComponent <Animator>().SetBool("sit", true); } LoadGameButton.interactable = true; } }
public void ClickPlay() { MainHero.playerMare = playerMare; MainHero.Beard.SetActive(BeardToggle.isOn && !playerMare); MainHero.randomHair = (int)HairSlider.value; MainHero.SetNewValues(); MainHero.HairAnim.GetComponent <SpriteRenderer>().color = tempHairColor; MainHero.GetComponent <SpriteRenderer>().color = tempBodyColor; MainHero.anims[1].GetComponent <SpriteRenderer>().color = tempFlagColor; MainHero.anims[2].GetComponent <SpriteRenderer>().color = tempEyesColor; StartGame(); }
void LoadPonyVisual(RandomSex pony, string ponyName) { pony.enabled = false; pony.playerMare = Ini.Get(ponyName + "_mare") == "1"; pony.Beard.SetActive(Ini.Get(ponyName + "_beard") == "1"); pony.randomHair = Convert.ToInt32(Ini.Get(ponyName + "_hair")); pony.HairAnim.GetComponent <SpriteRenderer>().color = LoadColor(ponyName + "_hairColor"); pony.GetComponent <SpriteRenderer>().color = LoadColor(ponyName + "_bodyColor"); pony.anims[1].GetComponent <SpriteRenderer>().color = LoadColor(ponyName + "_flagColor"); pony.anims[2].GetComponent <SpriteRenderer>().color = LoadColor(ponyName + "_eyesColor"); pony.SetNewValues(); }