Exemple #1
0
        // -------------------------------------------------------------------------------
        // Init
        // -------------------------------------------------------------------------------
        public override void Init(GameObject _parent = null)
        {
            base.Init(_parent);

            syncStatus.Clear();

            foreach (BaseStatus status in defaultStatus)
            {
                if (status.template != null)
                {
                    SStatus sStatus = new SStatus(status.template.GetId, status.level, status.duration);
                    syncStatus.Add(sStatus);
                }
            }
        }
Exemple #2
0
        // -------------------------------------------------------------------------------
        // Load
        // -------------------------------------------------------------------------------
        public override void Load(BaseDataTable data)
        {
            syncStatus.Clear();

            for (int i = 0; i < data.Rows.Count; ++i)
            {
                TemplateStatus tmpl;

                if (DataManager.dictStatus.TryGetValue(data.GetIdHash(i), out tmpl))
                {
                    SStatus sStatus = new SStatus(tmpl.GetId, data.GetLongAsInt(DatabaseManager.fieldLevel, i), data.GetDouble(DatabaseManager.fieldDuration, i));
                    syncStatus.Add(sStatus);
                }
                else
                {
                    Debug.LogWarning("Skipped template '" + data.GetString(DatabaseManager.fieldName) + "' as it was not found in Library.");
                }
            }

            data.Cleanup();
        }