Skip to content

Commit

Permalink
Merge pull request #49 from Rootjhon/master
Browse files Browse the repository at this point in the history
Update ignore
  • Loading branch information
pnarimani authored Sep 7, 2020
2 parents 2d309ad + 53a5ad8 commit f20c8a2
Show file tree
Hide file tree
Showing 6 changed files with 83 additions and 151 deletions.
48 changes: 33 additions & 15 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,21 +1,31 @@
[Ll]ibrary/
# This .gitignore file should be placed at the root of your Unity project directory
#
# Get latest from https://github.com/github/gitignore/blob/master/Unity.gitignore
#
/[Ll]ibrary/
[Tt]emp/
[Oo]bj/
[Bb]uild/
[Bb]uilds/
Assets/AssetStoreTools*
/[Tt]emp/
/[Oo]bj/
/[Bb]uild/
/[Bb]uilds/
/[Ll]ogs/
/[Mm]emoryCaptures/

# Ignore Folders' meta file
*.meta
!*.*.meta
# Never ignore Asset meta data
!/[Aa]ssets/**/*.meta

# Visual Studio 2015 cache directory
**/.vs/**
**/.idea/**
# Uncomment this line if you wish to ignore the asset store tools plugin
# /[Aa]ssets/AssetStoreTools*

# Rider Plugin
**/Assets/Plugins/Editor/JetBrains*/**
# Autogenerated Jetbrains Rider plugin
[Aa]ssets/Plugins/Editor/JetBrains*

# Visual Studio cache directory
.vs/
# Visual Code cache directory
.vscode/

# Gradle cache directory
.gradle/

# Autogenerated VS/MD/Consulo solution and project files
ExportedObj/
Expand All @@ -31,13 +41,21 @@ ExportedObj/
*.booproj
*.svd
*.pdb
*.mdb
*.opendb
*.VC.db

# Unity3D generated meta files
*.pidb.meta
*.pdb.meta
*.mdb.meta

# Unity3D Generated File On Crash Reports
# Unity3D generated file on crash reports
sysinfo.txt

# Builds
*.apk
*.unitypackage

# Crashlytics generated file
crashlytics-build.properties
56 changes: 0 additions & 56 deletions .vscode/settings.json

This file was deleted.

40 changes: 38 additions & 2 deletions Assets/RTLTMPro/Scripts/Editor/ContextMenu.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
using TMPro;
using UnityEditor;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;
using UnityEditor.Presets;
using UnityEngine.EventSystems;
using UnityEditor.SceneManagement;

namespace RTLTMPro
{
Expand Down Expand Up @@ -101,6 +103,40 @@ private static void CreateTextMeshProGuiObjectPerform(MenuCommand command)
Selection.activeGameObject = go;
}

[MenuItem("GameObject/3D Object/Text - RTLTMP", false, 31)]
private static void CreateTextMeshProObjectPerform(MenuCommand command)
{
GameObject go = ObjectFactory.CreateGameObject("Text - RTLTMP");

// Add support for new prefab mode
StageUtility.PlaceGameObjectInCurrentStage(go);

var textComponent = ObjectFactory.AddComponent<RTLTextMeshPro3D>(go);

if (TMP_Settings.autoSizeTextContainer)
{
Vector2 size = textComponent.GetPreferredValues(TMP_Math.FLOAT_MAX, TMP_Math.FLOAT_MAX);
textComponent.rectTransform.sizeDelta = size;
}
else
{
textComponent.rectTransform.sizeDelta = TMP_Settings.defaultTextMeshProTextContainerSize;
}

textComponent.text = "Sample text";
textComponent.alignment = TextAlignmentOptions.TopLeft;

Undo.RegisterCreatedObjectUndo(go, "Create " + go.name);

GameObject contextObject = command.context as GameObject;
if (contextObject != null)
{
GameObjectUtility.SetParentAndAlign(go, contextObject);
Undo.SetTransformParent(go.transform, contextObject.transform, "Parent " + go.name);
}

Selection.activeGameObject = go;
}

[MenuItem("GameObject/UI/Input Field - RTLTMP", false, 2037)]
private static void AddTextMeshProInputField(MenuCommand menuCommand)
Expand Down Expand Up @@ -147,7 +183,7 @@ public static void CreateButton(MenuCommand command)
textMeshPro.fontSizeMax = 100;
textMeshPro.alignment = TextAlignmentOptions.Center;
textMeshPro.color = new Color(0.1254902F, 0.1254902F, 0.1254902F);
textMeshPro.margin = new Vector4(0,3.5f,0,4.5f);
textMeshPro.margin = new Vector4(0, 3.5f, 0, 4.5f);

Undo.RegisterCreatedObjectUndo(buttonGo, "Created Button");
Selection.activeGameObject = buttonGo;
Expand Down
16 changes: 12 additions & 4 deletions Assets/RTLTMPro/Scripts/Editor/RTLTextMeshProEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@
using UnityEditor;
using UnityEngine;


#if !TMP_Version_2_1_1
using TMP_UiEditorPanel = TMPro.EditorUtilities.TMP_UiEditorPanel;
#else
using TMP_UiEditorPanel = TMPro.EditorUtilities.TMP_EditorPanelUI;
#endif


namespace RTLTMPro
{
[CustomEditor(typeof(RTLTextMeshPro)), CanEditMultipleObjects]
Expand Down Expand Up @@ -30,8 +38,8 @@ public class RTLTextMeshProEditor : TMP_UiEditorPanel
public override void OnInspectorGUI()
{
serializedObject.Update();
tmpro = (RTLTextMeshPro) target;
tmpro = (RTLTextMeshPro)target;

EditorGUILayout.Space();
EditorGUI.BeginChangeCheck();
EditorGUILayout.PropertyField(originalTextProp, new GUIContent("RTL Text Input Box"));
Expand Down Expand Up @@ -88,7 +96,7 @@ protected virtual void DrawOptions()

protected virtual void ListenForZeroWidthNoJoiner()
{
var editor = (TextEditor) GUIUtility.GetStateObject(typeof(TextEditor), GUIUtility.keyboardControl);
var editor = (TextEditor)GUIUtility.GetStateObject(typeof(TextEditor), GUIUtility.keyboardControl);

bool shortcutPressed = (Event.current.modifiers & EventModifiers.Control) != 0 &&
(Event.current.modifiers & EventModifiers.Shift) != 0 &&
Expand All @@ -97,7 +105,7 @@ protected virtual void ListenForZeroWidthNoJoiner()

if (!shortcutPressed) return;

originalTextProp.stringValue = originalTextProp.stringValue.Insert(editor.cursorIndex, ((char) GeneralLetters.ZeroWidthNoJoiner).ToString());
originalTextProp.stringValue = originalTextProp.stringValue.Insert(editor.cursorIndex, ((char)GeneralLetters.ZeroWidthNoJoiner).ToString());
editor.selectIndex++;
editor.cursorIndex++;
Event.current.Use();
Expand Down
72 changes: 0 additions & 72 deletions Logs/Packages-Update.log

This file was deleted.

2 changes: 0 additions & 2 deletions RTLTMPro.sln.DotSettings

This file was deleted.

0 comments on commit f20c8a2

Please sign in to comment.