protected void DrawDefaultWindow(bool ignoreNotSupportedType = false)
 {
     FieldInfo[] infos = DIComponentHelper.GatherFieldInfos(this);
     for (int i = 0; i < infos.Length; i++)
     {
         DIComponentHelper.DrawField(infos[i], this, ignoreNotSupportedType);
     }
 }
예제 #2
0
        //========================================================================================================================================
        //CHANGES END HERE
        //========================================================================================================================================

        //TO-DO : add color to window
        void ColorizeWindow()
        {
            Color backgroundColor = new Color32(120, 120, 120, 255);
            Rect  position        = GetSize;

            position.position = Vector2.zero;
            if (backgroundTexture == null || (backgroundTexture.height != (int)position.height && backgroundTexture.width != (int)position.width))
            {
                backgroundTexture = DIComponentHelper.MakeTexture((int)position.width, (int)position.height, backgroundColor, false);
            }
            GUI.DrawTexture(position, backgroundTexture);
        }
        public void RemoveAction(int id)
        {
            if (isRoot)
            {
                DIComponentHelper.EGLLabel("Remove include child?", DIComponentHelper.boldLabel);
                DIComponentHelper.EGLBeginHorizontal();
                if (GUILayout.Button("With Childs"))
                {
                    DIVisualScriptingData.atTheEnd += OnRemoveButton;
                    DIVisualScriptingData.atTheEnd += (() => {
                        FindChildAndDestroy();
                    });
                }
                if (GUILayout.Button("No"))
                {
                    isRemoveAction = false;
                }
                DIComponentHelper.EGLEndHorizontal();
            }
            else
            {
                DIComponentHelper.EGLLabel("Remove component?", DIComponentHelper.boldLabel);
                DIComponentHelper.EGLBeginHorizontal();
                if (GUILayout.Button("Yes"))
                {
                    if (next != null && previous != null)
                    {
                        next.previous = previous;
                        previous.next = next;
                    }
                    DIVisualScriptingData.atTheEnd += (() => { DestroyImmediate(this, true); });
                }
                if (GUILayout.Button("With Childs"))
                {
                    DIVisualScriptingData.atTheEnd += OnRemoveButton;
                    DIVisualScriptingData.atTheEnd += (() => {
                        FindChildAndDestroy();
                    });
                }
                if (GUILayout.Button("No"))
                {
                    isRemoveAction = false;
                }

                DIComponentHelper.EGLEndHorizontal();
            }

            GUI.DragWindow();
        }