Moving Unity walk system over (incomplete)
This commit is contained in:
@ -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, ",");
|
||||
|
@ -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)) {
|
||||
|
Reference in New Issue
Block a user