From 70a48f07a065fabe7bc2c6becde51b3c5484e398 Mon Sep 17 00:00:00 2001 From: ThatZeoMan <67521686+ThatZeoMan@users.noreply.github.com> Date: Fri, 19 Aug 2022 10:42:52 -0500 Subject: [PATCH] i dont exactly know what im doing wrong lmao --- Assets/Scenes/Editor.unity | 7 +-- .../LevelEditor/Properties/PropController.cs | 50 +------------------ .../Properties/PropList/RemixName.cs | 3 ++ 3 files changed, 8 insertions(+), 52 deletions(-) diff --git a/Assets/Scenes/Editor.unity b/Assets/Scenes/Editor.unity index 05de26a1b..7bc868143 100644 --- a/Assets/Scenes/Editor.unity +++ b/Assets/Scenes/Editor.unity @@ -19841,7 +19841,7 @@ MonoBehaviour: m_TargetGraphic: {fileID: 1589389272} m_HandleRect: {fileID: 1589389271} m_Direction: 2 - m_Value: 0 + m_Value: 1 m_Size: 1 m_NumberOfSteps: 0 m_OnValueChanged: @@ -25461,7 +25461,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0.5} m_AnchorMax: {x: 1, y: 0.5} - m_AnchoredPosition: {x: 0, y: 129.84087} + m_AnchoredPosition: {x: 0, y: 129.84053} m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0.5, y: 1} --- !u!114 &1154875944 @@ -27567,7 +27567,8 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: dfd9c4dee49957d4da897e02634ce6db, type: 3} m_Name: m_EditorClassIdentifier: - content: {fileID: 31952711} + content: {fileID: 1425536042} + inputFieldString: {fileID: 1425536044} --- !u!1 &1254178913 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/Scripts/LevelEditor/Properties/PropController.cs b/Assets/Scripts/LevelEditor/Properties/PropController.cs index 5dcdd2521..2e4e8f0c4 100644 --- a/Assets/Scripts/LevelEditor/Properties/PropController.cs +++ b/Assets/Scripts/LevelEditor/Properties/PropController.cs @@ -20,37 +20,7 @@ namespace HeavenStudio.Properties public bool editingInputField = false; } - public class PropManager : MonoBehaviour - { - [Header("Property Prefabs")] - [SerializeField] private GameObject IntegerP; - [SerializeField] private GameObject FloatP; - [SerializeField] private GameObject BooleanP; - [SerializeField] private GameObject DropdownP; - [SerializeField] private GameObject ColorP; - [SerializeField] private GameObject StringP; - - public Beatmap.Entity entity; - - public bool active; - - private int childCountAtStart; - - public bool canDisable = true; - - public static PropManager instance { get; set; } - - private void Awake() - { - instance = this; - } - - private void Start() - { - childCountAtStart = transform.childCount; - } - - } + [Serializable] public class Properties @@ -62,24 +32,6 @@ namespace HeavenStudio.Properties public string levelCreator = ""; public int Number; - public object this[string propertyName] - { - get - { - return typeof(Properties).GetField(propertyName).GetValue(this); - } - set - { - try - { - typeof(Properties).GetField(propertyName).SetValue(this, value); - } - catch (Exception ex) - { - UnityEngine.Debug.LogError($"You probably misspelled a parameter, or defined the object type wrong. Exception log: {ex}"); - } - } - } } public class PropController diff --git a/Assets/Scripts/LevelEditor/Properties/PropList/RemixName.cs b/Assets/Scripts/LevelEditor/Properties/PropList/RemixName.cs index 2e6a928e0..e6feb9e6a 100644 --- a/Assets/Scripts/LevelEditor/Properties/PropList/RemixName.cs +++ b/Assets/Scripts/LevelEditor/Properties/PropList/RemixName.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using UnityEngine; using HeavenStudio.Util; +using TMPro; namespace HeavenStudio.Properties { @@ -11,11 +12,13 @@ namespace HeavenStudio.Properties public static RemixName instance { get; private set; } = new RemixName(); [SerializeField] private GameObject content; + [SerializeField] private TMP_InputField inputFieldString; public void Refresh(string content) { Properties.instance.levelName = content; Debug.Log(Properties.instance.levelName); + inputFieldString.text = (string)(Properties.instance.levelName); } } } \ No newline at end of file