Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
23 changes: 23 additions & 0 deletions .vs/CIU265Project/xs/UserPrefs.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<Properties StartupConfiguration="{304CF1B4-805E-7DC8-9CFD-4275C5630AE3}|">
<MultiItemStartupConfigurations />
<MonoDevelop.Ide.DebuggingService.Breakpoints>
<BreakpointStore />
</MonoDevelop.Ide.DebuggingService.Breakpoints>
<MonoDevelop.Ide.Workspace ActiveConfiguration="Debug" />
<MonoDevelop.Ide.Workbench ActiveDocument="Assets/ButtonClickHandler.cs">
<Files>
<File FileName="Assets/ButtonClickHandler.cs" Line="46" Column="2" />
</Files>
<Pads>
<Pad Id="ProjectPad">
<State name="__root__">
<Node name="CIU265Project">
<Node name="Assets" expanded="True" />
</Node>
</State>
</Pad>
</Pads>
</MonoDevelop.Ide.Workbench>
<MonoDevelop.Ide.DebuggingService.PinnedWatches />
<MonoDevelop.Ide.ItemProperties.Assembly-CSharp PreferredExecutionTarget="3f196bfe-f0a4-48f6-a76d-f1ae9eb4fad6" />
</Properties>

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions .vsconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"version": "1.0",
"components": [
"Microsoft.VisualStudio.Workload.ManagedGame"
]
}
769 changes: 769 additions & 0 deletions Assembly-CSharp.csproj

Large diffs are not rendered by default.

46 changes: 46 additions & 0 deletions Assets/ButtonClickHandler.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
using UnityEngine;
using UnityEngine.UIElements;

public class ButtonClickHandler : MonoBehaviour
{
private VisualElement button;
private TextField textField;
private Slider slider;

private void Start()
{
// Find the button element by name
button = GetComponent<UIDocument>().rootVisualElement.Q("maxButton");
textField = GetComponent<UIDocument>().rootVisualElement.Q<TextField>("maxTF");
slider = GetComponent<UIDocument>().rootVisualElement.Q<Slider>("maxSlider");
// Attach a click event handler
button.RegisterCallback<ClickEvent>(OnClick);
textField.RegisterCallback<InputEvent>(OnTextFieldValueChanged);
slider.RegisterCallback<ChangeEvent<float>>(OnSliderValueChanged);

}

private void OnClick(ClickEvent evt)
{
Debug.Log("Button Clicked!");
// Add your custom logic here
}

private void OnTextFieldValueChanged(InputEvent evt)
{
// Access and print the text value of the TextField
string textFieldText = textField.value;
Debug.Log("TextField Value: " + textFieldText);

// You can perform actions based on the text value here
}

private void OnSliderValueChanged(ChangeEvent<float> evt)
{
// Access and print the text value of the TextField
float val = slider.value;
Debug.Log("Slider Value: " + val);

// You can perform actions based on the text value here
}
}
11 changes: 11 additions & 0 deletions Assets/ButtonClickHandler.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading