Skip to content

Commit

Permalink
#3 #4 Preparing next version
Browse files Browse the repository at this point in the history
  • Loading branch information
Frozenfire92 committed May 21, 2018
1 parent c5b67ab commit 885a949
Show file tree
Hide file tree
Showing 31 changed files with 1,124 additions and 1,071 deletions.
Binary file modified Assets/UnityFileDebug/Demo/Test.unity
Binary file not shown.
4 changes: 4 additions & 0 deletions Assets/UnityFileDebug/Demo/Tester.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

public class Tester : MonoBehaviour
{
private void Start()
{
throw new System.Exception("Even regular exceptions are logged");
}
void Update()
{
Debug.Log("CPU 1 has done action a", DLogType.AI);
Expand Down
4 changes: 2 additions & 2 deletions Assets/UnityFileDebug/Lib/Editor.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

public class PackageAsset
{
[MenuItem("Package/Update Package")]
[MenuItem("SSS/Util/Package/Unity File Debug")]
static void UpdatePackage()
{
AssetDatabase.ExportPackage("Assets/UnityFileDebug", "UnityFileDebug.unitypackage", ExportPackageOptions.Recurse);
Expand Down
File renamed without changes.
126 changes: 0 additions & 126 deletions Assets/UnityFileDebug/Lib/Editor/UnityFileDebugEditor.cs

This file was deleted.

10 changes: 10 additions & 0 deletions Assets/UnityFileDebug/Lib/Logger.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

142 changes: 142 additions & 0 deletions Assets/UnityFileDebug/Lib/Logger/Editor/UnityFileDebugEditor.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
using UnityEngine;
using UnityEditor;

namespace SSS
{
namespace UnityFileDebug
{
[CustomEditor(typeof(UnityFileDebug))]
public class UnityFileDebugEditor : Editor
{
UnityFileDebug instance;

SerializedProperty showAbsolute;
SerializedProperty absolutePath;
GUIContent absolutePathContent;

SerializedProperty fileName;
GUIContent fileNameContent;

SerializedProperty filePath;
SerializedProperty filePathFull;

SerializedProperty fileType;
GUIContent fileTypeContent;

string copyPath;

void OnEnable()
{
instance = (UnityFileDebug)target;

absolutePathContent = new GUIContent
{
text = "Absolute Path",
tooltip = "The absolute system path to store the outputted log files"
};

fileNameContent = new GUIContent
{
text = "Export File Name",
tooltip = "The filename (without extension) you would like to save logs as"
};

fileTypeContent = new GUIContent
{
text = "Export File Type",
tooltip = "Export file type"
};

// Update references to serialized objects
showAbsolute = serializedObject.FindProperty("useAbsolutePath");
absolutePath = serializedObject.FindProperty("absolutePath");
fileName = serializedObject.FindProperty("fileName");
filePath = serializedObject.FindProperty("filePath");
filePathFull = serializedObject.FindProperty("filePathFull");
fileType = serializedObject.FindProperty("fileType");
}

public override void OnInspectorGUI()
{
serializedObject.Update();
instance.UpdateFilePath();

// Filename
EditorGUILayout.PropertyField(fileName, fileNameContent);

// File Type
EditorGUILayout.PropertyField(fileType, fileTypeContent);

// Output path type
EditorGUILayout.PropertyField(showAbsolute);
if (showAbsolute.boolValue)
{
EditorGUILayout.PropertyField(absolutePath, absolutePathContent);
}
else
{
EditorGUILayout.LabelField("using Application.persistentDataPath:\t" + Application.persistentDataPath);
}

// Open output path, copy html to output path
EditorGUILayout.BeginHorizontal();
if (GUILayout.Button("Open Output Path"))
{
OpenInFileBrowser.Open(filePath.stringValue);
}
if (GUILayout.Button("Copy HTML to Output Path"))
{
copyPath = filePath.stringValue.Replace('\\', '/');
if (!copyPath.EndsWith("/")) { copyPath += "/"; }
copyPath += "UnityFileDebugViewer.html";
FileUtil.ReplaceFile("Assets/UnityFileDebug/Lib/Viewer/UnityFileDebugViewer.html", copyPath);
}
EditorGUILayout.EndHorizontal();

// If running, show full output path and count
if (Application.isPlaying)
{
EditorGUILayout.Separator();
EditorGUILayout.Separator();
EditorGUILayout.Separator();
EditorGUILayout.Separator();
EditorGUILayout.Separator();

EditorGUILayout.BeginHorizontal();
if (GUILayout.Button("Copy Output Filepath"))
{
EditorGUIUtility.systemCopyBuffer = filePathFull.stringValue;
}
EditorGUILayout.LabelField(filePathFull.stringValue);
EditorGUILayout.EndHorizontal();
EditorGUILayout.LabelField("Logs added: " + instance.count);
}

EditorGUILayout.Separator();
EditorGUILayout.Separator();
EditorGUILayout.Separator();
EditorGUILayout.Separator();
EditorGUILayout.Separator();

// Tell the user what its about
EditorGUILayout.HelpBox("Unity File Debug is made by Sacred Seed Studio and is MIT Licensed. Please feel free to use, modify, contribute, report bugs, and suggest features", MessageType.Info, true);
EditorGUILayout.BeginHorizontal();
if (GUILayout.Button("Source"))
{
Application.OpenURL("https://github.com/Sacred-Seed-Studio/Unity-File-Debug");
}
if (GUILayout.Button("Readme"))
{
Application.OpenURL("https://github.com/Sacred-Seed-Studio/Unity-File-Debug/blob/master/README.md");
}
if (GUILayout.Button("Bugs / Feature Request"))
{
Application.OpenURL("https://github.com/Sacred-Seed-Studio/Unity-File-Debug/issues");
}
EditorGUILayout.EndHorizontal();

serializedObject.ApplyModifiedProperties();
}
}
}
}
File renamed without changes.
Binary file not shown.
10 changes: 10 additions & 0 deletions Assets/UnityFileDebug/Lib/Logger/Scripts.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 885a949

Please sign in to comment.