public CsCursorSaveEntry(CsCustomCursorEntry cursorEntryEntry) { cursorName = cursorEntryEntry.CursorName; cursorColorMultiplier = cursorEntryEntry.CursorColorMultiplier; crossPivotRotation = cursorEntryEntry.CrossPivotRotation; lineColor = cursorEntryEntry.LineColor; lineLength = cursorEntryEntry.LineLength; lineWidth = cursorEntryEntry.LineWidth; lineDistanceFromCenter = cursorEntryEntry.LineWidth; lineLocalRotation = cursorEntryEntry.LineLocalRotation; dotColor = cursorEntryEntry.DotColor; radius = cursorEntryEntry.Radius; dotLocalRotation = cursorEntryEntry.DotLocalRotation; }
public void CsCursorJsonSerialize(CsCustomCursorEntry entry) { CsCursorSaveEntry saveEntry = new CsCursorSaveEntry(entry); string json = JsonUtility.ToJson(saveEntry); string filePath = Path.Combine(csCursorFolderPath, entry.CursorName); if (File.Exists(csCursorFolderPath)) { File.WriteAllText(filePath, json); } else { FileStream fileStream = File.Create(filePath); fileStream.Close(); File.WriteAllText(filePath, json); } #if UNITY_EDITOR UnityEditor.AssetDatabase.Refresh(); Debug.Log(json + "\n------------------------------------------"); #endif }