Moving Unity walk system over (incomplete)

This commit is contained in:
2023-04-05 08:24:03 -07:00
parent 78a5e5b4e8
commit 6990178be3
11 changed files with 154 additions and 176 deletions

View File

@ -38,6 +38,14 @@ namespace Dawn {
return v;
}
static inline std::string boolParser(std::string v, std::string *error) {
v = stringTrim(v);
if(v == "true") return "true";
if(v == "false") return "false";
*error = "Invalid bool value: " + v;
return std::string("");
}
static inline std::string vec2Parser(std::string v, std::string *error) {
// Split string by comma into two strings that we pass into float
auto split = stringSplit(v, ",");

View File

@ -58,6 +58,8 @@ int32_t PrefabComponentParser::onParse(
parser = vec3Parser;
} else if(type == "int32_t" || type == "int") {
parser = intParser;
} else if(type == "bool_t") {
parser = boolParser;
} else if(type.starts_with("enum")) {
parser = rawParser;
} else if(type.find("*") == (type.size() - 1)) {