private interpret GetItem(string name) { filedump tmp = Readitem(name); interpret ans = new interpret(); if (int.TryParse(tmp.data, out ans.toint) == false) { ans.toint = -999999; } if (float.TryParse(tmp.data, out ans.tofloat) == false) { ans.tofloat = -999999f; } ans.tostring = tmp.data; return(ans); }
public interpret safeItem(string name, types type) { interpret test = GetItem(name); if (type == types.INT) { if (test.toint == -999999) { //Debug.LogError("Failed to save >" + name + "< of type " + type); } } else if (type == types.FLOAT) { if (test.tofloat == -999999f) { //Debug.LogError("Failed to save >" + name + "< of type " + type); } } return(test); }