Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Moments Recorder/Scripts/Editor/MinDrawer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
15 changes: 5 additions & 10 deletions Moments Recorder/Scripts/Recorder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public sealed class Recorder : MonoBehaviour
/// <summary>
/// The folder to save the gif to. No trailing slash.
/// </summary>
public string SaveFolder { get; set; }
private System.IO.DirectoryInfo Directory;

/// <summary>
/// Sets the worker threads priority. This will only affect newly created threads (on save).
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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<GifFrame> frames = new List<GifFrame>(m_Frames.Count);

// Get a temporary texture to read RenderTexture data
Expand Down