コード例 #1
0
    void SavePonyVisual(RandomSex pony, string ponyName)
    {
        if (pony.playerMare)
        {
            Ini.Set(ponyName + "_mare", "1");
        }
        else
        {
            Ini.Set(ponyName + "_mare", "0");
        }

        if (pony.Beard.activeSelf)
        {
            Ini.Set(ponyName + "_beard", "1");
        }
        else
        {
            Ini.Set(ponyName + "_beard", "0");
        }

        Ini.Set(ponyName + "_hair", pony.randomHair.ToString());

        SaveColor(ponyName + "_hairColor", pony.HairAnim.GetComponent <SpriteRenderer>().color);
        SaveColor(ponyName + "_bodyColor", pony.GetComponent <SpriteRenderer>().color);
        SaveColor(ponyName + "_flagColor", pony.anims[1].GetComponent <SpriteRenderer>().color);
        SaveColor(ponyName + "_eyesColor", pony.anims[2].GetComponent <SpriteRenderer>().color);
    }
コード例 #2
0
    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;
        }
    }
コード例 #3
0
    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();
    }
コード例 #4
0
    void StartCheck()
    {
        playerMare = ExamplePony.playerMare;
        if (playerMare)
        {
            genderText.text = "Женский";
        }
        else
        {
            genderText.text = "Мужской";
        }

        if (playerMare)
        {
            HairSlider.gameObject.SetActive(true);
            HairSlider.value = ExamplePony.randomHair;
        }
        else
        {
            HairSlider.gameObject.SetActive(false);
            BeardToggle.gameObject.SetActive(true);
        }

        BeardToggle.isOn = ExamplePony.Beard.activeSelf && !playerMare;

        tempHairColor = ExamplePony.HairAnim.GetComponent <SpriteRenderer>().color;
        tempBodyColor = ExamplePony.GetComponent <SpriteRenderer>().color;
        tempFlagColor = ExamplePony.anims[1].GetComponent <SpriteRenderer>().color;
        tempEyesColor = ExamplePony.anims[2].GetComponent <SpriteRenderer>().color;

        ChangeColor.value = 0;

        ColorRed.value   = tempHairColor.r;
        ColorGreen.value = tempHairColor.g;
        ColorBlue.value  = tempHairColor.b;
    }
コード例 #5
0
    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();
    }