//Custom inspector
        public override void OnInspectorGUI()
        {
            serializedObject.Update();

            //EditorGUILayout.BeginHorizontal();
            //Logo
            GUIStyle logoGUIStyle = new GUIStyle();

            logoGUIStyle.border = new RectOffset(0, 0, 0, 0);
            //GUILayout.Box(EditorLogo, GUILayout.Height(64), GUILayout.ExpandWidth(true));
            EditorGUILayout.LabelField(new GUIContent(EditorLogo), GUILayout.MinHeight(64.0f), GUILayout.ExpandWidth(true));

            Color GUIBlue = new Color32(192, 219, 255, 255);

            //Title/Version

            /*
             * GUILayout.Label("Bullet For Unity: " + version, versionStyle);
             * EditorGUILayout.Space();
             */
            //EditorGUILayout.EndHorizontal();
            MonoBehaviour mb = (MonoBehaviour)target;

            if (mb.transform.localScale != Vector3.one)
            {
                EditorGUILayout.HelpBox("Transform Scale must be 1,1,1. Use the Mesh Settings to scale the object.", MessageType.Error);
            }
            EditorGUILayout.BeginHorizontal();
            if (InspectorButton("Build Mesh", 100, 40, GUIBlue, "Update mesh and Bullet Collision shape settings\n\n"))
            {
                primitiveTarget.BuildMesh(); //build mesh and resize
            }
            EditorGUILayout.EndHorizontal();
            EditorGUILayout.PropertyField(meshSettings, gcSize, true);

            serializedObject.ApplyModifiedProperties();



            if (GUI.changed)
            {
                primitiveTarget.BuildMesh();
            }

            //draw default view
            //DrawDefaultInspector();
        }
Пример #2
0
        //Custom inspector
        public override void OnInspectorGUI()
        {
            serializedObject.Update();

            EditorGUILayout.BeginHorizontal();
            //Logo
            GUIStyle logoGUIStyle = new GUIStyle();

            logoGUIStyle.border = new RectOffset(0, 0, 0, 0);
            GUILayout.Box(EditorLogo, logoGUIStyle);

            Color GUIBlue = new Color32(82, 140, 255, 255);

            //Color GUIGreen = new Color32(0, 160, 0, 255);

            //Title/Version
            GUILayout.Label("Bullet For Unity: " + version, versionStyle);
            EditorGUILayout.Space();
            EditorGUILayout.EndHorizontal();

            EditorGUILayout.BeginHorizontal();
            GUI.backgroundColor = GUIBlue;
            if (InspectorButton("BuildMesh", 100, 40, GUIBlue, "Update size or something\n\n"))
            {
                primitiveTarget.BuildMesh(); //build mesh and resize
            }
            EditorGUILayout.EndHorizontal();
            EditorGUILayout.PropertyField(meshSettings, gcSize, true);

            serializedObject.ApplyModifiedProperties();



            if (GUI.changed)
            {
                primitiveTarget.BuildMesh();
            }

            //draw default view
            //DrawDefaultInspector();
        }