Example #1
0
    // Use this for initialization
    void OnEnable()
    {
        OpenPack.OnCardsDetermined += Save;
        _openPack        = GameObject.Find("OpenPack").GetComponent <OpenPack>();
        _collectionCards = Serializer.Load <List <Card> >("carddata.sav");

        if (_collectionCards == null)
        {
            _collectionCards = new List <Card>();
        }
    }
    private void OnEnable()
    {
        OpenPack.OnCardsRemove += RemoveCard;
        _animator    = GetComponent <Animator>();
        _audioSource = GetComponent <AudioSource>();
        StartCoroutine(EnableDelay());
        if (SceneManager.GetActiveScene().name == "openpacks")
        {
            _openPack = GameObject.Find("OpenPack").GetComponent <OpenPack>();
        }

        _cardImage.sprite = GameObject.Find("CardBacksDataBase").GetComponent <CardBacksData>()._cardBackSprites[PlayerPrefs.GetInt("CardBackID", 4)];
    }