inputfield

This commit is contained in:
Janis M
2021-12-21 14:29:03 +01:00
parent 3350cf5c41
commit 559b9d9f38
4 changed files with 110 additions and 75 deletions

View File

@@ -1,18 +1,53 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.EventSystems;
using TMPro;
public class HomeSceneInputField : MonoBehaviour
public class HomeSceneInputField : MonoBehaviour, IPointerClickHandler
{
// Start is called before the first frame update
GameObject marker;
GameObject focusText;
GameObject helpText;
GameObject underline;
bool isFocused = false;
bool transitionDone = false;
void Start()
{
marker = gameObject.transform.Find("Marker").gameObject;
focusText = gameObject.transform.Find("FocusText").gameObject;
helpText = gameObject.transform.Find("HelpText").gameObject;
underline = gameObject.transform.Find("Underline").gameObject;
}
// Update is called once per frame
void Update()
{
if (!gameObject.GetComponent<TMP_InputField>().isFocused)
{
isFocused = false;
}
if (isFocused)
{
marker.SetActive(true);
focusText.SetActive(true);
helpText.SetActive(true);
}
else
{
marker.SetActive(false);
focusText.SetActive(false);
helpText.SetActive(false);
}
}
public void OnPointerClick(PointerEventData eventData)
{
isFocused = true;
}
}

View File

@@ -2,13 +2,13 @@
"dependencies": {
"com.hwaet.projectcloner": "https://github.com/hwaet/UnityProjectCloner.git",
"com.unity.animation.rigging": "1.1.1",
"com.unity.collab-proxy": "1.15.4",
"com.unity.collab-proxy": "1.15.7",
"com.unity.ide.rider": "3.0.7",
"com.unity.ide.visualstudio": "2.0.12",
"com.unity.ide.vscode": "1.2.4",
"com.unity.postprocessing": "3.2.0",
"com.unity.render-pipelines.universal": "12.1.2",
"com.unity.test-framework": "1.1.29",
"com.unity.test-framework": "1.1.30",
"com.unity.textmeshpro": "3.0.6",
"com.unity.timeline": "1.6.3",
"com.unity.toolchain.win-x86_64-linux-x86_64": "0.1.21-preview",

View File

@@ -27,7 +27,7 @@
"url": "https://packages.unity.com"
},
"com.unity.collab-proxy": {
"version": "1.15.4",
"version": "1.15.7",
"depth": 0,
"source": "registry",
"dependencies": {
@@ -154,7 +154,7 @@
"url": "https://packages.unity.com"
},
"com.unity.test-framework": {
"version": "1.1.29",
"version": "1.1.30",
"depth": 0,
"source": "registry",
"dependencies": {

View File

@@ -19,7 +19,7 @@ MonoBehaviour:
width: 1536
height: 772.8
m_ShowMode: 4
m_Title: Hierarchy
m_Title: Project
m_RootView: {fileID: 2}
m_MinSize: {x: 875, y: 300}
m_MaxSize: {x: 10000, y: 10000}
@@ -45,7 +45,7 @@ MonoBehaviour:
x: 0
y: 0
width: 1536
height: 773
height: 772.8
m_MinSize: {x: 875, y: 300}
m_MaxSize: {x: 10000, y: 10000}
m_UseTopView: 1
@@ -90,7 +90,7 @@ MonoBehaviour:
m_Position:
serializedVersion: 2
x: 0
y: 753
y: 752.8
width: 1536
height: 20
m_MinSize: {x: 0, y: 0}
@@ -115,11 +115,11 @@ MonoBehaviour:
x: 0
y: 30
width: 1536
height: 723
height: 722.8
m_MinSize: {x: 300, y: 200}
m_MaxSize: {x: 24288, y: 16192}
vertical: 0
controlID: 88
controlID: 61
--- !u!114 &6
MonoBehaviour:
m_ObjectHideFlags: 52
@@ -139,12 +139,12 @@ MonoBehaviour:
serializedVersion: 2
x: 0
y: 0
width: 1259
height: 723
width: 1184
height: 722.8
m_MinSize: {x: 200, y: 200}
m_MaxSize: {x: 16192, y: 16192}
vertical: 1
controlID: 89
controlID: 62
--- !u!114 &7
MonoBehaviour:
m_ObjectHideFlags: 52
@@ -164,12 +164,12 @@ MonoBehaviour:
serializedVersion: 2
x: 0
y: 0
width: 1259
height: 482
width: 1184
height: 435.2
m_MinSize: {x: 200, y: 100}
m_MaxSize: {x: 16192, y: 8096}
vertical: 0
controlID: 90
controlID: 53
--- !u!114 &8
MonoBehaviour:
m_ObjectHideFlags: 52
@@ -187,8 +187,8 @@ MonoBehaviour:
serializedVersion: 2
x: 0
y: 0
width: 291
height: 482
width: 274.4
height: 435.2
m_MinSize: {x: 201, y: 221}
m_MaxSize: {x: 4001, y: 4021}
m_ActualView: {fileID: 13}
@@ -206,23 +206,23 @@ MonoBehaviour:
m_Enabled: 1
m_EditorHideFlags: 1
m_Script: {fileID: 12006, guid: 0000000000000000e000000000000000, type: 0}
m_Name: SceneView
m_Name: GameView
m_EditorClassIdentifier:
m_Children: []
m_Position:
serializedVersion: 2
x: 291
x: 274.4
y: 0
width: 968
height: 482
width: 909.6
height: 435.2
m_MinSize: {x: 202, y: 221}
m_MaxSize: {x: 4002, y: 4021}
m_ActualView: {fileID: 14}
m_ActualView: {fileID: 12}
m_Panes:
- {fileID: 14}
- {fileID: 12}
m_Selected: 0
m_LastSelected: 1
m_Selected: 1
m_LastSelected: 0
--- !u!114 &10
MonoBehaviour:
m_ObjectHideFlags: 52
@@ -239,9 +239,9 @@ MonoBehaviour:
m_Position:
serializedVersion: 2
x: 0
y: 482
width: 1259
height: 241
y: 435.2
width: 1184
height: 287.59998
m_MinSize: {x: 231, y: 271}
m_MaxSize: {x: 10001, y: 10021}
m_ActualView: {fileID: 15}
@@ -265,10 +265,10 @@ MonoBehaviour:
m_Children: []
m_Position:
serializedVersion: 2
x: 1259
x: 1184
y: 0
width: 277
height: 723
width: 352
height: 722.8
m_MinSize: {x: 276, y: 71}
m_MaxSize: {x: 4001, y: 4021}
m_ActualView: {fileID: 17}
@@ -296,10 +296,10 @@ MonoBehaviour:
m_Tooltip:
m_Pos:
serializedVersion: 2
x: 291.2
x: 274.4
y: 73.6
width: 966
height: 461
width: 907.6
height: 414.2
m_ViewDataDictionary: {fileID: 0}
m_OverlayCanvas:
m_LastAppliedPresetName: Default
@@ -310,7 +310,7 @@ MonoBehaviour:
m_ShowGizmos: 0
m_TargetDisplay: 0
m_ClearColor: {r: 0, g: 0, b: 0, a: 0}
m_TargetSize: {x: 782, y: 440}
m_TargetSize: {x: 699, y: 393.2}
m_TextureFilterMode: 0
m_TextureHideFlags: 61
m_RenderIMGUI: 1
@@ -325,10 +325,10 @@ MonoBehaviour:
m_VRangeLocked: 0
hZoomLockedByDefault: 0
vZoomLockedByDefault: 0
m_HBaseRangeMin: -312.80002
m_HBaseRangeMax: 312.80002
m_VBaseRangeMin: -176
m_VBaseRangeMax: 176
m_HBaseRangeMin: -279.6
m_HBaseRangeMax: 279.6
m_VBaseRangeMin: -157.28001
m_VBaseRangeMax: 157.28001
m_HAllowExceedBaseRangeMin: 1
m_HAllowExceedBaseRangeMax: 1
m_VAllowExceedBaseRangeMin: 1
@@ -346,23 +346,23 @@ MonoBehaviour:
serializedVersion: 2
x: 0
y: 21
width: 966
height: 440
width: 907.6
height: 393.2
m_Scale: {x: 1, y: 1}
m_Translation: {x: 483, y: 220}
m_Translation: {x: 453.8, y: 196.6}
m_MarginLeft: 0
m_MarginRight: 0
m_MarginTop: 0
m_MarginBottom: 0
m_LastShownAreaInsideMargins:
serializedVersion: 2
x: -483
y: -220
width: 966
height: 440
x: -453.8
y: -196.6
width: 907.6
height: 393.2
m_MinimalGUI: 1
m_defaultScale: 1
m_LastWindowPixelSize: {x: 1207.5, y: 576.25}
m_LastWindowPixelSize: {x: 1134.5, y: 517.75}
m_ClearInEditMode: 1
m_NoCameraWarning: 1
m_LowResolutionForAspectRatios: 01000000000000000000
@@ -390,8 +390,8 @@ MonoBehaviour:
serializedVersion: 2
x: 0
y: 73.6
width: 290
height: 461
width: 273.4
height: 414.2
m_ViewDataDictionary: {fileID: 0}
m_OverlayCanvas:
m_LastAppliedPresetName: Default
@@ -399,9 +399,9 @@ MonoBehaviour:
m_SceneHierarchy:
m_TreeViewState:
scrollPos: {x: 0, y: 0}
m_SelectedIDs:
m_SelectedIDs: c2910000
m_LastClickedID: 0
m_ExpandedIDs: 60cefffface1ffff64e2ffffcce2fffffce3ffffe4e5ffff6eecffff24edffff26f0ffff6cf1ffff54f3ffffa2faffffc09600003e970000
m_ExpandedIDs: 52efffffbcf8ffffb86c0000046d0000386d0000
m_RenameOverlay:
m_UserAcceptedRename: 0
m_Name:
@@ -445,10 +445,10 @@ MonoBehaviour:
m_Tooltip:
m_Pos:
serializedVersion: 2
x: 291.2
x: 274.4
y: 73.6
width: 966
height: 461
width: 907.6
height: 414.2
m_ViewDataDictionary: {fileID: 0}
m_OverlayCanvas:
m_LastAppliedPresetName: Default
@@ -661,9 +661,9 @@ MonoBehaviour:
m_PlayAudio: 0
m_AudioPlay: 0
m_Position:
m_Target: {x: 348.675, y: 199.9411, z: 1.4964427}
m_Target: {x: 322.66614, y: 196.61949, z: 4.1941257}
speed: 2
m_Value: {x: 348.675, y: 199.9411, z: 1.4964427}
m_Value: {x: 322.66614, y: 196.61949, z: 4.1941257}
m_RenderMode: 0
m_CameraMode:
drawMode: 0
@@ -712,11 +712,11 @@ MonoBehaviour:
m_Rotation:
m_Target: {x: 0, y: 0, z: 0, w: 1}
speed: 2
m_Value: {x: -0, y: 0, z: -0, w: -1}
m_Value: {x: 0, y: 0, z: 0, w: 1}
m_Size:
m_Target: 300.39212
m_Target: 136.21487
speed: 2
m_Value: 300.39212
m_Value: 136.21487
m_Ortho:
m_Target: 1
speed: 2
@@ -762,9 +762,9 @@ MonoBehaviour:
m_Pos:
serializedVersion: 2
x: 0
y: 555.2
width: 1258
height: 220
y: 508.80002
width: 1183
height: 266.59998
m_ViewDataDictionary: {fileID: 0}
m_OverlayCanvas:
m_LastAppliedPresetName: Default
@@ -782,22 +782,22 @@ MonoBehaviour:
m_SkipHidden: 0
m_SearchArea: 1
m_Folders:
- Assets
- Assets/Scripts/HomeMenu
m_Globs: []
m_OriginalText:
m_ViewMode: 1
m_StartGridSize: 64
m_LastFolders:
- Assets
- Assets/Scripts/HomeMenu
m_LastFoldersGridSize: -1
m_LastProjectPath: C:\Users\Janis\Unity Projects\defrain
m_LockTracker:
m_IsLocked: 0
m_FolderTreeState:
scrollPos: {x: 0, y: 79}
m_SelectedIDs: 88730000
m_LastClickedID: 29576
m_ExpandedIDs: 00000000887300008a7300008c73000000ca9a3bffffff7f
scrollPos: {x: 0, y: 89.400024}
m_SelectedIDs: 44730000
m_LastClickedID: 29508
m_ExpandedIDs: 0000000052710000547100005671000000ca9a3bffffff7f
m_RenameOverlay:
m_UserAcceptedRename: 0
m_Name:
@@ -825,7 +825,7 @@ MonoBehaviour:
scrollPos: {x: 0, y: 0}
m_SelectedIDs:
m_LastClickedID: 0
m_ExpandedIDs: 00000000887300008a7300008c730000
m_ExpandedIDs: 00000000527100005471000056710000
m_RenameOverlay:
m_UserAcceptedRename: 0
m_Name:
@@ -929,10 +929,10 @@ MonoBehaviour:
m_Tooltip:
m_Pos:
serializedVersion: 2
x: 1259.2001
x: 1184
y: 73.6
width: 276
height: 702
width: 351
height: 701.8
m_ViewDataDictionary: {fileID: 0}
m_OverlayCanvas:
m_LastAppliedPresetName: Default