// -------------------------------------------------------------------------------
        protected override void ThrottledUpdate()
        {
            if (manager == null)
            {
                manager = localPlayer.GetComponent <SkillManager>();
            }

            for (int i = 0; i < contentGroup.childCount; i++)
            {
                GameObject.Destroy(contentGroup.GetChild(i).gameObject);
            }

            foreach (SkillSyncStruct _entry in manager.GetEntries(true, SortOrder.None, category))
            {
                SkillSyncStruct entry  = _entry;
                GameObject      prefab = null;

                if (displayType == DisplayType.Horizontal)
                {
                    prefab = horizontalSlotPrefab.gameObject;
                }
                else if (displayType == DisplayType.Vertical)
                {
                    prefab = verticalSlotPrefab.gameObject;
                }
                else if (displayType == DisplayType.Grid)
                {
                    prefab = gridSlotPrefab.gameObject;
                }

                GameObject go = GameObject.Instantiate(prefab);
                go.transform.SetParent(contentGroup, false);
                go.GetComponent <UIPlayerListSkillSlot>().Init(localPlayer, ref entry);
            }
        }
Exemplo n.º 2
0
        protected override void SellEntry(int _index, long _amount)
        {
            SkillSyncStruct entry = syncSkills[_index];

            entry.Remove(_amount);
            syncSkills[_index] = entry;

            GetComponentInParent <CurrencyManager>().AddCurrency(entry.template.sellCost, entry.level);
        }
Exemplo n.º 3
0
        public void SaveData_Skill(GameObject player)
        {
            connection.Execute("DELETE FROM c2w_skill WHERE owner=?", player.name);

            SkillManager manager = player.GetComponent <SkillManager>();

            List <SkillSyncStruct> list = manager.GetEntries(false);

            for (int i = 0; i < list.Count; i++)
            {
                SkillSyncStruct entry = list[i];

                connection.InsertOrReplace(new c2w_skill {
                    owner = player.name,
                    slot  = entry.slot,
                    name  = entry.name,
                    level = entry.level,
                    state = entry.state,
                    timer = entry.timer
                });
            }
        }
Exemplo n.º 4
0
        public void AddEntry(int _slot, SkillTemplate _template, byte _state, double _timer, int _level)
        {
            SkillSyncStruct syncStruct = new SkillSyncStruct(_slot, _template, _state, _timer, _level);

            syncSkills.Add(syncStruct);
        }