コード例 #1
0
 /// <summary>
 /// Запросить затирание пробелами элемента. Запрос будет
 /// добавлен в очередь и удовлетворен во время следующей отрисовки.
 /// </summary>
 public void Remove(IDrawableElement element)
 {
     foreach (IDrawable d in element.ElementContent)
     {
         Remove(d.Location.X, d.Location.Y);
     }
 }
コード例 #2
0
 /// <summary>
 /// Добавить элемент в очередь на отрисовку.
 /// </summary>
 public void Create(IDrawableElement element)
 {
     foreach (IDrawable d in element.ElementContent)
     {
         Create(d);
     }
 }
コード例 #3
0
ファイル: DefaultFilter.cs プロジェクト: Hengle/clapotis
        bool IFilterInstance.CheckFilterIn(NGSpotlightWindow window, IDrawableElement element)
        {
            DefaultAssetDrawer drawer = element as DefaultAssetDrawer;

            if (drawer != null)
            {
                return(drawer.type == this.type);
            }

            return(element.GetType() == type);
        }
コード例 #4
0
ファイル: NGSpotlightWindow.cs プロジェクト: Hengle/clapotis
        public static void      AddEntry(string key, IDrawableElement element)
        {
            List <IDrawableElement> list;

            if (NGSpotlightWindow.entries.TryGetValue(key, out list) == false)
            {
                list = new List <IDrawableElement>();
                NGSpotlightWindow.entries.Add(key, list);
            }

            list.Add(element);
        }
コード例 #5
0
            bool IFilterInstance.CheckFilterIn(NGSpotlightWindow window, IDrawableElement element)
            {
                IHasGameObject hasGameObject = element as IHasGameObject;

                try
                {
                    return(hasGameObject != null && hasGameObject.GameObject != null && hasGameObject.GameObject.CompareTag(this.tag) == true);
                }
                catch
                {
                    // In case tags are programmatically changed... We never know.
                }

                return(false);
            }
コード例 #6
0
ファイル: DrawableScheme.cs プロジェクト: just806me/logicsim
        public void RemoveElement(IDrawableElement element)
        {
            _elements.Remove(element);
            _elements.RemoveAll(x => x is Line && (x as Line).ConnectedTo(element));

            foreach (var item in _elements)
            {
                if (item is Output)
                {
                    if (((Output)item).Input == element.Name)
                    {
                        ((Output)item).Input = null;
                    }
                }
                else if (item is Component)
                {
                    if (((Component)item).Input.Any(c => c == element.Name))
                    {
                        ((Component)item).RemoveInput(element.Name);
                    }
                }
            }
        }
コード例 #7
0
            bool IFilterInstance.CheckFilterIn(NGSpotlightWindow window, IDrawableElement element)
            {
                IHasGameObject hasGameObject = element as IHasGameObject;

                return(hasGameObject != null && hasGameObject.GameObject != null && hasGameObject.GameObject.GetComponent(this.type) != null);
            }
コード例 #8
0
            bool IFilterInstance.CheckFilterIn(NGSpotlightWindow window, IDrawableElement element)
            {
                DefaultAssetDrawer hasGameObject = element as DefaultAssetDrawer;

                if (hasGameObject != null)
                {
                    TextureImporter textureImporter = AssetImporter.GetAtPath(hasGameObject.path) as TextureImporter;

                    if (textureImporter != null)
                    {
                        string platform;

                        switch (EditorUserBuildSettings.activeBuildTarget)
                        {
                        case BuildTarget.StandaloneLinux:
                        case BuildTarget.StandaloneLinux64:
                        case BuildTarget.StandaloneLinuxUniversal:
                        case (BuildTarget)4:                                 // BuildTarget.StandaloneOSXIntel
                        case (BuildTarget)27:                                // BuildTarget.StandaloneOSXIntel64
                        case (BuildTarget)2:                                 // BuildTarget.StandaloneOSXUniversal
                        case BuildTarget.StandaloneWindows:
                        case BuildTarget.StandaloneWindows64:
                            platform = "Standalone";
                            break;

                        case BuildTarget.Android:
                            platform = "Android";
                            break;

                        case BuildTarget.iOS:
                            platform = "iPhone";
                            break;

                        case BuildTarget.N3DS:
                            platform = "Nintendo 3DS";
                            break;

                        case BuildTarget.PS4:
                            platform = "PS4";
                            break;

                        case BuildTarget.PSP2:
                            platform = "PSP2";
                            break;

                        case BuildTarget.Switch:                                 // Documentation of Unity does not state on this one.
                            platform = "Switch";
                            break;

                        case BuildTarget.tvOS:
                            platform = "tvOS";
                            break;

                        case BuildTarget.WebGL:
                            platform = "WebGL";
                            break;

                        case BuildTarget.WSAPlayer:
                            platform = "Windows Store Apps";
                            break;

                        case BuildTarget.XboxOne:
                            platform = "XboxOne";
                            break;

                        default:
                            return(false);
                        }

                        int mts;
                        TextureImporterFormat textureFormat;

                        if (textureImporter.GetPlatformTextureSettings(platform, out mts, out textureFormat) == true)
                        {
                            return((int)textureFormat == (int)this.format);
                        }
                    }
                }

                return(false);
            }
コード例 #9
0
 internal bool ConnectedTo(IDrawableElement element)
 => connection.Item1 == element || connection.Item2 == element;
コード例 #10
0
 bool IFilterInstance.CheckFilterIn(NGSpotlightWindow window, IDrawableElement element)
 {
     return(element is MenuItemDrawer);
 }
コード例 #11
0
ファイル: DrawableScheme.cs プロジェクト: just806me/logicsim
 public void AddElement(IDrawableElement element) => _elements.Add(element);
コード例 #12
0
 bool IFilterInstance.CheckFilterIn(NGSpotlightWindow window, IDrawableElement element)
 {
     return(element.LowerStringContent.EndsWith(this.extension));
 }