Beispiel #1
0
 public override void DrawSelf(XBaseWindow window)
 {
     if (isShowAll)
     {
         DrawComments(window);
     }
 }
Beispiel #2
0
 public override void OnXGUI()
 {
     base.OnXGUI();
     DoButton("Open In Window", () => {
         var window = XBaseWindow.InitWindow <FsmEditor>(target);
     });
 }
Beispiel #3
0
    public void OnGUI()
    {
        DrawLogo(GUILayout.ExpandWidth(true));
        if (GUI.Button(GUILayoutUtility.GetLastRect(), XResources.LogoTexture))
        {
            this.Close();
            string cmdPrefs = GetType().ToString() + "_isPrefix";
            bool   isPrefix = EditorPrefs.GetBool(cmdPrefs, false);
            EditorPrefs.SetBool(cmdPrefs, !isPrefix);
            XBaseWindow window = EditorWindow.GetWindow(GetType(), !isPrefix, GetType().Name, true) as XBaseWindow;
            window.OnInitialization(closeRecordArgs);
            return;
        }
        if (isAutoScroll)
        {
            _scrollPos = EditorGUILayout.BeginScrollView(_scrollPos);
        }

        OnXGUI();

        if (isAutoScroll)
        {
            EditorGUILayout.EndScrollView();
        }
    }
Beispiel #4
0
        public override void DrawSelf(XBaseWindow window)
        {
            window.DoButton(name, () => isShowAll = !isShowAll);
            if (isShowAll)
            {
                window.BeginHorizontal();
                name = window.CreateStringField(name);
                window.EndHorizontal();

                window.BeginHorizontal();
                DrawType(window);
                window.DoButton("Add Parameter", () => parameters.Add(new XCodeParameter()));
                window.DoButton("Add Attribute", () => attributes.Add(new XCodeCustomAttribute()));
                window.DoButton("Add Comment", () => comments.Add("TODO LIST"));
                window.EndHorizontal();
            }


            if (isShowAll)
            {
                DrawComments(window);
                DrawCustomeAttribute(window);
                DrawParameters(window);
            }
        }
        public virtual void DrawType(XBaseWindow window)
        {
            XBaseWindow.DoButton("Type", ()=> {
                XCodeTypeTemplate.SelectType(x => type = x);
            });

            memberAttribute = (MemberAttributes)XBaseWindow.CreateEnumPopup( memberAttribute );
        }
Beispiel #6
0
        public virtual void DrawType(XBaseWindow window)
        {
            XBaseWindow.DoButton("Type", () => {
                XCodeTypeTemplate.SelectType(x => type = x);
            });

            memberAttribute = (MemberAttributes)XBaseWindow.CreateEnumPopup(memberAttribute);
        }
Beispiel #7
0
 public override void OnXGUI()
 {
     if (CreateSpaceButton("Open In XCodeWindow"))
     {
         CodeGenerateEditor window = XBaseWindow.InitWindow <CodeGenerateEditor>();
         window.codeObject = target as XCodeObject;
     }
 }
        public void DrawSelf(XBaseWindow window)
        {
            name = XBaseWindow.CreateStringField("ClassName", name);

            XBaseWindow.DoButton("Add New NameSpace", () => importNamespace.Add("UnityEngine"));
            for (int pos = 0; pos < importNamespace.Count; pos++)
            {
                //  TODO loop in importNamespace.Count
                XBaseWindow.BeginHorizontal();
                importNamespace[pos] = XBaseWindow.CreateStringField(importNamespace[pos]);
                XBaseWindow.DoButton("Delete", () => importNamespace.RemoveAt(pos));
                XBaseWindow.EndHorizontal();
            }

            XBaseWindow.DoButton("Add New BaseClass", () => baseClass.Add("Object"));
            for (int pos = 0; pos < baseClass.Count; pos++)
            {
                //  TODO loop in importNamespace.Count
                XBaseWindow.BeginHorizontal();
                baseClass[pos] = XBaseWindow.CreateStringField(baseClass[pos]);
                XBaseWindow.DoButton("Delete", () => baseClass.RemoveAt(pos));
                XBaseWindow.EndHorizontal();
            }

            XBaseWindow.BeginHorizontal();
            XBaseWindow.DoButton("Add Method", () => methods.Add(new XCodeMethod()));
            XBaseWindow.DoButton("Add Field", () => fields.Add(new XCodeField()));
            XBaseWindow.DoButton("Add Property", () => properties.Add(new XCodeProperty()));
            XBaseWindow.EndHorizontal();

            for (int pos = 0; pos < methods.Count; pos++)
            {
                //  TODO loop in classChildren.Count
                methods[pos].DrawSelf(window);
                XBaseWindow.DoButton("Delete", () => methods.RemoveAt(pos));
            }
            for (int pos = 0; pos < fields.Count; pos++)
            {
                //  TODO loop in classChildren.Count
                fields[pos].DrawSelf(window);
                XBaseWindow.DoButton("Delete", () => fields.RemoveAt(pos));
            }
            for (int pos = 0; pos < properties.Count; pos++)
            {
                //  TODO loop in classChildren.Count
                properties[pos].DrawSelf(window);
                XBaseWindow.DoButton("Delete", () => properties.RemoveAt(pos));
            }

            XBaseWindow.DoButton("Review Content", () =>
            {
                reviewContent = ReviewContent();
            });

            reviewContent = EditorGUILayout.TextArea(reviewContent);
        }
 //        public virtual void DrawMemberAttribute(XBaseWindow window)
 //        {
 //            memberAttribute = window.CreateEnumSelectable( memberAttribute ) as MemberAttributes;
 //        }
 public virtual void DrawComments(XBaseWindow window)
 {
     XBaseWindow.CreateLabel( "Comments" );
     for( int pos = 0; pos < comments.Count; pos++ ) {
         //  TODO loop in comments.Count
         XBaseWindow.BeginHorizontal();
         comments[pos] = XBaseWindow.CreateStringField( comments[pos] );
         XBaseWindow.DoButton( "Delete", () => comments.RemoveAt( pos ) );
         XBaseWindow.EndHorizontal();
     }
 }
 public virtual void DrawCustomeAttribute(XBaseWindow window)
 {
     XBaseWindow.CreateLabel( "CustomAttributes" );
     for( int pos = 0; pos < attributes.Count; pos++ ) {
         //  TODO loop in comments.Count
         XBaseWindow.BeginHorizontal();
         attributes[pos].name = XBaseWindow.CreateStringField( attributes[pos].name );
         XBaseWindow.DoButton<XCodeParameter>( "Parameter", ParameterCreate, attributes[pos].parameter);
         XBaseWindow.DoButton( "Delete", () => attributes.RemoveAt( pos ) );
         XBaseWindow.EndHorizontal();
     }
 }
Beispiel #11
0
//		public virtual void DrawMemberAttribute(XBaseWindow window)
//		{
//			memberAttribute = window.CreateEnumSelectable( memberAttribute ) as MemberAttributes;
//		}

        public virtual void DrawComments(XBaseWindow window)
        {
            XBaseWindow.CreateLabel("Comments");
            for (int pos = 0; pos < comments.Count; pos++)
            {
                //  TODO loop in comments.Count
                XBaseWindow.BeginHorizontal();
                comments[pos] = XBaseWindow.CreateStringField(comments[pos]);
                XBaseWindow.DoButton("Delete", () => comments.RemoveAt(pos));
                XBaseWindow.EndHorizontal();
            }
        }
Beispiel #12
0
 public virtual void DrawCustomeAttribute(XBaseWindow window)
 {
     XBaseWindow.CreateLabel("CustomAttributes");
     for (int pos = 0; pos < attributes.Count; pos++)
     {
         //  TODO loop in comments.Count
         XBaseWindow.BeginHorizontal();
         attributes[pos].name = XBaseWindow.CreateStringField(attributes[pos].name);
         XBaseWindow.DoButton <XCodeParameter>("Parameter", ParameterCreate, attributes[pos].parameter);
         XBaseWindow.DoButton("Delete", () => attributes.RemoveAt(pos));
         XBaseWindow.EndHorizontal();
     }
 }
Beispiel #13
0
        void DrawParameters(XBaseWindow window)
        {
            window.CreateLabel("Parameters");
            for (int pos = 0; pos < parameters.Count; pos++)
            {
                //  TODO loop in comments.Count
                window.BeginHorizontal();
//				parameters[pos].type = window.CreateStringField( parameters[pos].type );
                parameters[pos].Draw(window);
                window.DoButton("Delete", () => parameters.RemoveAt(pos));
                window.EndHorizontal();
            }
        }
Beispiel #14
0
        public override void OnInspectorGUI()
        {
            XBaseEditor.DrawLogo();
            base.OnInspectorGUI();
            XMonoBehaviourEditor.ShowXAttributeMember(target);

            var networkBehaviour = target as NetworkBehaviour;

            XBaseWindow.CreateCheckBox("isServer", networkBehaviour.isServer);
            XBaseWindow.CreateCheckBox("isClient", networkBehaviour.isClient);
            XBaseWindow.CreateCheckBox("isLocalPlayer", networkBehaviour.isLocalPlayer);
            XBaseWindow.CreateIntField("netId", (int)networkBehaviour.netId.Value);
            XBaseWindow.CreateIntField("playerControllerId", (int)networkBehaviour.playerControllerId);
        }
        public override void DrawSelf(XBaseWindow window)
        {
            XBaseWindow.BeginHorizontal();
            XBaseWindow.DoButton( name, () => isShowAll = !isShowAll );
            if( isShowAll ) {
                name = XBaseWindow.CreateStringField(name);
            //				window.CreateEnumSelectable( codeType );
            //				TypeID = window.CreateSelectableString(TypeID, StrTypes );
                DrawType(window);
                XBaseWindow.DoButton("Add Attribute", ()=> attributes.Add(new XCodeCustomAttribute()));
                XBaseWindow.DoButton("Add Comment", ()=> comments.Add("TODO LIST"));
            }
            XBaseWindow.EndHorizontal();

            if(isShowAll)
                DrawComments(window);
        }
Beispiel #16
0
        public override void DrawSelf(XBaseWindow window)
        {
            window.BeginHorizontal();
            window.DoButton(name, () => isShowAll = !isShowAll);
            if (isShowAll)
            {
                name = window.CreateStringField(name);
//				window.CreateEnumSelectable( codeType );
//				TypeID = window.CreateSelectableString(TypeID, StrTypes );
                DrawType(window);
                window.DoButton("Add Attribute", () => attributes.Add(new XCodeCustomAttribute()));
                window.DoButton("Add Comment", () => comments.Add("TODO LIST"));
            }
            window.EndHorizontal();

            if (isShowAll)
            {
                DrawComments(window);
            }
        }
Beispiel #17
0
 public override void OnInspectorGUI()
 {
     if (isVisible)
     {
         XBaseEditor.DrawLogo();
         base.OnInspectorGUI();
         material.renderQueue = XBaseWindow.CreateIntField("renderQueue", material.renderQueue);
         toggleKeywords       = XBaseWindow.CreateCheckBox("shaderKeywords : " + material.shaderKeywords.Length, toggleKeywords);
         if (toggleKeywords)
         {
             for (int i = 0; i < material.shaderKeywords.Length; i++)
             {
                 material.shaderKeywords [i] = XBaseWindow.CreateStringField(material.shaderKeywords [i]);
             }
         }
         if (material.HasProperty("_Color"))
         {
             material.color = XBaseWindow.CreateColorField("_Color", material.color);
         }
     }
 }
        public override void DrawSelf(XBaseWindow window)
        {
            XBaseWindow.DoButton( name, () => isShowAll = !isShowAll );
            if( isShowAll ) {
                XBaseWindow.BeginHorizontal();
                name = XBaseWindow.CreateStringField(name);
                XBaseWindow.EndHorizontal();

                XBaseWindow.BeginHorizontal();
                DrawType(window);
                XBaseWindow.DoButton("Add Parameter", ()=> parameters.Add(new XCodeParameter()));
                XBaseWindow.DoButton("Add Attribute", ()=> attributes.Add(new XCodeCustomAttribute()));
                XBaseWindow.DoButton("Add Comment", ()=> comments.Add("TODO LIST"));
                XBaseWindow.EndHorizontal();
            }

            if(isShowAll){
                DrawComments(window);
                DrawCustomeAttribute(window);
                DrawParameters(window);
            }
        }
Beispiel #19
0
 public void Draw(XBaseWindow window)
 {
     window.DoButton("Type", () => {
         XCodeTypeTemplate.SelectType(x => type = x);
     });
 }
Beispiel #20
0
 public static XFsmWindow GetInstance()
 {
     return(XBaseWindow.InitWindow <XFsmWindow>());
 }
Beispiel #21
0
 static void Init()
 {
     XBaseWindow.InitWindow <XFsmWindow>();
 }
Beispiel #22
0
 public virtual void DrawSelf(XBaseWindow window)
 {
 }
 static void Init()
 {
     XBaseWindow.InitWindow <XmlExtensionWindow>();
 }
 public override void DrawSelf(XBaseWindow window)
 {
     if(isShowAll)
         DrawComments(window);
 }
 void DrawParameters(XBaseWindow window)
 {
     XBaseWindow.CreateLabel( "Parameters" );
     for( int pos = 0; pos < parameters.Count; pos++ ) {
         //  TODO loop in comments.Count
         XBaseWindow.BeginHorizontal();
     //				parameters[pos].type = window.CreateStringField( parameters[pos].type );
         parameters[pos].Draw( window );
         XBaseWindow.DoButton( "Delete", () => parameters.RemoveAt( pos ) );
         XBaseWindow.EndHorizontal();
     }
 }
 public void Draw(XBaseWindow window)
 {
     classUnit.DrawSelf(window);
 }
Beispiel #27
0
 public void Draw(XBaseWindow window)
 {
     classUnit.DrawSelf(window);
 }
Beispiel #28
0
        private void OpenInMethod(object target)
        {
            XReflectionWindow method = XBaseWindow.InitWindow <XReflectionWindow>();

            method.Target = target;
        }
 public virtual void DrawSelf(XBaseWindow window)
 {
 }
 static void Init()
 {
     XBaseWindow.InitWindow <XBehaviorEditor>();
 }
        public void DrawSelf(XBaseWindow window)
        {
            name = XBaseWindow.CreateStringField("ClassName", name);

            XBaseWindow.DoButton("Add New NameSpace", ()=> importNamespace.Add("UnityEngine"));
            for( int pos = 0; pos < importNamespace.Count; pos++ ) {
                //  TODO loop in importNamespace.Count
                XBaseWindow.BeginHorizontal();
                importNamespace[pos] = XBaseWindow.CreateStringField(importNamespace[pos]);
                XBaseWindow.DoButton("Delete", ()=> importNamespace.RemoveAt(pos));
                XBaseWindow.EndHorizontal();
            }

            XBaseWindow.DoButton("Add New BaseClass", ()=> baseClass.Add("Object"));
            for( int pos = 0; pos < baseClass.Count; pos++ ) {
                //  TODO loop in importNamespace.Count
                XBaseWindow.BeginHorizontal();
                baseClass[pos] = XBaseWindow.CreateStringField(baseClass[pos]);
                XBaseWindow.DoButton("Delete", ()=> baseClass.RemoveAt(pos));
                XBaseWindow.EndHorizontal();
            }

            XBaseWindow.BeginHorizontal();
            XBaseWindow.DoButton("Add Method", ()=> methods.Add(new XCodeMethod()));
            XBaseWindow.DoButton("Add Field", ()=> fields.Add(new XCodeField()));
            XBaseWindow.DoButton("Add Property", ()=> properties.Add(new XCodeProperty()));
            XBaseWindow.EndHorizontal();

            for( int pos = 0; pos < methods.Count; pos++ ) {
                //  TODO loop in classChildren.Count
                methods[pos].DrawSelf(window);
                XBaseWindow.DoButton("Delete", ()=> methods.RemoveAt(pos));

            }
            for( int pos = 0; pos < fields.Count; pos++ ) {
                //  TODO loop in classChildren.Count
                fields[pos].DrawSelf(window);
                XBaseWindow.DoButton("Delete", ()=> fields.RemoveAt(pos));

            }
            for( int pos = 0; pos < properties.Count; pos++ ) {
                //  TODO loop in classChildren.Count
                properties[pos].DrawSelf(window);
                XBaseWindow.DoButton("Delete", ()=> properties.RemoveAt(pos));

            }

            XBaseWindow.DoButton("Review Content", () =>
            {
                reviewContent = ReviewContent();
            });

            reviewContent = EditorGUILayout.TextArea(reviewContent);
        }