Пример #1
0
        static string GetFilePath(string imageFileName)
        {
            string path = Path.Combine(
                AssemblyLocation.GetAssemblyParentDirectory(
                    Assembly.GetAssembly(typeof(PlasticLocalization))),
                "PlasticImage");

            string relativePath = GetRelativePath.ToApplication(path);

            return(Path.Combine(relativePath, imageFileName));
        }
Пример #2
0
        internal static Texture2D GetFileIcon(string path)
        {
            string relativePath = GetRelativePath.ToApplication(path);

            Texture2D result = InternalEditorUtility.GetIconForFile(relativePath);

            if (result == null)
            {
                return(GetFileIcon());
            }

            return(result);
        }
Пример #3
0
        static void OpenFile(string path)
        {
            if (path == null)
                return;

            string relativePath = GetRelativePath.ToApplication(path);

            bool result = AssetDatabase.OpenAsset(
                AssetDatabase.LoadMainAssetAtPath(relativePath));

            if (result)
                return;

            OpenOperation.OpenFile(path);
        }
Пример #4
0
        internal static Texture GetFileIcon(string path)
        {
            string relativePath = GetRelativePath.ToApplication(path);

            return(GetFileIconFromRelativePath(relativePath));
        }