private UnityEngine.Texture GetSourceIcon(WireListData wireListData) { Texture2D icon = null; switch (wireListData.Source) { case SwitchSource.Playfield: { if (_switches.ContainsKey(wireListData.SourcePlayfieldItem.ToLower())) { icon = Icons.ByComponent(_switches[wireListData.SourcePlayfieldItem.ToLower()], IconSize.Small); } break; } case SwitchSource.Constant: icon = Icons.Switch(wireListData.SourceConstant == SwitchConstant.NormallyClosed, IconSize.Small); break; case SwitchSource.InputSystem: icon = Icons.Key(IconSize.Small); break; case SwitchSource.Device: if (_switchDevices.ContainsKey(wireListData.SourceDevice.ToLower())) { icon = Icons.ByComponent(_switchDevices[wireListData.SourceDevice.ToLower()], IconSize.Small); } break; } return(icon); }
private UnityEngine.Texture GetIcon(SwitchListData switchListData) { Texture2D icon = null; switch (switchListData.Source) { case SwitchSource.Playfield: { if (_switchables.ContainsKey(switchListData.PlayfieldItem.ToLower())) { icon = Icons.ByComponent(_switchables[switchListData.PlayfieldItem.ToLower()], size: IconSize.Small); } break; } case SwitchSource.Constant: icon = Icons.Switch(switchListData.Constant == SwitchConstant.NormallyClosed, size: IconSize.Small); break; case SwitchSource.InputSystem: icon = Icons.Key(IconSize.Small); break; } return(icon); }
protected override Texture GetIcon(SwitchListData switchListData) { Texture2D icon = null; switch (switchListData.Source) { case SwitchSource.Playfield: { if (switchListData.Device != null) { icon = Icons.ByComponent(switchListData.Device, IconSize.Small); } break; } case SwitchSource.Constant: icon = Icons.Switch(switchListData.Constant == SwitchConstant.Closed, IconSize.Small); break; case SwitchSource.InputSystem: icon = Icons.Key(IconSize.Small); break; } return(icon); }
public override void OnEnable() { titleContent = new GUIContent("Switch Manager", Icons.Switch(false, IconSize.Small)); RowHeight = 22; base.OnEnable(); }
private static void DrawSwitch(string label, DeviceSwitch sw) { var labelPos = EditorGUILayout.GetControlRect(); labelPos.height = 18; var switchPos = new Rect((float)(labelPos.x + (double)EditorGUIUtility.labelWidth + 2.0), labelPos.y, labelPos.height, labelPos.height); GUI.Label(labelPos, label); GUI.DrawTexture(switchPos, Icons.Switch(sw.IsSwitchClosed, IconSize.Small, sw.IsSwitchClosed ? IconColor.Orange : IconColor.Gray)); }
protected override void OnEnable() { titleContent = new GUIContent("Switch Manager", Icons.Switch(false, size: IconSize.Small)); RowHeight = 22; _inputManager = new InputManager(RESOURCE_PATH); AssetDatabase.Refresh(); _listViewItemRenderer = new SwitchListViewItemRenderer(_ids, _switchables, _inputManager); base.OnEnable(); }
private static void DrawSwitch(string label, bool sw) { var labelPos = EditorGUILayout.GetControlRect(); labelPos.height = 18; var icon = Icons.Switch(sw, IconSize.Small, sw ? IconColor.Orange : IconColor.Gray); var width = ((labelPos.height / icon.height) * icon.width) + 2; labelPos.x += width; labelPos.width -= width; var switchPos = new Rect(labelPos.x - width, labelPos.y, labelPos.height, labelPos.height); GUI.Label(labelPos, label); GUI.DrawTexture(switchPos, icon); }
protected override Texture2D StatusIcon(IApiSwitchStatus status) => Icons.Switch(status.IsSwitchClosed, IconSize.Small, status.IsSwitchClosed ? IconColor.Orange : IconColor.Gray);
public Texture2D Lookup <T>(T mb, IconSize size = IconSize.Large, IconColor color = IconColor.Gray) where T : class { switch (mb) { case BallRollerComponent _: return(Icons.BallRoller(size, color)); case BumperComponent _: return(Icons.Bumper(size, color)); case CannonRotatorComponent _: return(Icons.Cannon(size, color)); case DropTargetComponent _: return(Icons.DropTarget(size, color)); case DropTargetBankComponent _: return(Icons.DropTargetBank(size, color)); case FlipperComponent _: return(Icons.Flipper(size, color)); case GateComponent _: return(Icons.Gate(size, color)); case GateLifterComponent _: return(Icons.GateLifter(size, color)); case HitTargetComponent _: return(Icons.HitTarget(size, color)); case KickerComponent _: return(Icons.Kicker(size, color)); case LightComponent _: return(Icons.Light(size, color)); case LightGroupComponent _: return(Icons.LightGroup(size, color)); case PlungerComponent _: return(Icons.Plunger(size, color)); case PlayfieldComponent _: return(Icons.Playfield(size, color)); case PrimitiveComponent _: return(Icons.Primitive(size, color)); case RampComponent _: return(Icons.Ramp(size, color)); case RotatorComponent _: return(Icons.Rotator(size, color)); case RubberComponent _: return(Icons.Rubber(size, color)); case ScoreReelDisplayComponent _: return(Icons.ScoreReel(size, color)); case ScoreReelComponent _: return(Icons.ScoreReelSimple(size, color)); case SpinnerComponent _: return(Icons.Spinner(size, color)); case SlingshotComponent _: return(Icons.Slingshot(size, color)); case SurfaceComponent _: return(Icons.Surface(size, color)); case StepRotatorMechComponent _: return(Icons.Mech(size, color)); case TeleporterComponent _: return(Icons.Teleporter(size, color)); case TriggerComponent _: return(Icons.Trigger(size, color)); case TroughComponent _: return(Icons.Trough(size, color)); case MetalWireGuideComponent _: return(Icons.MetalWireGuide(size, color)); case CollisionSwitchComponent _: return(Icons.Switch(false, size, color)); default: return(null); } }