using UnityEngine;
using UnityEditor;
[CustomEditor(typeof(ViKiPlugIn.VikiUnity))]
    public class VikiUnityEditor : Editor
    {
        Texture image;

        //  private SerializedProperty Camera;

        void OnEnable()
        {
            //Camera = serializedObject.FindProperty("Camera");

            image = (Texture)AssetDatabase.LoadAssetAtPath("Assets/ViKi/Viki_Editor_Logo.png", typeof(Texture));
        }

        public override void OnInspectorGUI()

        {


     //       EditorGUI.DrawPreviewTexture(new Rect(25, 60, 100, 100), image);



//GUILayout.Box(image, GUILayout.ExpandHeight(false));

        //GUILayout.Box(image, GUILayout.ExpandWidth(true)); //Or draw the texture
   //     GUI.Button (Rect (100,100,100,100), image, GUIStyle.none);
          GUI.DrawTexture(new Rect(0, 0, 270, 90), image);
    //GUILayout.Box(image);
        GUILayout.Space(100f); //2

        //serializedObject.Update();

          var style = new GUIStyle(GUI.skin.label);
        style.alignment = TextAnchor.MiddleCenter;
        style.fontStyle = FontStyle.Normal;

                var style2 = new GUIStyle(GUI.skin.label);
        style2.alignment = TextAnchor.MiddleCenter;
        style2.fontStyle = FontStyle.Bold;


                EditorGUILayout.LabelField("ViKi: Visual Kinematics", style2, GUILayout.ExpandWidth(true));

        GUILayout.Space(10f); //2
        EditorGUILayout.LabelField("A plugin to connect Unity3D with ViKi ", style, GUILayout.ExpandWidth(true));
        GUILayout.Space(20f); //2

 var rect = EditorGUILayout.BeginHorizontal();
        Handles.color = Color.gray;
        Handles.DrawLine(new Vector2(rect.x - 15, rect.y), new Vector2(rect.width + 15, rect.y));
        EditorGUILayout.EndHorizontal();

     GUILayout.Space(20f); //2

                 EditorGUI.indentLevel++;
            EditorGUI.indentLevel--;

                            base.OnInspectorGUI();

        }
    }
