-
Notifications
You must be signed in to change notification settings - Fork 128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When added field is removed in play-session it'll start throwing exceptions and will stop additional-values from rendering in editor #8
Comments
I can't reproduce this. Is this still relevant? using UnityEngine;
using UnityEngine.InputSystem;
public class Test : MonoBehaviour {
void Update() {
if (Keyboard.current.kKey.wasPressedThisFrame) {
Debug.Log("Pressed {key}");
}
}
} Added field: using UnityEngine;
using UnityEngine.InputSystem;
public class Test : MonoBehaviour {
[SerializeField] string key = "W";
void Update() {
if (Keyboard.current.kKey.wasPressedThisFrame) {
Debug.Log($"Pressed {key}");
}
}
} FSR generated: using UnityEngine;
using UnityEngine.InputSystem;
public class Test__Patched_: MonoBehaviour {
/* [SerializeField] string key = "W"; */ //Auto-excluded to prevent exceptions - see docs
void Update() {
if (Keyboard.current.kKey.wasPressedThisFrame) {
Debug.Log($"Pressed {FastScriptReload.Scripts.Runtime.TemporaryNewFieldValues.ResolvePatchedObject<Test__Patched_>(this).key}");
}
}
private static global::System.Collections.Generic.Dictionary<string, global::System.Func<object>> __Patched_NewFieldNameToInitialValueFn = new global::System.Collections.Generic.Dictionary<string, global::System.Func<object>>
{
["key"] = () => "W",
};
private static global::System.Collections.Generic.Dictionary<string, global::System.Func<object>> __Patched_NewFieldsToGetTypeFnDictionaryFieldName = new global::System.Collections.Generic.Dictionary<string, global::System.Func<object>>
{
["key"] = () => typeof(string),
};
} Removed field - reverted back to original, there were on issues. FSR generated: using UnityEngine;
using UnityEngine.InputSystem;
public class Test__Patched_: MonoBehaviour {
void Update() {
if (Keyboard.current.kKey.wasPressedThisFrame) {
Debug.Log("Pressed {key}");
}
}
private static global::System.Collections.Generic.Dictionary<string, global::System.Func<object>> __Patched_NewFieldNameToInitialValueFn = new global::System.Collections.Generic.Dictionary<string, global::System.Func<object>>
{
};
private static global::System.Collections.Generic.Dictionary<string, global::System.Func<object>> __Patched_NewFieldsToGetTypeFnDictionaryFieldName = new global::System.Collections.Generic.Dictionary<string, global::System.Func<object>>
{
};
} |
BTW, this serialize field isn't visible in Inspector. Do I need to do something else for it to appear?
Added field is used in the method |
Could be that issue was sorted but that ticket was not updated (can't remember looking into it though) I'll have a peek tomorror / early next week. Was that method called after FSR reload? This part is quite dynamic and it'll be able to render once code actually executed. Ie adding it to method that did not yet run after reload won't cause it to show. Is demo example working for you? |
@RunninglVlan Alright - I think this one will still be relevant but there's bigger issue where rendering of new fields is broken (#154). Without fixing it we won't be able to repro. Btw - thanks for support on patreon, appreciate that! |
Is it possible to make issues depend on one another on GitHub? |
Is this issue only about SerializeFields? Because I tried with normal fields and couldn't reproduce it either way. |
Not sure, but when you add link it'll show in the other. It's both, newly added fields won't render right now |
No description provided.
The text was updated successfully, but these errors were encountered: