Ejemplo n.º 1
0
 public override void Draw(GTEditorToolbar varView)
 {
     base.Draw(varView);
     if (string.IsNullOrEmpty(Text) || Width <= 0)
     {
         return;
     }
     GUILayout.Space(MarginLeft);
     EditorGUILayout.LabelField(Text, GUILayout.Width(Width));
 }
Ejemplo n.º 2
0
 public override void Draw(GTEditorToolbar varView)
 {
     base.Draw(varView);
     GUILayout.Space(MarginLeft);
     if (string.IsNullOrEmpty(Text) == false && TextStrWidth > 0)
     {
         EditorGUILayout.LabelField(Text, GUILayout.Width(TextStrWidth));
     }
     if (Width <= 0)
     {
         return;
     }
     LastObj = CurrentObj;
     if (Height > 0)
     {
         if (ReadOnly)
         {
             EditorGUILayout.ObjectField(DefaultObj, typeof(T), GUILayout.Width(Width), GUILayout.Height(Height));
             NotifyListener(DefaultObj); return;
         }
         CurrentObj = EditorGUILayout.ObjectField(CurrentObj, typeof(T), GUILayout.Width(Width), GUILayout.Height(Height));
         if (LastObj != CurrentObj)
         {
             NotifyListener(CurrentObj);
         }
     }
     else
     {
         if (ReadOnly)
         {
             EditorGUILayout.ObjectField(DefaultObj, typeof(T), GUILayout.Width(Width));
             NotifyListener(DefaultObj); return;
         }
         CurrentObj = EditorGUILayout.ObjectField(CurrentObj, typeof(T), GUILayout.Width(Width));
         if (LastObj != CurrentObj)
         {
             NotifyListener(CurrentObj);
         }
     }
 }
Ejemplo n.º 3
0
 public override void Draw(GTEditorToolbar varView)
 {
     base.Draw(varView);
     GUILayout.Space(MarginLeft);
     if (string.IsNullOrEmpty(Text) || Width <= 0)
     {
         return;
     }
     if (Height > 0)
     {
         if (GUILayout.Button(new GUIContent(Text, Tips), GUILayout.Width(Width), GUILayout.Height(Height)))
         {
             NotifyListener();
         }
     }
     else
     {
         if (GUILayout.Button(new GUIContent(Text, Tips), GUILayout.Width(Width)))
         {
             NotifyListener();
         }
     }
 }
Ejemplo n.º 4
0
        public override void Draw(GTEditorToolbar varView)
        {
            base.Draw(varView);
            GUILayout.Space(MarginLeft);
            if (Width <= 0)
            {
                return;
            }
            FieldShowType = (ShowType)EditorGUILayout.EnumPopup(FieldShowType, GUILayout.Width(100));
            LastFilePath  = CurrentFilePath;
            switch (FieldShowType)
            {
            case ShowType.CurrentEdit:
                //if (string.IsNullOrEmpty(CompareFilePath) == false)
                //{
                //    CurrentAsset = AssetDatabase.LoadAssetAtPath(CompareFilePath, typeof(TextAsset)) as TextAsset;
                //}
                EditorGUILayout.ObjectField(CurrentAsset, typeof(TextAsset), false, GUILayout.Width(200));
                //if (CurrentAsset != null)
                //{
                //    CurrentFilePath = AssetDatabase.GetAssetPath(CurrentAsset.GetInstanceID());
                //    if (LastFilePath != CurrentFilePath)
                //    {
                //        NotifyListener(CurrentFilePath);
                //    }
                //}
                break;

            case ShowType.FileNamePop:
                ShowFileNamePop();
                break;

            default:
                break;
            }
        }
Ejemplo n.º 5
0
 public virtual void Draw(GTEditorToolbar varView)
 {
 }