Example #1
0
    void OnTriggerEnter2D(Collider2D other)
    {
        ItemMover itemMoverScript = other.gameObject.GetComponent <ItemMover> ();

        if (!playerStatusScript.isDead)
        {
            if (itemMoverScript != null)
            {
                itemMoverScript.Reset();

                ScoreEffectEnum scoreEffectValue;

                if (iconBoxScript.activeIconName == other.gameObject.tag)
                {
                    scoreEffectValue = iconBoxScript.Increment();
                    GotItemEffect(colorNormal, scoreEffectValue, false);
                }
                else if (other.gameObject.tag == "cake")
                {
                    scoreEffectValue = iconBoxScript.IncrementCakeBonus();
                    GotItemEffect(colorBonus, scoreEffectValue, true);
                }
                else
                {
                    playerStatusScript.TakeDamage();
                }
            }
        }
    }
Example #2
0
 public void Init()
 {
     itemEraser = this.gameObject.GetComponent <ItemEraser>();
     itemMover  = this.gameObject.GetComponent <ItemMover>();
     itemEraser.Init();
     itemMover.Init();
 }
Example #3
0
 public void GetItem(ItemMover myItem)
 {
     foreach (BaseItemManager it in ItemManagers)
     {
         if (it.ItemNumber != myItem.ItemNumber)
         {
             continue;
         }
         it.enabled = true;
         it.GetItem();
         Items.Remove(myItem);
         Destroy(myItem.gameObject);
     }
 }
        public override void SetUp()
        {
            base.SetUp();

            var types = new[] { typeof(Items.PageItem), typeof(Items.DataItem) };

            versionRepository = TestSupport.CreateVersionRepository(ref persister, ref activator, types);
            versions          = TestSupport.SetupVersionManager(persister, versionRepository);
            mover             = new ItemMover(
                // persister,
                new Navigator(persister, TestSupport.SetupHost(), new VirtualNodeFactory(), TestSupport.SetupContentSource()),
                new FakeIntegrityManager(),
                versions,
                versionRepository);
            request = new NameValueCollection();

            root = base.CreateOneItem <Items.PageItem>(0, "root", null);
        }
Example #5
0
        private void ToCollection(string from, string to)
        {
            IEnumerable <ListBoxImageItem> enSelectedItems = listBox_CollectionItems.SelectedItems.Cast <ListBoxImageItem>();

            int firstCollectionItemSelectedIndex = enSelectedItems.Min(x => collectionItems.IndexOf(x));

            List <ListBoxImageItem> selectedItems = new List <ListBoxImageItem>(enSelectedItems);
            ItemMover itemMover = CollectionStore.InitializeItemMover(from, to);

            foreach (ListBoxImageItem item in selectedItems)
            {
                collectionItems.Remove(item);
                itemMover.Move(item.Path);
            }
            itemMover.EndMoving();

            listBox_CollectionItems.SelectedIndex = Math.Min(firstCollectionItemSelectedIndex, listBox_CollectionItems.Items.Count - 1);
        }
        public ObservableCodeCollectionViewGallery(ItemsLayoutOrientation orientation = ItemsLayoutOrientation.Vertical,
                                                   bool grid = true, int initialItems = 1000, bool addItemsWithTimer = false, ItemsUpdatingScrollMode scrollMode = ItemsUpdatingScrollMode.KeepItemsInView)
        {
            var layout = new Grid
            {
                RowDefinitions = new RowDefinitionCollection
                {
                    new RowDefinition {
                        Height = GridLength.Auto
                    },
                    new RowDefinition {
                        Height = GridLength.Auto
                    },
                    new RowDefinition {
                        Height = GridLength.Auto
                    },
                    new RowDefinition {
                        Height = GridLength.Auto
                    },
                    new RowDefinition {
                        Height = GridLength.Auto
                    },
                    new RowDefinition {
                        Height = GridLength.Auto
                    },
                    new RowDefinition {
                        Height = GridLength.Star
                    }
                }
            };

            IItemsLayout itemsLayout = grid
                                ? new GridItemsLayout(3, orientation)
                                : new LinearItemsLayout(orientation) as IItemsLayout;

            var itemTemplate = ExampleTemplates.PhotoTemplate();

            var collectionView = new CollectionView {
                ItemsLayout  = itemsLayout, ItemTemplate = itemTemplate,
                AutomationId = "collectionview", Header = "This is the header", ItemsUpdatingScrollMode = scrollMode
            };

            var generator = new ItemsSourceGenerator(collectionView, initialItems, ItemsSourceType.ObservableCollection);

            var remover  = new ItemRemover(collectionView);
            var adder    = new ItemAdder(collectionView);
            var replacer = new ItemReplacer(collectionView);
            var mover    = new ItemMover(collectionView);
            var inserter = new ItemInserter(collectionView);

            layout.Children.Add(generator);

            layout.Children.Add(remover);
            Grid.SetRow(remover, 1);

            layout.Children.Add(adder);
            Grid.SetRow(adder, 2);

            layout.Children.Add(replacer);
            Grid.SetRow(replacer, 3);

            layout.Children.Add(mover);
            Grid.SetRow(mover, 4);

            layout.Children.Add(inserter);
            Grid.SetRow(inserter, 5);

            layout.Children.Add(collectionView);
            Grid.SetRow(collectionView, 6);

            Content = layout;

            if (addItemsWithTimer)
            {
                generator.GenerateEmptyObservableCollectionAndAddItemsEverySecond();
            }
            else
            {
                generator.GenerateItems();
            }
        }
Example #7
0
        private int _iterator = 0; //used to continue movement after Pause from the same spot

        private void Awake()
        {
            Items  = new GameObject[ItemsToSpawn];
            _mover = new ItemMover();
        }
        public ObservableCodeCollectionViewGallery(ItemsLayoutOrientation orientation = ItemsLayoutOrientation.Vertical,
                                                   bool grid = true)
        {
            var layout = new Grid
            {
                RowDefinitions = new RowDefinitionCollection
                {
                    new RowDefinition {
                        Height = GridLength.Auto
                    },
                    new RowDefinition {
                        Height = GridLength.Auto
                    },
                    new RowDefinition {
                        Height = GridLength.Auto
                    },
                    new RowDefinition {
                        Height = GridLength.Auto
                    },
                    new RowDefinition {
                        Height = GridLength.Auto
                    },
                    new RowDefinition {
                        Height = GridLength.Star
                    }
                }
            };

            IItemsLayout itemsLayout = grid
                                ? new GridItemsLayout(3, orientation)
                                : new ListItemsLayout(orientation) as IItemsLayout;

            var itemTemplate = ExampleTemplates.PhotoTemplate();

            var collectionView = new CollectionView {
                ItemsLayout = itemsLayout, ItemTemplate = itemTemplate
            };

            var generator = new ItemsSourceGenerator(collectionView);

            var remover  = new ItemRemover(collectionView);
            var adder    = new ItemAdder(collectionView);
            var replacer = new ItemReplacer(collectionView);
            var mover    = new ItemMover(collectionView);

            layout.Children.Add(generator);

            layout.Children.Add(remover);
            Grid.SetRow(remover, 1);

            layout.Children.Add(adder);
            Grid.SetRow(adder, 2);

            layout.Children.Add(replacer);
            Grid.SetRow(replacer, 3);

            layout.Children.Add(mover);
            Grid.SetRow(mover, 4);

            layout.Children.Add(collectionView);
            Grid.SetRow(collectionView, 5);

            Content = layout;

            generator.GenerateObservableCollection();
        }
Example #9
0
 private void Start()
 {
     _itemMover = GetComponent <ItemMover>();
     _isRemoved = false;
 }