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);
        }
Пример #2
0
        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);
        }
Пример #3
0
        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);
        }