Пример #1
0
 /// <summary>
 /// Called when the object is selected.
 /// </summary>
 /// <param name="component">The component which was selected.</param>
 /// <param name="data">true if selected, or false if deselected.</param>
 private static void OnSelect(ColoredRangeVisualizer component, object data)
 {
     if (data is bool selected && component != null)
     {
         var position = component.transform.position;
         // Play the appropriate sound and update the visualizers
         if (selected)
         {
             PUtil.PlaySound("RadialGrid_form", position);
             component.CreateVisualizers();
         }
         else
         {
             PUtil.PlaySound("RadialGrid_disappear", position);
             component.RemoveVisualizers();
         }
     }
 }
Пример #2
0
 /// <summary>
 /// Called when the object is rotated.
 /// </summary>
 /// <param name="component">The component which was rotated.</param>
 private static void OnRotated(ColoredRangeVisualizer component, object _)
 {
     component?.CreateVisualizers();
 }