Initial Commit
This commit is contained in:
parent
53eb92e9af
commit
270ab7d11f
15341 changed files with 700234 additions and 0 deletions
|
@ -0,0 +1,38 @@
|
|||
using System;
|
||||
using UnityEditorInternal;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Unity.Cloud.Collaborate.Common {
|
||||
[AttributeUsage(AttributeTargets.Class)]
|
||||
internal sealed class LocationAttribute : Attribute
|
||||
{
|
||||
public enum Location { PreferencesFolder, LibraryFolder }
|
||||
|
||||
string m_RelativePath;
|
||||
readonly Location m_Location;
|
||||
string m_FilePath;
|
||||
|
||||
public string FilePath {
|
||||
get {
|
||||
if (m_FilePath != null) return m_FilePath;
|
||||
|
||||
if (m_RelativePath[0] == '/')
|
||||
m_RelativePath = m_RelativePath.Substring(1);
|
||||
|
||||
if (m_Location == Location.PreferencesFolder)
|
||||
m_FilePath = $"{InternalEditorUtility.unityPreferencesFolder}/{m_RelativePath}";
|
||||
else if (m_Location == Location.LibraryFolder)
|
||||
m_FilePath = $"Library/Collab/{m_RelativePath}";
|
||||
|
||||
return m_FilePath;
|
||||
}
|
||||
}
|
||||
|
||||
public LocationAttribute(string relativePath, Location location)
|
||||
{
|
||||
//Guard.ArgumentNotNullOrWhiteSpace(relativePath, "relativePath");
|
||||
m_RelativePath = relativePath;
|
||||
m_Location = location;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue