Пример #1
0
    void LoadTexture()
    {
        //check to see if our save file for this character
        string path = Application.persistentDataPath + "/Save.jpg";

        if (File.Exists(path))
        {
            SavedData data = SaveCustomisation.LoadPlayerData();
            SetTexture("Skin", data.skin);
            skin = data.skin;
            SetTexture("Hair", data.hair);
            hair = data.hair;
            SetTexture("Mouth", data.mouth);
            mouth = data.mouth;
            SetTexture("Skin", data.skin);
            eyes = data.eyes;
            SetTexture("Armour", data.armour);
            armour = data.armour;
            SetTexture("Clothes", data.clothes);
            clothes = data.clothes;

            charText.text   = data.charName;
            healthText.text = data.health;
            manaText.text   = data.mana;
            classText.text  = data.classType;
        }

        else
        {
            SetTexture("Skin", custom.skinIndex       = 0);
            SetTexture("Hair", custom.hairIndex       = 0);
            SetTexture("Mouth", custom.mouthIndex     = 0);
            SetTexture("Eyes", custom.eyesIndex       = 0);
            SetTexture("Clothes", custom.clothesIndex = 0);
            SetTexture("Armour", custom.armourIndex   = 0);
        }
    }
Пример #2
0
 public void Save()
 {
     SaveCustomisation.SavePlayerCustomisation(this);
     Debug.Log("Saved");
 }