Example #1
0
        public static string From2DA(string name, int idx, string row)
        {
            if (!data.loaded2das.ContainsKey(name))
            {
                Load2DA(name);
            }
            _2DAObject _2da = data.loaded2das[name];

            return(_2da[idx, row]);
        }
Example #2
0
        public static _2DAObject Load2DA(string resref)
        {
            _2DAObject _2da;

            if (data.loaded2das.TryGetValue(resref, out _2da))
            {
                return(_2da);
            }

            Stream stream = data.GetStream(resref, ResourceType.TDA);

            if (stream == null)
            {
                UnityEngine.Debug.LogWarning("Missing 2da: " + resref);
                return(null);
            }
            else
            {
                _2da = new _2DAObject(stream);
                data.loaded2das.Add(resref, _2da);
                return(_2da);
            }
        }