Commit c24564e0 authored by Tommé Nöll's avatar Tommé Nöll
Browse files

added script to make unity respect read-only files

parent 1cdfaf57
fileFormatVersion: 2
guid: ee0464444428b5532860b22bd61fd1db
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System.IO;
public class NotifyForLockedFiles : UnityEditor.AssetModificationProcessor
{
public static string[] OnWillSaveAssets(string[] paths)
{
List<string> pathsToSave = new List<string>();
for (int i = 0; i < paths.Length; ++i)
{
FileInfo info = new FileInfo(paths[i]);
if (info.IsReadOnly)
UnityEditor.EditorUtility.DisplayDialog("Can not save.",
"Sorry, but " + paths[i] + " is Read-Only! Please Save as another name.",
"Ok");
else
pathsToSave.Add(paths[i]);
}
return pathsToSave.ToArray();
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: 91d73554c09fe12b592f170844a4df25
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment