Exemple #1
0
        private void Initialize()
        {
            if (ID != UInt32.MaxValue && childId != UInt32.MaxValue)
            {
                // Only get the first dialogue.
                startDialogue = DialogueLine.ConvertRow(TableDatabase.Get.GetRow("dialogues", childId),
                                                        overrideTable ? collection : LocalizationEditorSettings.GetStringTableCollection("Dialogues"));

                var field = TableDatabase.Get.GetField(Name, "data", ID);
                if (field != null)
                {
                    StoryTable.ParseNodeData(this, (JObject)field.Data);
                }
            }

            if (characterID != UInt32.MaxValue)
            {
                TableDatabase          database = TableDatabase.Get;
                Tuple <uint, TableRow> link     = database.FindLink("characters", "name", characterID);
                if (link != null)
                {
                    var field = database.GetField(link.Item2, "name");
                    if (field != null)
                    {
                        characterName = (string)field.Data;
                    }

                    Debug.Log(characterName);
                }
            }
        }
Exemple #2
0
    public static TableT <T> GetTable <T>() where T : Conditionable
    {
        TableT <T> table     = null;
        var        className = typeof(T);

        if (Paths.ContainsKey(className))
        {
            table = TableDatabase.Load <T>(Paths[className]);
            if (table == null)
            {
                Debug.LogError("can not open " + Paths[className] + " table");
                return(default(TableT <T>));
            }
        }

        if (table == null)
        {
            Debug.LogError(string.Format("table {0} not init url", className));
        }
        return(table);
    }