Exemplo n.º 1
0
    public static void LoadBundleData()
    {
        TextAsset json = AssetBundleContainer.LoadAsset <TextAsset>("jsons", "Item_Bundle_Table");

        if (json != null)
        {
            Log.Print("Drop table AssetBundle load Succes");
        }

        else
        {
            Log.PrintError("Error: Failed to load Drop table AssetBundle");
        }

        var bundleDatas = JsonManager.LoadJson <Serialization <string, DropBundleData> >(json).ToDictionary();

        if (json != null)
        {
            Log.Print("Drop table Json data load Succes");
        }

        else
        {
            Log.PrintError("Error: Failed to load Drop table Json data");
        }

        foreach (var datas in bundleDatas)
        {
            bundleCtnr.Add(int.Parse(datas.Key), datas.Value);
        }
    }
Exemplo n.º 2
0
    private void Awake()
    {
        var text = AssetBundleContainer.LoadAsset <TextAsset>("jsons", "ShopKeepperTable");

        if (text == null)
        {
            AssetBundle result = AssetBundleContainer.LoadFromFile(Path.Combine(Application.streamingAssetsPath, "jsons"));

            text = result.LoadAsset <TextAsset>("ShopKeepperTable");
        }

        //TODO: 본 게임에 들어갈때 삭제 할 코드
        //ItemContainer.CreateItem();

        Data = JsonManager.LoadJson <Serialization <string, ShopKeepperData> >(text).ToDictionary()[ID];

        _ShopCanvas = GetComponentInChildren <ShopCanvas>();

        nameText.text = Data.NPCName;

        List <int> copyItemID = new List <int>(Data.ItemID);

        _ShopCanvas.LinkingItems(copyItemID);

        _ShopCanvas.CloseCanvas();
    }
Exemplo n.º 3
0
    public static void CreateItem()
    {
        TextAsset json = AssetBundleContainer.LoadAsset <TextAsset>("jsons", "Item_Table");

        if (json != null)
        {
            Log.Print("Item AssetBundle load Succes");
        }

        else
        {
            Log.PrintError("Error: Failed to load Item AssetBundle");
        }

        var itemDatas = JsonManager.LoadJson <Serialization <string, ItemData> >(json).ToDictionary();

        if (json != null)
        {
            Log.Print("Item Json data load Succes");
        }

        else
        {
            Log.PrintError("Error: Failed to load Item Json da");
        }

        foreach (var datas in itemDatas)
        {
            itemCtnr.Add(int.Parse(datas.Key), datas.Value);
        }
    }
Exemplo n.º 4
0
    private void Awake()
    {
        var text = AssetBundleContainer.LoadAsset <TextAsset>("jsons", "NPCTable");

        if (text == null)
        {
            AssetBundle result = AssetBundleContainer.LoadFromFile(Path.Combine(Application.streamingAssetsPath, "jsons"));

            text = result.LoadAsset <TextAsset>("NPCTable");
        }
        var data = JsonManager.LoadJson <Serialization <string, NPCDataTable> >(text).ToDictionary();

        Texts    = data[ID].Text.Split('\n');
        nameText = data[ID].NpcName;

        conversationCanvas.Initialize();
    }