diff --git a/Moments Recorder/Scripts/Editor/MinDrawer.cs b/Moments Recorder/Scripts/Editor/MinDrawer.cs
index 6bf6c8e..aa6f906 100644
--- a/Moments Recorder/Scripts/Editor/MinDrawer.cs
+++ b/Moments Recorder/Scripts/Editor/MinDrawer.cs
@@ -27,12 +27,12 @@
namespace MomentsEditor
{
- [CustomPropertyDrawer(typeof(MinAttribute))]
+ [CustomPropertyDrawer(typeof(Moments.MinAttribute))]
internal sealed class MinDrawer : PropertyDrawer
{
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
{
- MinAttribute attribute = (MinAttribute)base.attribute;
+ Moments.MinAttribute attribute = (Moments.MinAttribute)base.attribute;
if (property.propertyType == SerializedPropertyType.Integer)
{
diff --git a/Moments Recorder/Scripts/Recorder.cs b/Moments Recorder/Scripts/Recorder.cs
index 86d210b..85acd7a 100644
--- a/Moments Recorder/Scripts/Recorder.cs
+++ b/Moments Recorder/Scripts/Recorder.cs
@@ -81,7 +81,7 @@ public sealed class Recorder : MonoBehaviour
///
/// The folder to save the gif to. No trailing slash.
///
- public string SaveFolder { get; set; }
+ private System.IO.DirectoryInfo Directory;
///
/// Sets the worker threads priority. This will only affect newly created threads (on save).
@@ -340,14 +340,9 @@ void Init()
m_Time = 0f;
// Make sure the output folder is set or use the default one
- if (string.IsNullOrEmpty(SaveFolder))
- {
- #if UNITY_EDITOR
- SaveFolder = Application.dataPath; // Defaults to the asset folder in the editor for faster access to the gif file
- #else
- SaveFolder = Application.persistentDataPath;
- #endif
- }
+ Directory = new System.IO.DirectoryInfo(System.IO.Path.Combine(Application.dataPath, "../GIFs", System.DateTime.Now.ToString("MM-dd")));
+ if (!Directory.Exists)
+ Directory.Create();
}
// Automatically computes height from the current aspect ratio if auto aspect is set to true
@@ -381,7 +376,7 @@ string GenerateFileName()
// Pre-processing coroutine to extract frame data and send everything to a separate worker thread
IEnumerator PreProcess(string filename)
{
- string filepath = SaveFolder + "/" + filename + ".gif";
+ string filepath = Directory + "/" + filename + ".gif";
List frames = new List(m_Frames.Count);
// Get a temporary texture to read RenderTexture data