Beispiel #1
0
        private void RemoveGroup(RandomBubbleGroup group)
        {
            Action action = delegate
            {
                var index = groups.IndexOf(group);

                RemoveRandomFromBoard(index);
                ShiftRandomGroups(index);

                DeleteGroup(index);
                definitions.RemoveAt(index);

                InitializeGroups();
                UpdateGroupCounts();

                ResizeContents();

                var modifier = manipulator.Modifier;
                if ((modifier != null) &&
                    (modifier.Type == BubbleModifierType.Random) &&
                    (int.Parse(modifier.Data) >= groups.Count))
                {
                    manipulator.SetModifier(null);
                }
            };

            if (group.Count > 0)
            {
                GameObject.Find("LevelEditor").GetComponent <LevelEditor>().ConfirmAction(action);
            }
            else
            {
                action.Invoke();
            }
        }
Beispiel #2
0
        private void OnGroupActivate(RandomBubbleGroup group)
        {
            var index = groups.IndexOf(group);

            manipulator.SetActionType(ManipulatorActionType.PlaceBubbleAndModifier);
            manipulator.SetModifier(new BubbleModifierData
            {
                Type = BubbleModifierType.Random,
                Data = index.ToString(),
            });
        }