#Not sure what you mean by a fallthrough
1 messages · Page 1 of 1 (latest)
For example, strictyaml is a python package that's used for the resolution of value types in a YAML file:
# this snippet doesn't actually succeed, but I think the point comes across
from strictyaml import Seq, Str, load
schema = Seq(Str()) | Str()
val = load("['this', 'is', 'a', 'list']", schema)
Of course, python is dynamically typed. C# has a var type, though I haven't looked into what it is or how it works yet.
Not sure if this is what you want but if you want to return 2 different type you can do like this
- Create a class object
- create a return function from that class object
- then call it.
var in c# is still very much strongly typed I believe as it's resolved at compile time.
Okay, I see - I'll just parse the strings at runtime, then
Right, some types/data structs which you can't serialize I usually do it in Start() such as dictionaries.
not natively, at least 🙂 ^
Yeah, there's implementations for it, but I prefer just making a struct of arrays and pairing them at runtime.
oh, interesting, interesting
@faint sequoia Do you know why Unity refuses to serialize dictionaries?