예제 #1
0
        public void OnUpdateAction(BasePackage package, UpdateAction[] acts)
        {
            foreach (var act in acts)
            {
                switch (act.Type)
                {
                case UpdateAction.ActionType.Init:
                    Init();
                    break;

                case UpdateAction.ActionType.Add:
                    UpdateItem(act.Index, package.GetItemAt <ItemData>(act.Index));
                    break;

                case UpdateAction.ActionType.Remove:
                    UpdateItem(act.Index, package.GetItemAt <ItemData>(act.Index));
                    break;

                case UpdateAction.ActionType.UpdateCount:
                    UpdateItem(act.Index, package.GetItemAt <ItemData>(act.Index));
                    break;

                default:
                    throw new ArgumentOutOfRangeException();
                }
            }
        }
예제 #2
0
 public void OnItemAdded(BasePackage basePackage, int index)
 {
     UpdateItem(index, basePackage.GetItemAt <ItemData>(index));
 }