public static void SaveCards(CardValuesWithScriptable cardValue, SuccesManager allSucces)
    {
        BinaryFormatter formatter = new BinaryFormatter();
        string          path      = Application.persistentDataPath + "/cards.fun";
        FileStream      stream    = new FileStream(path, FileMode.Create);

        Debug.Log(path);

        CardsData data = new CardsData(cardValue, allSucces);

        formatter.Serialize(stream, data);
        stream.Close();
    }
Ejemplo n.º 2
0
    public CardsData(CardValuesWithScriptable cardvalue, SuccesManager allSucces)
    {
        if (cardvalue != null)
        {
            firstCardData = cardvalue._firstCardScriptable.name;
        }


        if (allSucces != null)
        {
            allSuccesData = allSucces.lockInfo;
        }
    }
    public void LoadCard()
    {
        CardsData data = SaveSystem.LoadCards();



        if (succes == null)
        {
            succes = FindObjectOfType <SuccesManager>();
        }
        if (data.allSuccesData != null)
        {
            succes.lockInfo = data.allSuccesData;
        }
    }
    IEnumerator VerifyingSuccess()
    {
        for (int i = 0; i < FindObjectOfType <OngletArboManager>()._listEvents.Count; i++)
        {
            _allCardFinishEvent.Add(false);
        }
        yield return(new WaitForSeconds(2));

        int verifierFinish = 0;
        int verifierUnlock = 0;

        for (int i = 0; i < _imageTreeChilds.Count; i++)
        {
            _allCardUnlock.Add(false);

            if (_imageTreeChilds[i].GetComponent <ImageArborescence>()._alreadyDraw)
            {
                _allCardUnlock[i] = true;
                verifierUnlock++;

                if (_imageTreeChilds[i].GetComponent <ImageArborescence>()._cardID._isDeadCard)
                {
                    _allCardFinishEvent[_imageTreeChilds[i].GetComponent <ImageArborescence>()._idInList] = true;
                    verifierFinish++;
                }
            }
        }

        if (verifierFinish == _allCardFinishEvent.Count && verifierFinish > 0)
        {
            SuccesManager succesManager = FindObjectOfType <SuccesManager>();
            if (succesManager.allTheSucces[10].locked)
            {
                succesManager.UnlockSuccess(succesManager.allTheSucces[10].enumSucces);
            }
        }
        if (verifierUnlock == _imageTreeChilds.Count && verifierUnlock > 0)
        {
            SuccesManager succesManager = FindObjectOfType <SuccesManager>();
            if (succesManager.allTheSucces[2].locked)
            {
                succesManager.UnlockSuccess(succesManager.allTheSucces[2].enumSucces);
            }
        }
    }
    void Start()
    {
        if (TimeChecker.isTuto)
        {
            originalCard         = _firstCardScriptable;
            _firstCardScriptable = tutoCard;
        }
        else
        {
            originalCard = _firstCardScriptable;
        }

        paternVibrationDeath[3] = 200;
        paternVibrationDeath[2] = 100;
        paternVibrationDeath[1] = 75;
        paternVibrationDeath[0] = 50;
        audioManager            = FindObjectOfType <AudioManager>();
        succesManager           = FindObjectOfType <SuccesManager>();
        eventManager            = FindObjectOfType <EventManager>();

        LoadValueFromScriptableObject();
    }
 private void Awake()
 {
     succes = FindObjectOfType <SuccesManager>();
 }