Skip to content

Commit

Permalink
install ButtonPressNameChooser
Browse files Browse the repository at this point in the history
  • Loading branch information
aranlunzer committed Jul 15, 2023
1 parent 6c67d39 commit 61bc978
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 21 deletions.
File renamed without changes.

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

Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;


public class SessionNameChooser : MonoBehaviour
public class ButtonPressNameChooser : SessionNameChooser
{
// public reference to the text to update
public TMPro.TMP_Text sessionNameText;
Expand All @@ -23,7 +24,7 @@ private static int SessionNameValue
PlayerPrefs.Save();
}
}

private static string SessionIP
{
get {
Expand All @@ -49,7 +50,6 @@ private static string SessionIP
public delegate void OnSessionIPChangeDelegate(string newIP);
public static event OnSessionIPChangeDelegate OnSessionIPChange;

// Start is called before the first frame update
void Start()
{
OnSessionNameChange += SessionNameChangeHandler;
Expand All @@ -58,19 +58,17 @@ void Start()
// recover the session name and IP from save data
SessionNameValue = PlayerPrefs.GetInt("sessionNameValue");
SessionIP = PlayerPrefs.GetString("sessionIP");


}

private void SessionNameChangeHandler(int newVal)
{
Debug.Log("Session name Change handler");
sessionNameText.text = newVal.ToString();
}

private void SessionIPChangeHandler(string newIP)
{

Debug.Log($"Session IP Change handler newIP is: {newIP}");
sessionIPText.text = newIP;
}
Expand Down

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

0 comments on commit 61bc978

Please sign in to comment.