private void GetMeshDataAndWriteJson() { if (!updatedVerticesThisFrame && recording) { //getting vertex data frame++; MeshData meshData = GetMeshData(frame); string json = JsonUtility.ToJson(meshData); (jsonContents, curTick, write) = DataHelper.JsonContentTicker(lastFrame: lastFrame, curTick: curTick, reqTick: 3, contents: jsonContents, json); if (write && !lastFrame) { JsonFileWriter.WriteDataToFile(path: filePath, text: jsonContents, title: "", lastFrame: lastFrame); jsonContents = ""; } else if (write && lastFrame) { JsonFileWriter.WriteDataToFile(path: filePath, text: jsonContents, title: "", lastFrame: lastFrame); jsonContents = ""; recording = false; filePath = null; } } updatedVerticesThisFrame = false; }
private void WriteDataContinously(int frame, bool lastFrame) { //proj matrix Matrix4x4 m_matrix = arCamera.projectionMatrix; CameraProjectionMatrix tmp = new CameraProjectionMatrix(); tmp.frame = frame; tmp.cameraProjectionMatrix = m_matrix; //prepare data string json = JsonUtility.ToJson(tmp); (contents, curTick, write) = DataHelper.JsonContentTicker(lastFrame: lastFrame, curTick: curTick, reqTick: 23, contents: contents, json: json); //write contents if (write) { JsonFileWriter.WriteDataToFile(path: filePath, text: contents, "", lastFrame: lastFrame); contents = ""; } if (lastFrame) { filePath = null; } }
private void WriteDataLastFrame(int frame, bool lastFrame) { //proj matrix Matrix4x4 m_matrix = arCamera.projectionMatrix; CameraProjectionMatrix tmp = new CameraProjectionMatrix(); tmp.frame = frame; tmp.cameraProjectionMatrix = m_matrix; //config CameraConfig m_config = GetCameraConfiguration(); ScreenResolution m_res = GetResolution(); //prepare data string matrix = JsonUtility.ToJson(tmp); string config = JsonUtility.ToJson(m_config); string res = JsonUtility.ToJson(m_res); //phrasing string par = "}"; string quote = "\""; string json = $"{matrix}],{quote}cameraConfig{quote}:{config},{quote}resolution{quote}:{res}{par}"; //writing contents += json; JsonFileWriter.WriteDataToFile(path: filePath, text: contents, "", lastFrame: lastFrame); contents = ""; }
// Use this for initialization void Start() { ingameManager = InGamemanager.Instance; jsonFileWriter = JsonFileWriter.Instance; //if (PlayerPrefs.GetInt("NewGame") == 1) //{ // jsonFile = Resources.Load<TextAsset>("JsonDB/GUILD_TABLE") as TextAsset; // loadData = JsonMapper.ToObject(jsonFile.text); // jsonFile = Resources.Load<TextAsset>("JsonDB/PARTY_TABLE") as TextAsset; // loadPartyData = JsonMapper.ToObject(jsonFile.text); //} // //else //{ // jsonFile = Resources.Load<TextAsset>("JsonDB/GUILD_TABLE") as TextAsset; // loadData = JsonMapper.ToObject(jsonFile.text); // jsonFile = Resources.Load<TextAsset>("JsonDB/PARTY_TABLE") as TextAsset; // loadPartyData = JsonMapper.ToObject(jsonFile.text); //} loadData = jsonFileWriter.SerializeData("GUILD_TABLE"); loadPartyData = jsonFileWriter.SerializeData("PARTY_TABLE"); guild_id = PlayerPrefs.GetString("current_guild_id"); LoadFrontData(); name.text = guild_front_name; front.text = guild_front_text[1]; Char_Face_init(); }
public void AddLocation(Location location) { List <Location> locations = GetAllLocations(); locations.Add(location); JsonFileWriter <Location> .WriteToJson(locations, JsonFileName); }
public void Init(string path, string title) { filePath = $"{path}{title}_{j_Prefix()}.json"; JsonFileWriter.WriteDataToFile(path: filePath, text: "", title: "screenPosData", lastFrame: false); //screen space camera if (arCamera == null) { var cam = GameObject.FindGameObjectWithTag("MainCamera"); arCamera = cam.GetComponent <Camera>(); } if (arRaycastManager == null || arPlaneManager == null) { var sessionOrigin = GameObject.FindGameObjectWithTag("arSessionOrigin"); arRaycastManager = sessionOrigin.GetComponent <ARRaycastManager>(); arPlaneManager = sessionOrigin.GetComponent <ARPlaneManager>(); referenceCreator = sessionOrigin.GetComponent <ReferenceCreator>(); } curTick = 0; write = false; jsonContents = ""; //camera resolution to normalize screen pos data camera_width = arCamera.pixelWidth; camera_height = arCamera.pixelHeight; }
public void AddOffer(Offer offer) { List <Offer> offers = AllOffers(); offers.Add(offer); JsonFileWriter.WriteToJsonOffer(offers, JsonFileName); }
public void DeleteOrder(Order order) { List <Order> orders = AllOrders().ToList(); orders.Remove(order); JsonFileWriter.WriteToJsonOrder(orders, JsonFileName); }
// Use this for initialization void Start() { ingameManager = InGamemanager.Instance; jsonFileWriter = JsonFileWriter.Instance; loadPartyData = jsonFileWriter.SerializeData("PARTY_TABLE"); Getparty(); Party_Face_init(); }
public void EditUser(int id, User user) { List <User> users = GetAllUsers().ToList(); users[id - 1] = user; JsonFileWriter.WriteToJsonUser(users, JsonFileName); }
private void Start() { ingamemanager = InGamemanager.Instance; jsonFileWriter = JsonFileWriter.Instance; loadData = jsonFileWriter.SerializeData("NPC_TABLE"); LoadData(); }
public void EditOrder(int id, Order order) { List <Order> orders = AllOrders().ToList(); orders[id] = order; JsonFileWriter.WriteToJsonOrder(orders, JsonFileName); }
public GameObject current_clicked_chr; //현재 선택된(스킬) 캐릭터 // Use this for initialization void Start() { battleManager = BattleManager.Instance; jsonFileWriter = JsonFileWriter.Instance; loadSkillData = jsonFileWriter.SerializeData("SKILL_LIST"); is_click = false; projectile_hit = false; }
public void Init(string path, string title) { write = false; curTick = 0; filePath = $"{path}{title}_{j_Prefix()}.json"; JsonFileWriter.WriteDataToFile(path: filePath, text: "", title: "facePoseList", lastFrame: false); Debug.Log("init face pos"); }
private void Awake() { if (instance) { DestroyImmediate(gameObject.GetComponent <JsonFileWriter>()); return; } instance = this; }
//only works with a single face mesh public void Init(string path, string title) { write = false; //init json file on disk filePath = $"{path}{title}_{j_Prefix()}.json"; JsonFileWriter.WriteDataToFile(path: filePath, text: "", title: "meshGeometry", lastFrame: false); recording = true; Debug.Log("init face mesh indicies handler"); }
public void RemoveUser(int id) { List <User> users = GetAllUsers(); users[id - 1] = new User(); users[id - 1].ID = id; JsonFileWriter.WriteToJsonUser(users, JsonFileName); }
public void AddPizza(Pizza pizza) { //Created a dictionary that calls the GetAllPizzas so it populates it with the existing pizzas. //then we add the new pizza to it, and then afterwards write to Json the created dictionary (existingPizzas) //Dictionary<int, Pizza> existingPizzas = GetAllPizzas(); Pizzas = GetAllPizzas(); Pizzas.Add(pizza.Id, pizza); JsonFileWriter.WriteToJson(Pizzas, filePath); }
public void Init(string path, string title) { pointDensity = PlayerPrefsHandler.Instance.GetFloat("pointDensity", 0.05f); filePath = $"{path}{title}_{j_Prefix()}.json"; lastFrame = false; JsonFileWriter.WriteDataToFile(path: filePath, text: "", title: "points", lastFrame: false); arPointCloud = GameObject.FindGameObjectWithTag("pointCloud").GetComponent <ARPointCloud>(); ReceivePointCloud(); recording = true; }
//only works with a single face mesh public void Init(string path, string title) { //assign variables lastFrame = false; recording = true; jsonContents = ""; //init json file on disk filePath = $"{path}{title}_{j_Prefix()}.json"; JsonFileWriter.WriteDataToFile(path: filePath, text: "", title: "meshDataList", lastFrame: false); Debug.Log("Initialized face mesh"); }
public void DeleteSpeedMeasurement(int id) { SpeedMeasurement speedMeasurementToDelete = GetSpeedMeasurement(id); List <SpeedMeasurement> measurements = GetAllSpeedMeasurements(); if (speedMeasurementToDelete != null) { if (measurements.Remove(speedMeasurementToDelete)) { JsonFileWriter.WriteToJson(measurements, filePath); } } }
public void AddWare(Ware ware) { List <int> ids = new List <int>(); List <Ware> wares = AllWares().ToList(); foreach (Ware w in wares) { ids.Add(w.Id); } ware.Id = ids.Max() + 1; wares.Add(ware); JsonFileWriter.WriteToJsonWare(wares, JsonFileName); }
public void DeleteLocation(int id) { Location locationToDelete = GetLocation(id); List <Location> locations = GetAllLocations(); if (locationToDelete != null) { if (locations.Remove(locationToDelete)) { JsonFileWriter.WriteToJson(locations, filePath); } } }
public void AddLocation(Location location) { List <Location> locations = GetAllLocations(); if (IdExist(location.Id)) { throw new UniqIdException("Id is in use. Please choose another id"); } else { locations.Add(location); } JsonFileWriter.WriteToJson(locations, filePath); }
public void AddSpeedMeasurement(int speed, Location location, string imageName) { List <SpeedMeasurement> measurements = GetAllSpeedMeasurements(); if (speed > 0 && speed <= 300) { measurements.Add(new SpeedMeasurement(speed, location, imageName)); } else { throw new CalibrationException($"Incorrect speed {speed} km/t - something went wrong!"); } JsonFileWriter.WriteToJson(measurements, filePath); }
public void DeleteSpeedMeasurement(int id) { List <SpeedMeasurement> speedMeasurementsList = GetAllSpeedMeasurements(); for (int i = 0; i < speedMeasurementsList.Count; i++) { if (speedMeasurementsList[i].Id == id) { speedMeasurementsList.Remove(speedMeasurementsList[i]); break; } } JsonFileWriter <SpeedMeasurement> .WriteToJson(speedMeasurementsList, JsonFileName); }
public static void Main(string[] args) { string root = args[0]; IFileReader fileReader = new FileReader(); IDirectoryBrowser directoryBrowser = new DirectoryBrowser(root, fileReader, new string[] { "node_modules", "$tf", "packages" }); IDatabaseParser efDatabaseParser = new EntityFrameworkDatabaseParser(); IProcedureParser procedureParser = new InformixProcedureParser(); IFileParser csFileParser = new CSFileParser(efDatabaseParser); IFileParser sqlFileParser = new SQLFileParser(procedureParser); IProjectParser netCoreProjectParser = new NETCoreProjectParser(csFileParser); List <ProcedureParseReport> procedureList = new List <ProcedureParseReport>(); List <ProjectParseReport> projectList = new List <ProjectParseReport>(); int total = 0; DirFile file; while ((file = directoryBrowser.NextFile()) != null) { if (file.Extension == "csproj") { ProjectParseReport projectReport = netCoreProjectParser.Parse(file); if (projectReport != null) { projectList.Add(projectReport); } } else if (file.Extension == "sql") { FileParseReport procedureReport = sqlFileParser.Parse(file); if (procedureReport != null) { procedureList.AddRange(procedureReport.Procedures); } } total++; UpdateConsoleStatus(total, file.Path, root); } JsonFileWriter.WriteToFile(procedureList, "procedureReport.json"); JsonFileWriter.WriteToFile(projectList, "projectReport.json"); }
public void UpdateLocation(Location location) { List <Location> LocationList = GetAllLocations(); for (int i = 0; i < LocationList.Count; i++) { if (location.Id == LocationList[i].Id) { LocationList[i] = location; break; } } JsonFileWriter <Location> .WriteToJson(LocationList, JsonFileName); }
private void GetMeshIndices() { MeshGeometry meshGeometry = GetMeshGeometry(); if (write) { string json = JsonUtility.ToJson(meshGeometry); JsonFileWriter.WriteDataToFile(path: filePath, text: json + "]}", title: "", lastFrame: true); recording = false; write = false; filePath = null; } }
public void DeleteLocation(int id) { List <Location> LocationList = GetAllLocations(); for (int i = 0; i < LocationList.Count; i++) { if (LocationList[i].Id == id) { LocationList.Remove(LocationList[i]); break; } } JsonFileWriter <Location> .WriteToJson(LocationList, JsonFileName); }