void LoadTexture()
    {
        //check to see if our save file for this character
        string path = Application.persistentDataPath + "/Save.png";

        if (File.Exists(path))
        {
            SavedData data = SaveCustomasation.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;
            charName = data.charName;
        }

        else
        {
            SetTexture("Skin", customSet.skinIndex       = 0);
            SetTexture("Hair", customSet.hairIndex       = 0);
            SetTexture("Mouth", customSet.mouthIndex     = 0);
            SetTexture("Eyes", customSet.eyesIndex       = 0);
            SetTexture("Clothes", customSet.clothesIndex = 0);
            SetTexture("Armour", customSet.armourIndex   = 0);
        }
    }
Пример #2
0
    //Function called Save this will allow us to save our indexes
    void Save()
    {
        //SetInt for SkinIndex, HairIndex, MouthIndex, EyesIndex

        //SetString CharacterName
        SaveCustomasation.SavePlayerCustomisation(this);
        Debug.Log("Saved");
    }