Skip to content
Snippets Groups Projects
Commit bc0b18ac authored by Heine, Eric R's avatar Heine, Eric R
Browse files

Made the Scriptable Variable UI use TextMeshPro input fields and text labels.

parent 6c6b2ed2
No related branches found
No related tags found
No related merge requests found
using System;
using UnityEngine;
using UnityEngine.UI;
using TMPro;
namespace Shared.SEUI {
// Base class for read only UI for a ScriptableVariable
public abstract class ScriptableVariableLabel<T> : MonoBehaviour {
[Tooltip("The optional Text where we are putting the variable's name")]
public Text nameLabel;
public TMP_Text nameLabel;
[Tooltip("The optional Text where we are putting the variable's value")]
public Text valueLabel;
public TMP_Text valueLabel;
[Tooltip("The C# String.Format() string for displaying the value")]
public string format;
......
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.UI;
using TMPro;
using Shared.ScriptableVariables;
namespace Shared.SEUI {
......@@ -11,12 +11,12 @@ namespace Shared.SEUI {
public StringVariable variable;
[Tooltip("The input UI to edit the variable's value with")]
public InputField input;
public TMP_InputField input;
//---------------------------------------------------------------------------
void Start() {
// Make sure the input handles the right content type
input.contentType = InputField.ContentType.Standard;
input.contentType = TMP_InputField.ContentType.Standard;
}
//---------------------------------------------------------------------------
......
{
"name": "Shared.SEUI",
"references": [
"GUID:6735fe1fe1dbd994a96eb9d888b81400"
"GUID:6735fe1fe1dbd994a96eb9d888b81400",
"Unity.TextMeshPro"
],
"optionalUnityReferences": [],
"optionalUnityReferences": [ "TestAssemblies" ],
"includePlatforms": [],
"excludePlatforms": [],
"allowUnsafeCode": false,
......
......@@ -2,8 +2,8 @@
"name": "com.futuretech.shared",
"displayName": "FutureTech Shared",
"description": "Contains shared items such as the Scriptable Variables.",
"version": "0.1.18",
"unity": "2018.3",
"version": "0.1.19",
"unity": "2019.1",
"license": "MIT",
"repository": {
"type": "git",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment