private void OnGroupActivate(RandomBubbleGroup group) { var index = groups.IndexOf(group); manipulator.SetActionType(ManipulatorActionType.PlaceBubbleAndModifier); manipulator.SetModifier(new BubbleModifierData { Type = BubbleModifierType.Random, Data = index.ToString(), }); }
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); }
private void SetBubbleType(BubbleType type) { manipulator.SetBubbleType(type); manipulator.SetActionType(ManipulatorActionType.PlaceBubble); }
private void OnClick() { manipulator.SetActionType(type); }