public TileBlock(int Cx, int Cy, TileAttrib Ta) { x = Cx; y = Cy; IsPath = false; DistanceSteps = 20000; Attrib = Ta; }
Point FindCode(TileAttrib contentIn) { for (int i = 0; i < MapTile.Length; i++) { if (MapTile[i].Attrib == contentIn) { return(new Point(MapTile[i].x, MapTile[i].y)); } } return(new Point(-1, -1)); }
void BuildSerialData(Tile t) { FieldInfo[] objectFields = t.GetType().GetFields();//Adding any flags here seems to be broken as it just returns no fields. // search all fields and find the attribute for (int i = 0; i < objectFields.Length; i++) { TileAttrib attribute = Attribute.GetCustomAttribute(objectFields[i], typeof(TileAttrib)) as TileAttrib; if (attribute != null) { //Debug.Log("Saving " + objectFields[i].Name); SerialFields.Add(objectFields[i].Name, objectFields[i]); } } }