Skip to content
Snippets Groups Projects
Commit a6515aa1 authored by gawen.ackerman's avatar gawen.ackerman :robot:
Browse files

ADD : Seed UI and use of it

parent 7c034f6f
Branches
No related tags found
No related merge requests found
This diff is collapsed.
...@@ -109,7 +109,7 @@ MonoBehaviour: ...@@ -109,7 +109,7 @@ MonoBehaviour:
m_FadeDuration: 0.1 m_FadeDuration: 0.1
m_SpriteState: m_SpriteState:
m_HighlightedSprite: {fileID: 0} m_HighlightedSprite: {fileID: 0}
m_PressedSprite: {fileID: 21300000, guid: 1ac7db6d45a68c448b53d5590f636f78, type: 3} m_PressedSprite: {fileID: 21300000, guid: 75c6f3e763d50b241b269b59673f749c, type: 3}
m_SelectedSprite: {fileID: 0} m_SelectedSprite: {fileID: 0}
m_DisabledSprite: {fileID: 0} m_DisabledSprite: {fileID: 0}
m_AnimationTriggers: m_AnimationTriggers:
......
This diff is collapsed.
...@@ -36,10 +36,14 @@ public class RoadGenerator : MonoBehaviour ...@@ -36,10 +36,14 @@ public class RoadGenerator : MonoBehaviour
void Start() void Start()
{ {
int seed = (int)System.DateTime.Now.Ticks; int seed = (int)System.DateTime.Now.Ticks;
//seed = 1728374951; string seedValueFromInputField = PlayerPrefs.GetString("tbxSeed");
Debug.Log("SEED : " + seed); if (seedValueFromInputField.Length > 0)
{
seed = int.Parse(seedValueFromInputField);
}
Random.InitState(seed); Random.InitState(seed);
LogManager.Instance.RegisterSeed(seed); LogManager.Instance.RegisterSeed(seed);
ApplyPlayerPrefs(this.roadPartBlueprintList); ApplyPlayerPrefs(this.roadPartBlueprintList);
// Fix iterations // Fix iterations
......
...@@ -22,6 +22,7 @@ public class MenusController : MonoBehaviour ...@@ -22,6 +22,7 @@ public class MenusController : MonoBehaviour
{ {
ChoseInteractionManager(); ChoseInteractionManager();
InitSlidersValues(); InitSlidersValues();
InitInputTextValue();
SwitchMenu("Main"); SwitchMenu("Main");
} }
...@@ -92,6 +93,18 @@ public class MenusController : MonoBehaviour ...@@ -92,6 +93,18 @@ public class MenusController : MonoBehaviour
} }
} }
private void InitInputTextValue()
{
foreach (Canvas menu in menus)
{
if (menu == null) continue;
foreach (TMP_InputField inputField in menu.GetComponentsInChildren<TMP_InputField>())
{
inputField.text = PlayerPrefs.GetString(inputField.name, inputField.text);
}
}
}
/// <summary> /// <summary>
/// Called when a slider value changes. /// Called when a slider value changes.
/// </summary> /// </summary>
...@@ -130,4 +143,9 @@ public class MenusController : MonoBehaviour ...@@ -130,4 +143,9 @@ public class MenusController : MonoBehaviour
textValue.text = value.ToString(); textValue.text = value.ToString();
PlayerPrefs.SetFloat(slider.name, value); PlayerPrefs.SetFloat(slider.name, value);
} }
public void UpdateTextbox(TMP_InputField inputField)
{
PlayerPrefs.SetString(inputField.name, inputField.text);
}
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment