public void LoadConstructedRecipeList()
    {
        string        recipeStr = SaveLoadManager.GetInstance().LoadRecipeJson();
        List <Recipe> recipes   = SerializeTools.ListFromJson <Recipe>(recipeStr);

        ConstructedRecipes = recipes;
    }
예제 #2
0
    internal void Initialize(GameManager gameManager)
    {
        m_GameManager      = gameManager;
        m_CustomerTemplate = SaveLoadManager.GetInstance().LoadCustomerTemplate();
        if (m_CustomerTemplate == null)
        {
            throw new System.Exception("Cannot load customer template,wrong path?");
        }
        string customerDataListJson = SaveLoadManager.GetInstance().LoadCustomerDataJson();

        if (customerDataListJson == "")
        {
            Debug.Log("No CustomerData Loaded, create new one");
            CreateCustomerTable();
        }
        else
        {
            m_CustomerDataList = SerializeTools.ListFromJson <CustomerData>(customerDataListJson);
        }

        //Load special customer list
        string specialCustomerDataListJson = SaveLoadManager.GetInstance().LoadSpecialCustomerDataJson();

        if (specialCustomerDataListJson != "")
        {
            List <CustomerData> specialCustomerData = SerializeTools.ListFromJson <CustomerData>(specialCustomerDataListJson);
            m_SpecialCustomerDataList.AddRange(specialCustomerData);
        }
    }