Exemplo n.º 1
0
    void LoadCardStatic()
    {
        TextAsset textAsset = Resources.Load <TextAsset> (ResourcesFolderPath.json_card + "/cardStatic");

        if (textAsset == null)
        {
            Debug.Log("card static infomation file access error");
            throw new System.Exception("card static infomation file access error");
        }
        string json = textAsset.text;
        Dictionary <string, object> dict        = MiniJSON.Json.Deserialize(json) as Dictionary <string, object>;
        Dictionary <string, object> cardStatics = dict ["cardStatic"] as Dictionary <string, object>;

        BaseCard.LoadStaticFields(cardStatics);

        if (!BaseCard.CheckStaticFields())
        {
            Debug.Log("BaseCard static fields incomplete error");
            throw new System.Exception("BaseCard static fields incomplete error");
        }
    }