Tanoda
NatSuite/Plugins/Managed/Recorders/Internal/Utility.cs
Go to the documentation of this file.
1/*
2* NatCorder
3* Copyright (c) 2020 Yusuf Olokoba.
4*/
5
6using System;
7using System.IO;
8using UnityEngine;
9
11{
12 public static class Utility
13 {
14 internal static string directory;
15
16 public static string GetPath(string extension)
17 {
18 if (directory == null)
19 {
20 var editor = Application.platform == RuntimePlatform.OSXEditor ||
21 Application.platform == RuntimePlatform.WindowsEditor;
22 directory = editor ? Directory.GetCurrentDirectory() : Application.persistentDataPath;
23 }
24
25 var timestamp = DateTime.Now.ToString("yyyy_MM_dd_HH_mm_ss_fff");
26 var name = $"recording_{timestamp}{extension}";
27 var path = Path.Combine(directory, name);
28 return path;
29 }
30 }
31}