Пример #1
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(),
            });
        }
Пример #2
0
        private void CreateModifierButton(BubbleModifierDefinition modifier)
        {
            var button = Instantiate(bubbleButtonPrefab);

            button.name = modifier.Type.ToString();
            button.GetComponent <Image>().sprite = modifier.Sprite;
            var toggle = button.GetComponent <Toggle>();

            toggle.group = GetComponent <ToggleGroup>();
            toggle.onValueChanged.AddListener((value) =>
            {
                if (value)
                {
                    manipulator.SetModifier(modifier);
                    manipulator.SetActionType(ManipulatorActionType.PlaceModifier);
                }
            });
            button.transform.SetParent(transform, false);
        }
Пример #3
0
 private void SetBubbleType(BubbleType type)
 {
     manipulator.SetBubbleType(type);
     manipulator.SetActionType(ManipulatorActionType.PlaceBubble);
 }
Пример #4
0
 private void OnClick()
 {
     manipulator.SetActionType(type);
 }