Ejemplo n.º 1
0
        /// <summary>
        /// Override this to do stuffs when skill usages changes
        /// </summary>
        /// <param name="operation"></param>
        /// <param name="index"></param>
        protected virtual void OnSkillUsagesOperation(LiteNetLibSyncList.Operation operation, int index)
        {
            if (onSkillUsagesOperation != null)
            {
                onSkillUsagesOperation.Invoke(operation, index);
            }

            // Call update skill operations to update uis
            switch (operation)
            {
            case LiteNetLibSyncList.Operation.Add:
            case LiteNetLibSyncList.Operation.Insert:
            case LiteNetLibSyncList.Operation.Set:
            case LiteNetLibSyncList.Operation.Dirty:
                int skillIndex = this.IndexOfSkill(SkillUsages[index].dataId);
                if (skillIndex >= 0)
                {
                    skillsRecachingState = new SyncListRecachingState()
                    {
                        isRecaching = true,
                        operation   = LiteNetLibSyncList.Operation.Dirty,
                        index       = skillIndex
                    };
                }
                break;
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Override this to do stuffs when summons changes
 /// </summary>
 /// <param name="operation"></param>
 /// <param name="index"></param>
 protected virtual void OnSummonsOperation(LiteNetLibSyncList.Operation operation, int index)
 {
     summonsRecachingState = new SyncListRecachingState()
     {
         isRecaching = true,
         operation   = operation,
         index       = index
     };
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Override this to do stuffs when non equip items changes
 /// </summary>
 /// <param name="operation"></param>
 /// <param name="index"></param>
 protected virtual void OnNonEquipItemsOperation(LiteNetLibSyncList.Operation operation, int index)
 {
     nonEquipItemsRecachingState = new SyncListRecachingState()
     {
         isRecaching = true,
         operation   = operation,
         index       = index
     };
 }
Ejemplo n.º 4
0
        /// <summary>
        /// Override this to do stuffs when equip items changes
        /// </summary>
        /// <param name="operation"></param>
        /// <param name="index"></param>
        protected virtual void OnEquipItemsOperation(LiteNetLibSyncList.Operation operation, int index)
        {
            if (CharacterModel != null)
            {
                CharacterModel.SetEquipItems(equipItems);
            }

            equipItemsRecachingState = new SyncListRecachingState()
            {
                isRecaching = true,
                operation   = operation,
                index       = index
            };
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Override this to do stuffs when buffs changes
        /// </summary>
        /// <param name="operation"></param>
        /// <param name="index"></param>
        protected virtual void OnBuffsOperation(LiteNetLibSyncList.Operation operation, int index)
        {
            if (CharacterModel != null)
            {
                CharacterModel.SetBuffs(buffs);
            }

            buffsRecachingState = new SyncListRecachingState()
            {
                isRecaching = true,
                operation   = operation,
                index       = index
            };
        }