public static FlightMap Load(string filename, GravityTurner turner) { try { Texture2D texture = new Texture2D(800, 400); texture.LoadImage(System.IO.File.ReadAllBytes(filename)); FlightMap flightmap = new FlightMap(turner, texture.width, texture.height); flightmap.texture = texture; GravityTurner.Log("FlightMap loaded with {0:0.00} loss", args: flightmap.TotalLoss()); return(flightmap); } catch (Exception) { return(null); } }
public static FlightMap Load(string filename, GravityTurner turner) { try { Texture2D texture = new Texture2D(800, 400); texture.LoadImage(System.IO.File.ReadAllBytes(filename)); FlightMap flightmap = new FlightMap(turner, texture.width, texture.height); flightmap.texture = texture; GravityTurner.Log("FlightMap loaded with {0:0.00} loss", args:flightmap.TotalLoss()); return flightmap; } catch (Exception) { return null; } }