forked from lukas-walker/4d-holographic-tutorials
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStepNameHandler.cs
More file actions
52 lines (46 loc) · 1.34 KB
/
StepNameHandler.cs
File metadata and controls
52 lines (46 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using TMPro;
namespace Tutorials
{
public class StepNameHandler : MonoBehaviour
{
[SerializeField]
private GameObject sceneNameEditor;
[SerializeField]
private Recorder recorder;
[SerializeField]
public TMP_InputField stepNameInputField;
// Start is called before the first frame update
void Start()
{
sceneNameEditor.SetActive(false);
}
// Update is called once per frame
void Update()
{
}
/// <summary>
/// Edit the name of the scene and update the related UI components
/// </summary>
public void EditSceneName()
{
if (sceneNameEditor.activeSelf)
{
stepNameInputField.text = stepNameInputField.text.Trim();
if (stepNameInputField.text != string.Empty)
{
// Save the name to the animation file instance
recorder.NameCurrentAnimation(stepNameInputField.text);
stepNameInputField.text = "";
}
sceneNameEditor.SetActive(false);
}
else
{
sceneNameEditor.SetActive(true);
}
}
}
}