Beispiel #1
0
    // Start is called before the first frame update
    void Start()
    {
        KnifeSkin skins = Resources.Load <KnifeSkin>("KnifeSkins");

        gameObject.GetComponent <SpriteRenderer>().sprite = skins.spriteKnife[PlayerPrefs.GetInt("CurrentSkin", 0)];
        rBody       = gameObject.GetComponent <Rigidbody2D>();
        audioSource = gameObject.GetComponent <AudioSource>();
    }
Beispiel #2
0
    void OnEnable()
    {
        skins           = Resources.Load <KnifeSkin>("KnifeSkins");
        unlockedKnives  = PlayerPrefs.GetString("UnlockedKnives", "1000000000000000");
        coins           = PlayerPrefs.GetInt("AppleCoin", 0);
        textApples.text = "x " + coins;

        currentKnife.sprite = skins.spriteKnife[PlayerPrefs.GetInt("CurrentSkin", 0)];

        CheckSlots();
    }
Beispiel #3
0
    void SetCurrentKnifeSkin()
    {
        KnifeSkin kn = skinsManager.GetCurrentKnifeSkin();

        knifeSkin.GetComponent <Renderer>().material.SetTexture("_MainTex", kn.Texture2D);
    }