Exemple #1
0
 public static void BuySkin(Skins skin)
 {
     Debug.Log(skin.ToString());
     PlayerPrefs.SetInt("Skin-" + skin.ToString(), 1);
     PlayerPrefs.SetInt("SkinFree", 0);
     PlayerPrefs.Save();
 }
Exemple #2
0
    public static bool IsOwned(Skins skin)
    {
        if (skin == Skins.Cocodrilos)
        {
            if (PlayerPrefs.GetInt("Skin-" + skin.ToString(), 1) == 1)
            {
                return(true);
            }
        }
        else
        if (PlayerPrefs.GetInt("Skin-" + skin.ToString(), 0) == 1)
        {
            return(true);
        }

        return(false);
    }
Exemple #3
0
    private void SetPlayerSkin(Skins skin)
    {
        Destroy(Axis.transform.GetChild(0).gameObject);
        GameObject car = (GameObject)Instantiate(Resources.Load(skin.ToString("g")), Axis.transform.position, Axis.transform.rotation);

        car.transform.parent = Axis.transform;

        car.GetComponent <Rigidbody>().useGravity  = false;
        car.GetComponent <Rigidbody>().isKinematic = true;
        Destroy(car.GetComponent <PlayerCarController>());
        Destroy(car.transform.GetChild(1).gameObject);
        Destroy(car.transform.GetChild(2).gameObject);
    }
Exemple #4
0
        private static void GenerateSkins()
        {
            var list = Enum.GetValues(typeof(Skins)).Cast <Skins>().ToList();

            for (int i = 0; i < list.Count; i++)
            {
                Skins         skinType = list[i];
                BitmapImage[] bmps     = new BitmapImage[10];
                for (int j = 0; j < bmps.Length; j++)
                {
                    bmps[j] = LoadBitmapImage(j, i);
                }
                Skins.Add(skinType, new Skin(bmps, skinType.ToString()));
            }
        }
Exemple #5
0
 public static void SetUnbought(Skins skin)//for testing
 {
     PlayerPrefs.SetInt(skin.ToString(), 0);
 }
Exemple #6
0
 public static void SetBought(Skins skin)
 {
     PlayerPrefs.SetInt(skin.ToString(), 1);
 }
Exemple #7
0
 public static bool IsBought(Skins skin)
 {
     return(PlayerPrefs.GetInt(skin.ToString(), 0) > 0);
 }