Skip to content
This repository has been archived by the owner on Jun 12, 2023. It is now read-only.

Commit

Permalink
Merge pull request #7 from robertobrambila/dev
Browse files Browse the repository at this point in the history
v0.2.1
  • Loading branch information
robertobrambila authored Jun 13, 2020
2 parents a765baa + c909ee4 commit 1da0761
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,33 @@
[CustomEditor(typeof(FS_Annotation))]
public class FS_AnnotationEditor : Editor
{


void Awake()
{
}

public override void OnInspectorGUI()
{
base.OnInspectorGUI();
FS_Annotation annotation = (FS_Annotation)target; // store new reference
FS_Annotation annotation = (FS_Annotation)target; // store new target reference

#region Annotation Text Area
GUILayout.BeginHorizontal();

// ScrollView controls the TextArea element itself, not the content that's inside of the text area.
// The distinction is important because setting a height property to the TextArea element can leave a view
// that isn't scrollable even though the content inside does cover many more lines. Setting ExpandHeight
// allows the actual element to resize along with the content and enables the scrolling we're expecting.
annotation.scrollPos = EditorGUILayout.BeginScrollView(annotation.scrollPos, GUILayout.Height(100));
EditorStyles.textArea.wordWrap = true;
annotation.annotationTextArea = EditorGUILayout.TextArea(annotation.annotationTextArea, EditorStyles.textArea, GUILayout.ExpandHeight(true));


EditorGUILayout.EndScrollView();
GUILayout.EndHorizontal();
#endregion

#region URL Launcher
GUILayout.BeginHorizontal();

if (GUILayout.Button(new GUIContent("Go", "Launch URL"), GUILayout.MaxWidth(40)))
Expand All @@ -22,6 +43,7 @@ public override void OnInspectorGUI()
annotation.URL = EditorGUILayout.TextField(annotation.URL);

GUILayout.EndHorizontal();
#endregion

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public class FS_UnitySceneTools : EditorWindow, IHasCustomMenu

#region about context menu
string prodName = "Scene Tools";
string verNumber = "v0.2.0";
string verNumber = "v0.2.1";
string url = "https://www.futuresupervillain.com";

void IHasCustomMenu.AddItemsToMenu(GenericMenu menu)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@
namespace FS.Scripts {
public class FS_Annotation : MonoBehaviour
{
[TextArea]
public string Annotation = "";
[HideInInspector]
public string annotationTextArea = "";

[HideInInspector]
public Vector2 scrollPos;

[HideInInspector]
public string URL ="https://";
Expand Down

0 comments on commit 1da0761

Please sign in to comment.