├── proj.unity
├── ProjectSettings
│ ├── ProjectVersion.txt
│ ├── ClusterInputManager.asset
│ ├── EditorBuildSettings.asset
│ ├── NetworkManager.asset
│ ├── TimeManager.asset
│ ├── UnityAdsSettings.asset
│ ├── AudioManager.asset
│ ├── EditorSettings.asset
│ ├── TagManager.asset
│ ├── UnityConnectSettings.asset
│ ├── DynamicsManager.asset
│ ├── NavMeshAreas.asset
│ ├── Physics2DSettings.asset
│ ├── GraphicsSettings.asset
│ ├── QualitySettings.asset
│ ├── InputManager.asset
│ └── ProjectSettings.asset
└── Assets
│ ├── UnityIO.meta
│ └── UnityIO
│ ├── Editor.meta
│ ├── Interfaces.meta
│ ├── Editor
│ ├── Unit Tests.meta
│ ├── Unit Tests
│ │ ├── Loading Assets
│ │ │ ├── Misc Prefab.prefab.meta
│ │ │ ├── Misc Skin.guiskin.meta
│ │ │ ├── Animations
│ │ │ │ ├── Died.anim.meta
│ │ │ │ ├── Hit.anim.meta
│ │ │ │ ├── Player Attack.anim.meta
│ │ │ │ ├── Hit.anim
│ │ │ │ ├── Died.anim
│ │ │ │ └── Player Attack.anim
│ │ │ ├── Misc Animation.anim.meta
│ │ │ ├── Prefabs
│ │ │ │ ├── Weapon.prefab.meta
│ │ │ │ ├── Player Character.prefab.meta
│ │ │ │ ├── Player Character.prefab
│ │ │ │ └── Weapon.prefab
│ │ │ ├── GUISkins
│ │ │ │ ├── Dark Skin.guiskin.meta
│ │ │ │ └── Light Skin.guiskin.meta
│ │ │ ├── Prefabs.meta
│ │ │ ├── Animations.meta
│ │ │ ├── GUISkins.meta
│ │ │ ├── Misc Animation.anim
│ │ │ └── Misc Prefab.prefab
│ │ ├── Loading Assets.meta
│ │ ├── Documention.cs.meta
│ │ ├── GetFilesTests.cs.meta
│ │ ├── ConvertPathTests.cs.meta
│ │ ├── EnumerationTests.cs.meta
│ │ ├── FileChangesTests.cs.meta
│ │ ├── UnityIOTestBase.cs.meta
│ │ ├── CreatingDirectoryTests.cs.meta
│ │ ├── DirectoryChangesTests.cs.meta
│ │ ├── PathValidationTests.cs.meta
│ │ ├── ConditionalProgressTests.cs.meta
│ │ ├── PathValidationTests.cs
│ │ ├── EnumerationTests.cs
│ │ ├── ConvertPathTests.cs
│ │ ├── UnityIOTestBase.cs
│ │ ├── CreatingDirectoryTests.cs
│ │ ├── GetFilesTests.cs
│ │ ├── ConditionalProgressTests.cs
│ │ ├── FileChangesTests.cs
│ │ ├── Documention.cs
│ │ └── DirectoryChangesTests.cs
│ ├── ContextMenus.cs.meta
│ └── ContextMenus.cs
│ ├── File.cs.meta
│ ├── Files.cs.meta
│ ├── Directory.cs.meta
│ ├── Exceptions.cs.meta
│ ├── NullFile.cs.meta
│ ├── UnityIO.cs.meta
│ ├── AssetDatabase.cs.meta
│ ├── Interfaces
│ ├── IFile.cs.meta
│ ├── IDirectory.cs.meta
│ ├── IFiles.cs.meta
│ ├── IFiles.cs
│ ├── IDirectory.cs
│ └── IFile.cs
│ ├── Files.cs
│ ├── Exceptions.cs
│ ├── NullFile.cs
│ ├── File.cs
│ ├── UnityIO.cs
│ └── AssetDatabase.cs
├── proj.cs
├── App.config
├── UnityIO.sln
├── Properties
│ └── AssemblyInfo.cs
└── UnityIO.csproj
├── .gitignore
├── LICENSE
├── .gitattributes
├── CONTRIBUTING.md
└── README.md
/proj.unity/ProjectSettings/ProjectVersion.txt:
--------------------------------------------------------------------------------
1 | m_EditorVersion: 5.4.0b22-HTP
2 | m_StandardAssetsVersion: 0
3 |
--------------------------------------------------------------------------------
/proj.unity/ProjectSettings/ClusterInputManager.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!236 &1
4 | ClusterInputManager:
5 | m_ObjectHideFlags: 0
6 | m_Inputs: []
7 |
--------------------------------------------------------------------------------
/proj.unity/ProjectSettings/EditorBuildSettings.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!1045 &1
4 | EditorBuildSettings:
5 | m_ObjectHideFlags: 0
6 | serializedVersion: 2
7 | m_Scenes: []
8 |
--------------------------------------------------------------------------------
/proj.cs/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/proj.unity/ProjectSettings/NetworkManager.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!149 &1
4 | NetworkManager:
5 | m_ObjectHideFlags: 0
6 | m_DebugLevel: 0
7 | m_Sendrate: 15
8 | m_AssetToPrefab: {}
9 |
--------------------------------------------------------------------------------
/proj.unity/ProjectSettings/TimeManager.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!5 &1
4 | TimeManager:
5 | m_ObjectHideFlags: 0
6 | Fixed Timestep: 0.02
7 | Maximum Allowed Timestep: 0.33333334
8 | m_TimeScale: 1
9 |
--------------------------------------------------------------------------------
/proj.unity/Assets/UnityIO.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: b3d1ae5d31de10c4db76cea50f39e728
3 | folderAsset: yes
4 | timeCreated: 1477153792
5 | licenseType: Pro
6 | DefaultImporter:
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/proj.unity/Assets/UnityIO/Editor.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 8dfb71f6fee5eb340a9a2f336f59248d
3 | folderAsset: yes
4 | timeCreated: 1477155978
5 | licenseType: Pro
6 | DefaultImporter:
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/proj.unity/Assets/UnityIO/Interfaces.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 106fbc88d71013e45b3ea50204cb6e57
3 | folderAsset: yes
4 | timeCreated: 1477156703
5 | licenseType: Pro
6 | DefaultImporter:
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/proj.unity/Assets/UnityIO/Editor/Unit Tests.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: c01adb5324e6f3b459696ecaa3859191
3 | folderAsset: yes
4 | timeCreated: 1477155984
5 | licenseType: Pro
6 | DefaultImporter:
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/proj.unity/Assets/UnityIO/Editor/Unit Tests/Loading Assets/Misc Prefab.prefab.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 2113cef6b0faa114185566f47da24c23
3 | timeCreated: 1477188180
4 | licenseType: Pro
5 | NativeFormatImporter:
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/proj.unity/Assets/UnityIO/Editor/Unit Tests/Loading Assets/Misc Skin.guiskin.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 0a435fda50452644f9b083844ea7e91f
3 | timeCreated: 1477188231
4 | licenseType: Pro
5 | NativeFormatImporter:
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/proj.unity/Assets/UnityIO/Editor/Unit Tests/Loading Assets/Animations/Died.anim.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 7e9c621da2f87f64ea1d59cc9387ada2
3 | timeCreated: 1477188137
4 | licenseType: Pro
5 | NativeFormatImporter:
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/proj.unity/Assets/UnityIO/Editor/Unit Tests/Loading Assets/Animations/Hit.anim.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: d338a8efa10b87a419346471f5587222
3 | timeCreated: 1477188128
4 | licenseType: Pro
5 | NativeFormatImporter:
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/proj.unity/Assets/UnityIO/Editor/Unit Tests/Loading Assets/Misc Animation.anim.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 81315ac56a97b5d4ba1e99e829619fd8
3 | timeCreated: 1477188147
4 | licenseType: Pro
5 | NativeFormatImporter:
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/proj.unity/Assets/UnityIO/Editor/Unit Tests/Loading Assets/Prefabs/Weapon.prefab.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: e50a17152ad73d748a6f997a7c10b419
3 | timeCreated: 1477188161
4 | licenseType: Pro
5 | NativeFormatImporter:
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/proj.unity/Assets/UnityIO/Editor/Unit Tests/Loading Assets.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 7d718db3a233ef04c9895b1cebdf6155
3 | folderAsset: yes
4 | timeCreated: 1477173515
5 | licenseType: Pro
6 | DefaultImporter:
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/proj.unity/Assets/UnityIO/Editor/Unit Tests/Loading Assets/GUISkins/Dark Skin.guiskin.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 6ab2315a58610a64cb797a60b7955b10
3 | timeCreated: 1477174500
4 | licenseType: Pro
5 | NativeFormatImporter:
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/proj.unity/Assets/UnityIO/Editor/Unit Tests/Loading Assets/GUISkins/Light Skin.guiskin.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 91811523d6de003488556863fb59a04e
3 | timeCreated: 1477188209
4 | licenseType: Pro
5 | NativeFormatImporter:
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/proj.unity/Assets/UnityIO/Editor/Unit Tests/Loading Assets/Animations/Player Attack.anim.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: f96f5041679414243a7c2c9762ce1a5b
3 | timeCreated: 1477188122
4 | licenseType: Pro
5 | NativeFormatImporter:
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/proj.unity/Assets/UnityIO/Editor/Unit Tests/Loading Assets/Prefabs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: fce111a28a4462d4cba8a03074927990
3 | folderAsset: yes
4 | timeCreated: 1477188107
5 | licenseType: Pro
6 | DefaultImporter:
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/proj.unity/Assets/UnityIO/Editor/Unit Tests/Loading Assets/Prefabs/Player Character.prefab.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 7f9fac0459335984488cefc3f67ff76e
3 | timeCreated: 1477174473
4 | licenseType: Pro
5 | NativeFormatImporter:
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/proj.unity/Assets/UnityIO/Editor/Unit Tests/Loading Assets/Animations.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: fff32dcf1d6c6854fa3ce7d2c7d02527
3 | folderAsset: yes
4 | timeCreated: 1477188114
5 | licenseType: Pro
6 | DefaultImporter:
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/proj.unity/Assets/UnityIO/Editor/Unit Tests/Loading Assets/GUISkins.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 317cdb94b58918c478b82f3702269029
3 | folderAsset: yes
4 | timeCreated: 1477188195
5 | licenseType: Pro
6 | DefaultImporter:
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/proj.unity/ProjectSettings/UnityAdsSettings.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!292 &1
4 | UnityAdsSettings:
5 | m_ObjectHideFlags: 0
6 | m_Enabled: 0
7 | m_InitializeOnStartup: 1
8 | m_TestMode: 0
9 | m_EnabledPlatforms: 4294967295
10 | m_IosGameId:
11 | m_AndroidGameId:
12 |
--------------------------------------------------------------------------------
/proj.unity/Assets/UnityIO/File.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 700bd19807d67f8409408f40c7ce4e85
3 | timeCreated: 1477156703
4 | licenseType: Pro
5 | MonoImporter:
6 | serializedVersion: 2
7 | defaultReferences: []
8 | executionOrder: 0
9 | icon: {instanceID: 0}
10 | userData:
11 | assetBundleName:
12 | assetBundleVariant:
13 |
--------------------------------------------------------------------------------
/proj.unity/Assets/UnityIO/Files.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: aa65fa7bedb29bc4ea3dfd6a96575f8b
3 | timeCreated: 1477156703
4 | licenseType: Pro
5 | MonoImporter:
6 | serializedVersion: 2
7 | defaultReferences: []
8 | executionOrder: 0
9 | icon: {instanceID: 0}
10 | userData:
11 | assetBundleName:
12 | assetBundleVariant:
13 |
--------------------------------------------------------------------------------
/proj.unity/Assets/UnityIO/Directory.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: a3f045f8267318d499a53948a92ec9f1
3 | timeCreated: 1477156703
4 | licenseType: Pro
5 | MonoImporter:
6 | serializedVersion: 2
7 | defaultReferences: []
8 | executionOrder: 0
9 | icon: {instanceID: 0}
10 | userData:
11 | assetBundleName:
12 | assetBundleVariant:
13 |
--------------------------------------------------------------------------------
/proj.unity/Assets/UnityIO/Exceptions.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: ceb2f6fea9809774680ecff05aaf0d46
3 | timeCreated: 1477233237
4 | licenseType: Pro
5 | MonoImporter:
6 | serializedVersion: 2
7 | defaultReferences: []
8 | executionOrder: 0
9 | icon: {instanceID: 0}
10 | userData:
11 | assetBundleName:
12 | assetBundleVariant:
13 |
--------------------------------------------------------------------------------
/proj.unity/Assets/UnityIO/NullFile.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 147e429a01bd97e469a4319fe5c6edf0
3 | timeCreated: 1477162088
4 | licenseType: Pro
5 | MonoImporter:
6 | serializedVersion: 2
7 | defaultReferences: []
8 | executionOrder: 0
9 | icon: {instanceID: 0}
10 | userData:
11 | assetBundleName:
12 | assetBundleVariant:
13 |
--------------------------------------------------------------------------------
/proj.unity/Assets/UnityIO/UnityIO.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 29e8fb7159e89404cab81007bd44832d
3 | timeCreated: 1477153801
4 | licenseType: Pro
5 | MonoImporter:
6 | serializedVersion: 2
7 | defaultReferences: []
8 | executionOrder: 0
9 | icon: {instanceID: 0}
10 | userData:
11 | assetBundleName:
12 | assetBundleVariant:
13 |
--------------------------------------------------------------------------------
/proj.unity/Assets/UnityIO/AssetDatabase.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 4a46f6b80c96e3747af916c6c024bc14
3 | timeCreated: 1492634243
4 | licenseType: Free
5 | MonoImporter:
6 | serializedVersion: 2
7 | defaultReferences: []
8 | executionOrder: 0
9 | icon: {instanceID: 0}
10 | userData:
11 | assetBundleName:
12 | assetBundleVariant:
13 |
--------------------------------------------------------------------------------
/proj.unity/Assets/UnityIO/Interfaces/IFile.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 628be2ab2e31f0744aaee498ab4404b4
3 | timeCreated: 1477156703
4 | licenseType: Pro
5 | MonoImporter:
6 | serializedVersion: 2
7 | defaultReferences: []
8 | executionOrder: 0
9 | icon: {instanceID: 0}
10 | userData:
11 | assetBundleName:
12 | assetBundleVariant:
13 |
--------------------------------------------------------------------------------
/proj.unity/Assets/UnityIO/Editor/ContextMenus.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 4aabcc5fb9613ce4e885d36696b4bc7f
3 | timeCreated: 1477768184
4 | licenseType: Pro
5 | MonoImporter:
6 | serializedVersion: 2
7 | defaultReferences: []
8 | executionOrder: 0
9 | icon: {instanceID: 0}
10 | userData:
11 | assetBundleName:
12 | assetBundleVariant:
13 |
--------------------------------------------------------------------------------
/proj.unity/Assets/UnityIO/Interfaces/IDirectory.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: e30d123ea971489498d5690d1b8552e6
3 | timeCreated: 1477156703
4 | licenseType: Pro
5 | MonoImporter:
6 | serializedVersion: 2
7 | defaultReferences: []
8 | executionOrder: 0
9 | icon: {instanceID: 0}
10 | userData:
11 | assetBundleName:
12 | assetBundleVariant:
13 |
--------------------------------------------------------------------------------
/proj.unity/Assets/UnityIO/Interfaces/IFiles.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: fe8778e31e00e7c488fe84cc014bed86
3 | timeCreated: 1477175823
4 | licenseType: Pro
5 | MonoImporter:
6 | serializedVersion: 2
7 | defaultReferences: []
8 | executionOrder: 0
9 | icon: {instanceID: 0}
10 | userData:
11 | assetBundleName:
12 | assetBundleVariant:
13 |
--------------------------------------------------------------------------------
/proj.unity/Assets/UnityIO/Editor/Unit Tests/Documention.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: ca858dea963d04b44a5e0be3dd636fec
3 | timeCreated: 1477170977
4 | licenseType: Pro
5 | MonoImporter:
6 | serializedVersion: 2
7 | defaultReferences: []
8 | executionOrder: 0
9 | icon: {instanceID: 0}
10 | userData:
11 | assetBundleName:
12 | assetBundleVariant:
13 |
--------------------------------------------------------------------------------
/proj.unity/Assets/UnityIO/Editor/Unit Tests/GetFilesTests.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: bcde37ea76b476c4986720754c9c3aad
3 | timeCreated: 1477174458
4 | licenseType: Pro
5 | MonoImporter:
6 | serializedVersion: 2
7 | defaultReferences: []
8 | executionOrder: 0
9 | icon: {instanceID: 0}
10 | userData:
11 | assetBundleName:
12 | assetBundleVariant:
13 |
--------------------------------------------------------------------------------
/proj.unity/Assets/UnityIO/Editor/Unit Tests/ConvertPathTests.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 1050a70e79992f743868c3eb574b1e00
3 | timeCreated: 1483123943
4 | licenseType: Free
5 | MonoImporter:
6 | serializedVersion: 2
7 | defaultReferences: []
8 | executionOrder: 0
9 | icon: {instanceID: 0}
10 | userData:
11 | assetBundleName:
12 | assetBundleVariant:
13 |
--------------------------------------------------------------------------------
/proj.unity/Assets/UnityIO/Editor/Unit Tests/EnumerationTests.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: b2d5aaf12fd95a44e8f69b50f5c5ce68
3 | timeCreated: 1477172634
4 | licenseType: Pro
5 | MonoImporter:
6 | serializedVersion: 2
7 | defaultReferences: []
8 | executionOrder: 0
9 | icon: {instanceID: 0}
10 | userData:
11 | assetBundleName:
12 | assetBundleVariant:
13 |
--------------------------------------------------------------------------------
/proj.unity/Assets/UnityIO/Editor/Unit Tests/FileChangesTests.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 0ed2da6b4d3c20345b790bed20bbc447
3 | timeCreated: 1477243549
4 | licenseType: Pro
5 | MonoImporter:
6 | serializedVersion: 2
7 | defaultReferences: []
8 | executionOrder: 0
9 | icon: {instanceID: 0}
10 | userData:
11 | assetBundleName:
12 | assetBundleVariant:
13 |
--------------------------------------------------------------------------------
/proj.unity/Assets/UnityIO/Editor/Unit Tests/UnityIOTestBase.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 5dd15397529fb4e498e69a2a194d37a6
3 | timeCreated: 1477766130
4 | licenseType: Pro
5 | MonoImporter:
6 | serializedVersion: 2
7 | defaultReferences: []
8 | executionOrder: 0
9 | icon: {instanceID: 0}
10 | userData:
11 | assetBundleName:
12 | assetBundleVariant:
13 |
--------------------------------------------------------------------------------
/proj.unity/Assets/UnityIO/Editor/Unit Tests/CreatingDirectoryTests.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 680190ca25d716d428f3abddb8532224
3 | timeCreated: 1477156006
4 | licenseType: Pro
5 | MonoImporter:
6 | serializedVersion: 2
7 | defaultReferences: []
8 | executionOrder: 0
9 | icon: {instanceID: 0}
10 | userData:
11 | assetBundleName:
12 | assetBundleVariant:
13 |
--------------------------------------------------------------------------------
/proj.unity/Assets/UnityIO/Editor/Unit Tests/DirectoryChangesTests.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 30aa69c7d566afb459cd14682375b60c
3 | timeCreated: 1477191940
4 | licenseType: Pro
5 | MonoImporter:
6 | serializedVersion: 2
7 | defaultReferences: []
8 | executionOrder: 0
9 | icon: {instanceID: 0}
10 | userData:
11 | assetBundleName:
12 | assetBundleVariant:
13 |
--------------------------------------------------------------------------------
/proj.unity/Assets/UnityIO/Editor/Unit Tests/PathValidationTests.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: c20474c44b8a3be4d868c9c4f7a1d1d2
3 | timeCreated: 1477159978
4 | licenseType: Pro
5 | MonoImporter:
6 | serializedVersion: 2
7 | defaultReferences: []
8 | executionOrder: 0
9 | icon: {instanceID: 0}
10 | userData:
11 | assetBundleName:
12 | assetBundleVariant:
13 |
--------------------------------------------------------------------------------
/proj.unity/Assets/UnityIO/Editor/Unit Tests/ConditionalProgressTests.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: bfea9f91637d1854e97c98e51eb7c893
3 | timeCreated: 1477160846
4 | licenseType: Pro
5 | MonoImporter:
6 | serializedVersion: 2
7 | defaultReferences: []
8 | executionOrder: 0
9 | icon: {instanceID: 0}
10 | userData:
11 | assetBundleName:
12 | assetBundleVariant:
13 |
--------------------------------------------------------------------------------
/proj.unity/ProjectSettings/AudioManager.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!11 &1
4 | AudioManager:
5 | m_ObjectHideFlags: 0
6 | m_Volume: 1
7 | Rolloff Scale: 1
8 | Doppler Factor: 1
9 | Default Speaker Mode: 2
10 | m_SampleRate: 0
11 | m_DSPBufferSize: 0
12 | m_VirtualVoiceCount: 512
13 | m_RealVoiceCount: 32
14 | m_SpatializerPlugin:
15 | m_DisableAudio: 0
16 | m_VirtualizeEffects: 1
17 |
--------------------------------------------------------------------------------
/proj.unity/Assets/UnityIO/Editor/Unit Tests/Loading Assets/Prefabs/Player Character.prefab:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!1001 &100100000
4 | Prefab:
5 | m_ObjectHideFlags: 0
6 | serializedVersion: 2
7 | m_Modification:
8 | m_TransformParent: {fileID: 0}
9 | m_Modifications: []
10 | m_RemovedComponents: []
11 | m_ParentPrefab: {fileID: 0}
12 | m_RootGameObject: {fileID: 0}
13 | m_IsPrefabParent: 1
14 |
--------------------------------------------------------------------------------
/proj.unity/ProjectSettings/EditorSettings.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!159 &1
4 | EditorSettings:
5 | m_ObjectHideFlags: 0
6 | serializedVersion: 3
7 | m_ExternalVersionControlSupport: Visible Meta Files
8 | m_SerializationMode: 2
9 | m_WebSecurityEmulationEnabled: 0
10 | m_WebSecurityEmulationHostUrl: http://www.mydomain.com/mygame.unity3d
11 | m_DefaultBehaviorMode: 1
12 | m_SpritePackerMode: 2
13 | m_SpritePackerPaddingPower: 1
14 | m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd
15 | m_ProjectGenerationRootNamespace:
16 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | /[Ll]ibrary/
2 | /[Tt]emp/
3 | /[Oo]bj/
4 | /[Bb]uild/
5 | /[Bb]uilds/
6 | /Assets/AssetStoreTools*
7 |
8 | # Autogenerated VS/MD solution and project files
9 | ExportedObj/
10 | proj.unity/**/*.csproj
11 | *.unityproj
12 | proj.unity/**/*.sln
13 | *.suo
14 | *.tmp
15 | *.user
16 | *.userprefs
17 | *.pidb
18 | *.booproj
19 | *.svd
20 |
21 | # Unity3D generated meta files
22 | *.pidb.meta
23 |
24 | # Unity3D Generated File On Crash Reports
25 | sysinfo.txt
26 |
27 | # Builds
28 | *.apk
29 | *.unitypackage
30 | proj.cs/bin/
31 | proj.cs/obj/
32 | proj.unity/Temp/
33 | proj.unity/Library/
34 |
--------------------------------------------------------------------------------
/proj.unity/ProjectSettings/TagManager.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!78 &1
4 | TagManager:
5 | serializedVersion: 2
6 | tags: []
7 | layers:
8 | - Default
9 | - TransparentFX
10 | - Ignore Raycast
11 | -
12 | - Water
13 | - UI
14 | -
15 | -
16 | -
17 | -
18 | -
19 | -
20 | -
21 | -
22 | -
23 | -
24 | -
25 | -
26 | -
27 | -
28 | -
29 | -
30 | -
31 | -
32 | -
33 | -
34 | -
35 | -
36 | -
37 | -
38 | -
39 | -
40 | m_SortingLayers:
41 | - name: Default
42 | uniqueID: 0
43 | locked: 0
44 |
--------------------------------------------------------------------------------
/proj.unity/ProjectSettings/UnityConnectSettings.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!310 &1
4 | UnityConnectSettings:
5 | m_ObjectHideFlags: 0
6 | m_Enabled: 0
7 | m_TestMode: 0
8 | m_TestEventUrl:
9 | m_TestConfigUrl:
10 | CrashReportingSettings:
11 | m_EventUrl: https://perf-events.cloud.unity3d.com/api/events/crashes
12 | m_Enabled: 0
13 | UnityPurchasingSettings:
14 | m_Enabled: 0
15 | m_TestMode: 0
16 | UnityAnalyticsSettings:
17 | m_Enabled: 0
18 | m_InitializeOnStartup: 1
19 | m_TestMode: 0
20 | m_TestEventUrl:
21 | m_TestConfigUrl:
22 |
--------------------------------------------------------------------------------
/proj.unity/ProjectSettings/DynamicsManager.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!55 &1
4 | PhysicsManager:
5 | m_ObjectHideFlags: 0
6 | serializedVersion: 2
7 | m_Gravity: {x: 0, y: -9.81, z: 0}
8 | m_DefaultMaterial: {fileID: 0}
9 | m_BounceThreshold: 2
10 | m_SleepThreshold: 0.005
11 | m_DefaultContactOffset: 0.01
12 | m_SolverIterationCount: 6
13 | m_SolverVelocityIterations: 1
14 | m_QueriesHitTriggers: 1
15 | m_EnableAdaptiveForce: 0
16 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
17 |
--------------------------------------------------------------------------------
/proj.cs/UnityIO.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 14
4 | VisualStudioVersion = 14.0.25420.1
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnityIO", "UnityIO.csproj", "{BAABED0F-99C5-43C4-B6E7-E551A2D5C430}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {BAABED0F-99C5-43C4-B6E7-E551A2D5C430}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {BAABED0F-99C5-43C4-B6E7-E551A2D5C430}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {BAABED0F-99C5-43C4-B6E7-E551A2D5C430}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {BAABED0F-99C5-43C4-B6E7-E551A2D5C430}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | EndGlobal
23 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2016 Byron Mayne
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/proj.unity/ProjectSettings/NavMeshAreas.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!126 &1
4 | NavMeshAreas:
5 | m_ObjectHideFlags: 0
6 | serializedVersion: 2
7 | areas:
8 | - name: Walkable
9 | cost: 1
10 | - name: Not Walkable
11 | cost: 1
12 | - name: Jump
13 | cost: 2
14 | - name:
15 | cost: 1
16 | - name:
17 | cost: 1
18 | - name:
19 | cost: 1
20 | - name:
21 | cost: 1
22 | - name:
23 | cost: 1
24 | - name:
25 | cost: 1
26 | - name:
27 | cost: 1
28 | - name:
29 | cost: 1
30 | - name:
31 | cost: 1
32 | - name:
33 | cost: 1
34 | - name:
35 | cost: 1
36 | - name:
37 | cost: 1
38 | - name:
39 | cost: 1
40 | - name:
41 | cost: 1
42 | - name:
43 | cost: 1
44 | - name:
45 | cost: 1
46 | - name:
47 | cost: 1
48 | - name:
49 | cost: 1
50 | - name:
51 | cost: 1
52 | - name:
53 | cost: 1
54 | - name:
55 | cost: 1
56 | - name:
57 | cost: 1
58 | - name:
59 | cost: 1
60 | - name:
61 | cost: 1
62 | - name:
63 | cost: 1
64 | - name:
65 | cost: 1
66 | - name:
67 | cost: 1
68 | - name:
69 | cost: 1
70 | - name:
71 | cost: 1
72 |
--------------------------------------------------------------------------------
/proj.unity/ProjectSettings/Physics2DSettings.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!19 &1
4 | Physics2DSettings:
5 | m_ObjectHideFlags: 0
6 | serializedVersion: 2
7 | m_Gravity: {x: 0, y: -9.81}
8 | m_DefaultMaterial: {fileID: 0}
9 | m_VelocityIterations: 8
10 | m_PositionIterations: 3
11 | m_VelocityThreshold: 1
12 | m_MaxLinearCorrection: 0.2
13 | m_MaxAngularCorrection: 8
14 | m_MaxTranslationSpeed: 100
15 | m_MaxRotationSpeed: 360
16 | m_MinPenetrationForPenalty: 0.01
17 | m_BaumgarteScale: 0.2
18 | m_BaumgarteTimeOfImpactScale: 0.75
19 | m_TimeToSleep: 0.5
20 | m_LinearSleepTolerance: 0.01
21 | m_AngularSleepTolerance: 2
22 | m_QueriesHitTriggers: 1
23 | m_QueriesStartInColliders: 1
24 | m_ChangeStopsCallbacks: 0
25 | m_AlwaysShowColliders: 0
26 | m_ShowColliderSleep: 1
27 | m_ShowColliderContacts: 0
28 | m_ContactArrowScale: 0.2
29 | m_ColliderAwakeColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.7529412}
30 | m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432}
31 | m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745}
32 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
33 |
--------------------------------------------------------------------------------
/proj.cs/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("UnityIO")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("UnityIO")]
13 | [assembly: AssemblyCopyright("Copyright © 2016")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("baabed0f-99c5-43c4-b6e7-e551a2d5c430")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/proj.unity/Assets/UnityIO/Editor/Unit Tests/Loading Assets/Animations/Hit.anim:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!74 &7400000
4 | AnimationClip:
5 | m_ObjectHideFlags: 0
6 | m_PrefabParentObject: {fileID: 0}
7 | m_PrefabInternal: {fileID: 0}
8 | m_Name: Hit
9 | serializedVersion: 6
10 | m_Legacy: 0
11 | m_Compressed: 0
12 | m_UseHighQualityCurve: 1
13 | m_RotationCurves: []
14 | m_CompressedRotationCurves: []
15 | m_EulerCurves: []
16 | m_PositionCurves: []
17 | m_ScaleCurves: []
18 | m_FloatCurves: []
19 | m_PPtrCurves: []
20 | m_SampleRate: 60
21 | m_WrapMode: 0
22 | m_Bounds:
23 | m_Center: {x: 0, y: 0, z: 0}
24 | m_Extent: {x: 0, y: 0, z: 0}
25 | m_ClipBindingConstant:
26 | genericBindings: []
27 | pptrCurveMapping: []
28 | m_AnimationClipSettings:
29 | serializedVersion: 2
30 | m_AdditiveReferencePoseClip: {fileID: 0}
31 | m_AdditiveReferencePoseTime: 0
32 | m_StartTime: 0
33 | m_StopTime: 1
34 | m_OrientationOffsetY: 0
35 | m_Level: 0
36 | m_CycleOffset: 0
37 | m_HasAdditiveReferencePose: 0
38 | m_LoopTime: 0
39 | m_LoopBlend: 0
40 | m_LoopBlendOrientation: 0
41 | m_LoopBlendPositionY: 0
42 | m_LoopBlendPositionXZ: 0
43 | m_KeepOriginalOrientation: 0
44 | m_KeepOriginalPositionY: 1
45 | m_KeepOriginalPositionXZ: 0
46 | m_HeightFromFeet: 0
47 | m_Mirror: 0
48 | m_EditorCurves: []
49 | m_EulerEditorCurves: []
50 | m_HasGenericRootTransform: 0
51 | m_HasMotionFloatCurves: 0
52 | m_GenerateMotionCurves: 0
53 | m_Events: []
54 |
--------------------------------------------------------------------------------
/proj.unity/Assets/UnityIO/Editor/Unit Tests/Loading Assets/Animations/Died.anim:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!74 &7400000
4 | AnimationClip:
5 | m_ObjectHideFlags: 0
6 | m_PrefabParentObject: {fileID: 0}
7 | m_PrefabInternal: {fileID: 0}
8 | m_Name: Died
9 | serializedVersion: 6
10 | m_Legacy: 0
11 | m_Compressed: 0
12 | m_UseHighQualityCurve: 1
13 | m_RotationCurves: []
14 | m_CompressedRotationCurves: []
15 | m_EulerCurves: []
16 | m_PositionCurves: []
17 | m_ScaleCurves: []
18 | m_FloatCurves: []
19 | m_PPtrCurves: []
20 | m_SampleRate: 60
21 | m_WrapMode: 0
22 | m_Bounds:
23 | m_Center: {x: 0, y: 0, z: 0}
24 | m_Extent: {x: 0, y: 0, z: 0}
25 | m_ClipBindingConstant:
26 | genericBindings: []
27 | pptrCurveMapping: []
28 | m_AnimationClipSettings:
29 | serializedVersion: 2
30 | m_AdditiveReferencePoseClip: {fileID: 0}
31 | m_AdditiveReferencePoseTime: 0
32 | m_StartTime: 0
33 | m_StopTime: 1
34 | m_OrientationOffsetY: 0
35 | m_Level: 0
36 | m_CycleOffset: 0
37 | m_HasAdditiveReferencePose: 0
38 | m_LoopTime: 0
39 | m_LoopBlend: 0
40 | m_LoopBlendOrientation: 0
41 | m_LoopBlendPositionY: 0
42 | m_LoopBlendPositionXZ: 0
43 | m_KeepOriginalOrientation: 0
44 | m_KeepOriginalPositionY: 1
45 | m_KeepOriginalPositionXZ: 0
46 | m_HeightFromFeet: 0
47 | m_Mirror: 0
48 | m_EditorCurves: []
49 | m_EulerEditorCurves: []
50 | m_HasGenericRootTransform: 0
51 | m_HasMotionFloatCurves: 0
52 | m_GenerateMotionCurves: 0
53 | m_Events: []
54 |
--------------------------------------------------------------------------------
/proj.unity/Assets/UnityIO/Editor/Unit Tests/Loading Assets/Misc Animation.anim:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!74 &7400000
4 | AnimationClip:
5 | m_ObjectHideFlags: 0
6 | m_PrefabParentObject: {fileID: 0}
7 | m_PrefabInternal: {fileID: 0}
8 | m_Name: Misc Animation
9 | serializedVersion: 6
10 | m_Legacy: 0
11 | m_Compressed: 0
12 | m_UseHighQualityCurve: 1
13 | m_RotationCurves: []
14 | m_CompressedRotationCurves: []
15 | m_EulerCurves: []
16 | m_PositionCurves: []
17 | m_ScaleCurves: []
18 | m_FloatCurves: []
19 | m_PPtrCurves: []
20 | m_SampleRate: 60
21 | m_WrapMode: 0
22 | m_Bounds:
23 | m_Center: {x: 0, y: 0, z: 0}
24 | m_Extent: {x: 0, y: 0, z: 0}
25 | m_ClipBindingConstant:
26 | genericBindings: []
27 | pptrCurveMapping: []
28 | m_AnimationClipSettings:
29 | serializedVersion: 2
30 | m_AdditiveReferencePoseClip: {fileID: 0}
31 | m_AdditiveReferencePoseTime: 0
32 | m_StartTime: 0
33 | m_StopTime: 1
34 | m_OrientationOffsetY: 0
35 | m_Level: 0
36 | m_CycleOffset: 0
37 | m_HasAdditiveReferencePose: 0
38 | m_LoopTime: 0
39 | m_LoopBlend: 0
40 | m_LoopBlendOrientation: 0
41 | m_LoopBlendPositionY: 0
42 | m_LoopBlendPositionXZ: 0
43 | m_KeepOriginalOrientation: 0
44 | m_KeepOriginalPositionY: 1
45 | m_KeepOriginalPositionXZ: 0
46 | m_HeightFromFeet: 0
47 | m_Mirror: 0
48 | m_EditorCurves: []
49 | m_EulerEditorCurves: []
50 | m_HasGenericRootTransform: 0
51 | m_HasMotionFloatCurves: 0
52 | m_GenerateMotionCurves: 0
53 | m_Events: []
54 |
--------------------------------------------------------------------------------
/proj.unity/Assets/UnityIO/Editor/Unit Tests/Loading Assets/Animations/Player Attack.anim:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!74 &7400000
4 | AnimationClip:
5 | m_ObjectHideFlags: 0
6 | m_PrefabParentObject: {fileID: 0}
7 | m_PrefabInternal: {fileID: 0}
8 | m_Name: Player Attack
9 | serializedVersion: 6
10 | m_Legacy: 0
11 | m_Compressed: 0
12 | m_UseHighQualityCurve: 1
13 | m_RotationCurves: []
14 | m_CompressedRotationCurves: []
15 | m_EulerCurves: []
16 | m_PositionCurves: []
17 | m_ScaleCurves: []
18 | m_FloatCurves: []
19 | m_PPtrCurves: []
20 | m_SampleRate: 60
21 | m_WrapMode: 0
22 | m_Bounds:
23 | m_Center: {x: 0, y: 0, z: 0}
24 | m_Extent: {x: 0, y: 0, z: 0}
25 | m_ClipBindingConstant:
26 | genericBindings: []
27 | pptrCurveMapping: []
28 | m_AnimationClipSettings:
29 | serializedVersion: 2
30 | m_AdditiveReferencePoseClip: {fileID: 0}
31 | m_AdditiveReferencePoseTime: 0
32 | m_StartTime: 0
33 | m_StopTime: 1
34 | m_OrientationOffsetY: 0
35 | m_Level: 0
36 | m_CycleOffset: 0
37 | m_HasAdditiveReferencePose: 0
38 | m_LoopTime: 0
39 | m_LoopBlend: 0
40 | m_LoopBlendOrientation: 0
41 | m_LoopBlendPositionY: 0
42 | m_LoopBlendPositionXZ: 0
43 | m_KeepOriginalOrientation: 0
44 | m_KeepOriginalPositionY: 1
45 | m_KeepOriginalPositionXZ: 0
46 | m_HeightFromFeet: 0
47 | m_Mirror: 0
48 | m_EditorCurves: []
49 | m_EulerEditorCurves: []
50 | m_HasGenericRootTransform: 0
51 | m_HasMotionFloatCurves: 0
52 | m_GenerateMotionCurves: 0
53 | m_Events: []
54 |
--------------------------------------------------------------------------------
/proj.unity/Assets/UnityIO/Interfaces/IFiles.cs:
--------------------------------------------------------------------------------
1 | /*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2 | UnityIO was released with an MIT License.
3 | Arther: Byron Mayne
4 | Twitter: @ByMayne
5 |
6 |
7 | MIT License
8 |
9 | Copyright(c) 2016 Byron Mayne
10 |
11 | Permission is hereby granted, free of charge, to any person obtaining a copy
12 | of this software and associated documentation files (the "Software"), to deal
13 | in the Software without restriction, including without limitation the rights
14 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15 | copies of the Software, and to permit persons to whom the Software is
16 | furnished to do so, subject to the following conditions:
17 |
18 | The above copyright notice and this permission notice shall be included in all
19 | copies or substantial portions of the Software.
20 |
21 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27 | SOFTWARE.
28 | >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>*/
29 |
30 | using System.Collections.Generic;
31 | using UnityEngine;
32 | using UnityIO.Classes;
33 |
34 | namespace UnityIO.Interfaces
35 | {
36 | public interface IFiles : IList
37 | {
38 | IList LoadAllofType() where T : Object;
39 | IFile FirstOrDefault();
40 | }
41 |
42 |
43 | }
44 |
--------------------------------------------------------------------------------
/proj.unity/Assets/UnityIO/Editor/Unit Tests/PathValidationTests.cs:
--------------------------------------------------------------------------------
1 | /*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2 | UnityIO was released with an MIT License.
3 | Arther: Byron Mayne
4 | Twitter: @ByMayne
5 |
6 |
7 | MIT License
8 |
9 | Copyright(c) 2016 Byron Mayne
10 |
11 | Permission is hereby granted, free of charge, to any person obtaining a copy
12 | of this software and associated documentation files (the "Software"), to deal
13 | in the Software without restriction, including without limitation the rights
14 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15 | copies of the Software, and to permit persons to whom the Software is
16 | furnished to do so, subject to the following conditions:
17 |
18 | The above copyright notice and this permission notice shall be included in all
19 | copies or substantial portions of the Software.
20 |
21 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27 | SOFTWARE.
28 | >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>*/
29 |
30 | // Disable unused warning
31 | #pragma warning disable 0168
32 | using NUnit.Framework;
33 | using UnityIO;
34 |
35 | public class PathValidationTests
36 | {
37 |
38 | [Test]
39 | public void CorrectPath()
40 | {
41 | try
42 | {
43 | IO.ValidatePath("Assets/Folder");
44 | }
45 | catch
46 | {
47 | Assert.Fail("A valid path should not throw an exception");
48 | }
49 | }
50 |
51 | [Test]
52 | public void LeadingSlash()
53 | {
54 | Assert.Throws(() =>
55 | {
56 | IO.ValidatePath("Assets/Folder/");
57 | }, "This path ends with a leading forward slash and this should fail.");
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/proj.unity/Assets/UnityIO/Editor/ContextMenus.cs:
--------------------------------------------------------------------------------
1 | using UnityEditor;
2 | using UnityEngine;
3 |
4 | namespace UnityIO
5 | {
6 | ///
7 | /// This class contains some useful content menus for Unity.
8 | ///
9 | public static class ContextMenus
10 | {
11 | [MenuItem("Assets/UnityIO/Copy System Path")]
12 | public static void CopySystemPath()
13 | {
14 | // Get our object.
15 | Object selectedObject = Selection.activeObject;
16 | // Get the system path
17 | string systemPath = Application.dataPath;
18 | // Get asset path
19 | string asssetPath = UnityEditor.AssetDatabase.GetAssetPath(selectedObject);
20 | // Make sure we have a path
21 | if(string.IsNullOrEmpty(asssetPath))
22 | {
23 | return;
24 | }
25 | // Remove the 'Assets' part.
26 | asssetPath = asssetPath.Substring(6, asssetPath.Length - 6);
27 | // full path
28 | string fullPath = systemPath + asssetPath;
29 | // print
30 | EditorGUIUtility.systemCopyBuffer = fullPath;
31 |
32 | }
33 |
34 | [MenuItem("Assets/UnityIO/Copy Unity Path")]
35 | public static void CopyAssetPath()
36 | {
37 | // Get our object.
38 | Object selectedObject = Selection.activeObject;
39 | // return it's path
40 | string unityPath = UnityEditor.AssetDatabase.GetAssetPath(selectedObject);
41 | // COpy to buffer
42 | EditorGUIUtility.systemCopyBuffer = unityPath;
43 | }
44 |
45 | [MenuItem("Assets/UnityIO/Copy Unity Path", true)]
46 | [MenuItem("Assets/UnityIO/Copy System Path", true)]
47 | public static bool CopyPathValidation()
48 | {
49 | Object selected = Selection.activeObject;
50 |
51 | if(selected == null)
52 | {
53 | return false;
54 | }
55 |
56 | // Things that exist in the scene don't have an asset path.
57 | return !string.IsNullOrEmpty(UnityEditor.AssetDatabase.GetAssetPath(selected));
58 | }
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/proj.unity/Assets/UnityIO/Editor/Unit Tests/EnumerationTests.cs:
--------------------------------------------------------------------------------
1 | /*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2 | UnityIO was released with an MIT License.
3 | Arther: Byron Mayne
4 | Twitter: @ByMayne
5 |
6 |
7 | MIT License
8 |
9 | Copyright(c) 2016 Byron Mayne
10 |
11 | Permission is hereby granted, free of charge, to any person obtaining a copy
12 | of this software and associated documentation files (the "Software"), to deal
13 | in the Software without restriction, including without limitation the rights
14 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15 | copies of the Software, and to permit persons to whom the Software is
16 | furnished to do so, subject to the following conditions:
17 |
18 | The above copyright notice and this permission notice shall be included in all
19 | copies or substantial portions of the Software.
20 |
21 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27 | SOFTWARE.
28 | >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>*/
29 |
30 | // Disable unused warning
31 | #pragma warning disable 0168
32 | using NUnit.Framework;
33 |
34 | public class EnumerationTests : UnityIOTestBase
35 | {
36 |
37 | [Test]
38 | [Description("This test looks inside the " + GetFilesTests.UNIT_TEST_LOADING_TEST_ASSETS + " directory and counts the total files. It should be constant")]
39 | public void EnumerationCount()
40 | {
41 | var dir = GetFilesTests.SetupAssetLoadingTest();
42 |
43 | int count = 0;
44 | foreach(var directory in dir)
45 | {
46 | count++;
47 | }
48 | // Test if our count is correct.
49 | Assert.AreEqual(count, 4, "There should be four files in the testing directory at " + GetFilesTests.UNIT_TEST_LOADING_TEST_ASSETS);
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/proj.unity/ProjectSettings/GraphicsSettings.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!30 &1
4 | GraphicsSettings:
5 | m_ObjectHideFlags: 0
6 | serializedVersion: 7
7 | m_Deferred:
8 | m_Mode: 1
9 | m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0}
10 | m_DeferredReflections:
11 | m_Mode: 1
12 | m_Shader: {fileID: 74, guid: 0000000000000000f000000000000000, type: 0}
13 | m_ScreenSpaceShadows:
14 | m_Mode: 1
15 | m_Shader: {fileID: 64, guid: 0000000000000000f000000000000000, type: 0}
16 | m_LegacyDeferred:
17 | m_Mode: 1
18 | m_Shader: {fileID: 63, guid: 0000000000000000f000000000000000, type: 0}
19 | m_DepthNormals:
20 | m_Mode: 1
21 | m_Shader: {fileID: 62, guid: 0000000000000000f000000000000000, type: 0}
22 | m_MotionVectors:
23 | m_Mode: 1
24 | m_Shader: {fileID: 75, guid: 0000000000000000f000000000000000, type: 0}
25 | m_LightHalo:
26 | m_Mode: 1
27 | m_Shader: {fileID: 105, guid: 0000000000000000f000000000000000, type: 0}
28 | m_LensFlare:
29 | m_Mode: 1
30 | m_Shader: {fileID: 102, guid: 0000000000000000f000000000000000, type: 0}
31 | m_AlwaysIncludedShaders:
32 | - {fileID: 7, guid: 0000000000000000f000000000000000, type: 0}
33 | - {fileID: 15104, guid: 0000000000000000f000000000000000, type: 0}
34 | - {fileID: 15105, guid: 0000000000000000f000000000000000, type: 0}
35 | - {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0}
36 | - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0}
37 | - {fileID: 10782, guid: 0000000000000000f000000000000000, type: 0}
38 | m_PreloadedShaders: []
39 | m_ShaderSettings_Tier1:
40 | useCascadedShadowMaps: 1
41 | standardShaderQuality: 2
42 | useReflectionProbeBoxProjection: 1
43 | useReflectionProbeBlending: 1
44 | m_ShaderSettings_Tier2:
45 | useCascadedShadowMaps: 1
46 | standardShaderQuality: 2
47 | useReflectionProbeBoxProjection: 1
48 | useReflectionProbeBlending: 1
49 | m_ShaderSettings_Tier3:
50 | useCascadedShadowMaps: 1
51 | standardShaderQuality: 2
52 | useReflectionProbeBoxProjection: 1
53 | useReflectionProbeBlending: 1
54 | m_BuildTargetShaderSettings: []
55 | m_LightmapStripping: 0
56 | m_FogStripping: 0
57 | m_LightmapKeepPlain: 1
58 | m_LightmapKeepDirCombined: 1
59 | m_LightmapKeepDirSeparate: 1
60 | m_LightmapKeepDynamicPlain: 1
61 | m_LightmapKeepDynamicDirCombined: 1
62 | m_LightmapKeepDynamicDirSeparate: 1
63 | m_FogKeepLinear: 1
64 | m_FogKeepExp: 1
65 | m_FogKeepExp2: 1
66 |
--------------------------------------------------------------------------------
/proj.unity/Assets/UnityIO/Editor/Unit Tests/ConvertPathTests.cs:
--------------------------------------------------------------------------------
1 | /*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2 | UnityIO was released with an MIT License.
3 | Arther: Byron Mayne
4 | Twitter: @ByMayne
5 |
6 |
7 | MIT License
8 |
9 | Copyright(c) 2016 Byron Mayne
10 |
11 | Permission is hereby granted, free of charge, to any person obtaining a copy
12 | of this software and associated documentation files (the "Software"), to deal
13 | in the Software without restriction, including without limitation the rights
14 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15 | copies of the Software, and to permit persons to whom the Software is
16 | furnished to do so, subject to the following conditions:
17 |
18 | The above copyright notice and this permission notice shall be included in all
19 | copies or substantial portions of the Software.
20 |
21 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27 | SOFTWARE.
28 | >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>*/
29 |
30 | // Disable unused warning
31 | #pragma warning disable 0168
32 |
33 | using NUnit.Framework;
34 | using UnityEngine;
35 | using UnityEditor;
36 | using UnityIO;
37 | using Object = UnityEngine.Object;
38 |
39 | public class ConvertPathTests : UnityIOTestBase
40 | {
41 | [Test]
42 | public void AssetPathTOSystemPathConvert()
43 | {
44 | string systemPath = Application.dataPath + "/UnityIO/Editor/Unit Tests/Loading Assets/Misc Prefab.prefab";
45 | string assetPath = "Assets/UnityIO/Editor/Unit Tests/Loading Assets/Misc Prefab.prefab";
46 | string result = IO.AssetPathToSystemPath(assetPath);
47 | Assert.AreEqual(systemPath, result, "The path did not convert correctly");
48 | }
49 |
50 | [Test]
51 | public void SystemToAssetPathConvert()
52 | {
53 | string systemPath = Application.dataPath + "/UnityIO/Editor/Unit Tests/Loading Assets/Misc Prefab.prefab";
54 | string assetPath = "Assets/UnityIO/Editor/Unit Tests/Loading Assets/Misc Prefab.prefab";
55 | string result = IO.SystemToAssetPath(systemPath);
56 | Assert.AreEqual(assetPath, result, "The path did not convert correctly");
57 | }
58 | }
59 |
60 |
61 |
--------------------------------------------------------------------------------
/proj.unity/Assets/UnityIO/Editor/Unit Tests/UnityIOTestBase.cs:
--------------------------------------------------------------------------------
1 | /*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2 | UnityIO was released with an MIT License.
3 | Arther: Byron Mayne
4 | Twitter: @ByMayne
5 |
6 |
7 | MIT License
8 |
9 | Copyright(c) 2016 Byron Mayne
10 |
11 | Permission is hereby granted, free of charge, to any person obtaining a copy
12 | of this software and associated documentation files (the "Software"), to deal
13 | in the Software without restriction, including without limitation the rights
14 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15 | copies of the Software, and to permit persons to whom the Software is
16 | furnished to do so, subject to the following conditions:
17 |
18 | The above copyright notice and this permission notice shall be included in all
19 | copies or substantial portions of the Software.
20 |
21 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27 | SOFTWARE.
28 | >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>*/
29 |
30 | using NUnit.Framework;
31 | using System;
32 | using UnityEngine;
33 | using UnityIO;
34 | using UnityIO.Interfaces;
35 |
36 | public class UnityIOTestBase
37 | {
38 | public const string UNIT_TEST_LOADING_TEST_ASSETS = "UnityIO/Editor/Unit Tests/Loading Assets";
39 |
40 | ///
41 | /// Returns back an IDirectory for testing asset loading.
42 | ///
43 | ///
44 | public static IDirectory SetupAssetLoadingTest()
45 | {
46 | // We can only test if our testing directory exists
47 | Assume.That(IO.Root.SubDirectoryExists(UNIT_TEST_LOADING_TEST_ASSETS), "The testing directory this test is looking for does not exists at path '" + UNIT_TEST_LOADING_TEST_ASSETS + "'.");
48 | // Get our loading area
49 | return IO.Root[UNIT_TEST_LOADING_TEST_ASSETS];
50 | }
51 |
52 | ///
53 | /// Logs to the Unity Console.
54 | ///
55 | public void UnityLog(string log)
56 | {
57 | Debug.Log(log);
58 | }
59 |
60 | ///
61 | /// Logs to the test's console.
62 | ///
63 | public void TestLog(string log)
64 | {
65 | Console.WriteLine(log);
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Set default behavior to automatically normalize line endings.
3 | ###############################################################################
4 | * text=auto
5 |
6 | ###############################################################################
7 | # Set default behavior for command prompt diff.
8 | #
9 | # This is need for earlier builds of msysgit that does not have it on by
10 | # default for csharp files.
11 | # Note: This is only used by command line
12 | ###############################################################################
13 | #*.cs diff=csharp
14 |
15 | ###############################################################################
16 | # Set the merge driver for project and solution files
17 | #
18 | # Merging from the command prompt will add diff markers to the files if there
19 | # are conflicts (Merging from VS is not affected by the settings below, in VS
20 | # the diff markers are never inserted). Diff markers may cause the following
21 | # file extensions to fail to load in VS. An alternative would be to treat
22 | # these files as binary and thus will always conflict and require user
23 | # intervention with every merge. To do so, just uncomment the entries below
24 | ###############################################################################
25 | #*.sln merge=binary
26 | #*.csproj merge=binary
27 | #*.vbproj merge=binary
28 | #*.vcxproj merge=binary
29 | #*.vcproj merge=binary
30 | #*.dbproj merge=binary
31 | #*.fsproj merge=binary
32 | #*.lsproj merge=binary
33 | #*.wixproj merge=binary
34 | #*.modelproj merge=binary
35 | #*.sqlproj merge=binary
36 | #*.wwaproj merge=binary
37 |
38 | ###############################################################################
39 | # behavior for image files
40 | #
41 | # image files are treated as binary by default.
42 | ###############################################################################
43 | #*.jpg binary
44 | #*.png binary
45 | #*.gif binary
46 |
47 | ###############################################################################
48 | # diff behavior for common document formats
49 | #
50 | # Convert binary document formats to text before diffing them. This feature
51 | # is only available from the command line. Turn it on by uncommenting the
52 | # entries below.
53 | ###############################################################################
54 | #*.doc diff=astextplain
55 | #*.DOC diff=astextplain
56 | #*.docx diff=astextplain
57 | #*.DOCX diff=astextplain
58 | #*.dot diff=astextplain
59 | #*.DOT diff=astextplain
60 | #*.pdf diff=astextplain
61 | #*.PDF diff=astextplain
62 | #*.rtf diff=astextplain
63 | #*.RTF diff=astextplain
64 |
--------------------------------------------------------------------------------
/proj.unity/Assets/UnityIO/Editor/Unit Tests/Loading Assets/Misc Prefab.prefab:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!1001 &100100000
4 | Prefab:
5 | m_ObjectHideFlags: 1
6 | serializedVersion: 2
7 | m_Modification:
8 | m_TransformParent: {fileID: 0}
9 | m_Modifications: []
10 | m_RemovedComponents: []
11 | m_ParentPrefab: {fileID: 0}
12 | m_RootGameObject: {fileID: 1000010781637270}
13 | m_IsPrefabParent: 1
14 | --- !u!1 &1000010781637270
15 | GameObject:
16 | m_ObjectHideFlags: 0
17 | m_PrefabParentObject: {fileID: 0}
18 | m_PrefabInternal: {fileID: 100100000}
19 | serializedVersion: 4
20 | m_Component:
21 | - 4: {fileID: 4000011508447898}
22 | - 33: {fileID: 33000010640171400}
23 | - 135: {fileID: 135000012790499214}
24 | - 23: {fileID: 23000010649922698}
25 | m_Layer: 0
26 | m_Name: Misc Prefab
27 | m_TagString: Untagged
28 | m_Icon: {fileID: 0}
29 | m_NavMeshLayer: 0
30 | m_StaticEditorFlags: 0
31 | m_IsActive: 1
32 | --- !u!4 &4000011508447898
33 | Transform:
34 | m_ObjectHideFlags: 1
35 | m_PrefabParentObject: {fileID: 0}
36 | m_PrefabInternal: {fileID: 100100000}
37 | m_GameObject: {fileID: 1000010781637270}
38 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
39 | m_LocalPosition: {x: 0, y: 0, z: 0}
40 | m_LocalScale: {x: 1, y: 1, z: 1}
41 | m_Children: []
42 | m_Father: {fileID: 0}
43 | m_RootOrder: 0
44 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
45 | --- !u!23 &23000010649922698
46 | MeshRenderer:
47 | m_ObjectHideFlags: 1
48 | m_PrefabParentObject: {fileID: 0}
49 | m_PrefabInternal: {fileID: 100100000}
50 | m_GameObject: {fileID: 1000010781637270}
51 | m_Enabled: 1
52 | m_CastShadows: 1
53 | m_ReceiveShadows: 1
54 | m_MotionVectors: 1
55 | m_LightProbeUsage: 1
56 | m_ReflectionProbeUsage: 1
57 | m_Materials:
58 | - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0}
59 | m_SubsetIndices:
60 | m_StaticBatchRoot: {fileID: 0}
61 | m_ProbeAnchor: {fileID: 0}
62 | m_LightProbeVolumeOverride: {fileID: 0}
63 | m_ScaleInLightmap: 1
64 | m_PreserveUVs: 1
65 | m_IgnoreNormalsForChartDetection: 0
66 | m_ImportantGI: 0
67 | m_SelectedWireframeHidden: 0
68 | m_MinimumChartSize: 4
69 | m_AutoUVMaxDistance: 0.5
70 | m_AutoUVMaxAngle: 89
71 | m_LightmapParameters: {fileID: 0}
72 | m_SortingLayerID: 0
73 | m_SortingOrder: 0
74 | --- !u!33 &33000010640171400
75 | MeshFilter:
76 | m_ObjectHideFlags: 1
77 | m_PrefabParentObject: {fileID: 0}
78 | m_PrefabInternal: {fileID: 100100000}
79 | m_GameObject: {fileID: 1000010781637270}
80 | m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0}
81 | --- !u!135 &135000012790499214
82 | SphereCollider:
83 | m_ObjectHideFlags: 1
84 | m_PrefabParentObject: {fileID: 0}
85 | m_PrefabInternal: {fileID: 100100000}
86 | m_GameObject: {fileID: 1000010781637270}
87 | m_Material: {fileID: 0}
88 | m_IsTrigger: 0
89 | m_Enabled: 1
90 | serializedVersion: 2
91 | m_Radius: 0.5
92 | m_Center: {x: 0, y: 0, z: 0}
93 |
--------------------------------------------------------------------------------
/proj.unity/Assets/UnityIO/Editor/Unit Tests/Loading Assets/Prefabs/Weapon.prefab:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!1001 &100100000
4 | Prefab:
5 | m_ObjectHideFlags: 1
6 | serializedVersion: 2
7 | m_Modification:
8 | m_TransformParent: {fileID: 0}
9 | m_Modifications: []
10 | m_RemovedComponents: []
11 | m_ParentPrefab: {fileID: 0}
12 | m_RootGameObject: {fileID: 1000013934870762}
13 | m_IsPrefabParent: 1
14 | --- !u!1 &1000013934870762
15 | GameObject:
16 | m_ObjectHideFlags: 0
17 | m_PrefabParentObject: {fileID: 0}
18 | m_PrefabInternal: {fileID: 100100000}
19 | serializedVersion: 4
20 | m_Component:
21 | - 4: {fileID: 4000012708590042}
22 | - 33: {fileID: 33000011790802156}
23 | - 65: {fileID: 65000013194829368}
24 | - 23: {fileID: 23000010245363816}
25 | m_Layer: 0
26 | m_Name: Weapon
27 | m_TagString: Untagged
28 | m_Icon: {fileID: 0}
29 | m_NavMeshLayer: 0
30 | m_StaticEditorFlags: 0
31 | m_IsActive: 1
32 | --- !u!4 &4000012708590042
33 | Transform:
34 | m_ObjectHideFlags: 1
35 | m_PrefabParentObject: {fileID: 0}
36 | m_PrefabInternal: {fileID: 100100000}
37 | m_GameObject: {fileID: 1000013934870762}
38 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
39 | m_LocalPosition: {x: 0, y: 0, z: 0}
40 | m_LocalScale: {x: 1, y: 1, z: 1}
41 | m_Children: []
42 | m_Father: {fileID: 0}
43 | m_RootOrder: 0
44 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
45 | --- !u!23 &23000010245363816
46 | MeshRenderer:
47 | m_ObjectHideFlags: 1
48 | m_PrefabParentObject: {fileID: 0}
49 | m_PrefabInternal: {fileID: 100100000}
50 | m_GameObject: {fileID: 1000013934870762}
51 | m_Enabled: 1
52 | m_CastShadows: 1
53 | m_ReceiveShadows: 1
54 | m_MotionVectors: 1
55 | m_LightProbeUsage: 1
56 | m_ReflectionProbeUsage: 1
57 | m_Materials:
58 | - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0}
59 | m_SubsetIndices:
60 | m_StaticBatchRoot: {fileID: 0}
61 | m_ProbeAnchor: {fileID: 0}
62 | m_LightProbeVolumeOverride: {fileID: 0}
63 | m_ScaleInLightmap: 1
64 | m_PreserveUVs: 1
65 | m_IgnoreNormalsForChartDetection: 0
66 | m_ImportantGI: 0
67 | m_SelectedWireframeHidden: 0
68 | m_MinimumChartSize: 4
69 | m_AutoUVMaxDistance: 0.5
70 | m_AutoUVMaxAngle: 89
71 | m_LightmapParameters: {fileID: 0}
72 | m_SortingLayerID: 0
73 | m_SortingOrder: 0
74 | --- !u!33 &33000011790802156
75 | MeshFilter:
76 | m_ObjectHideFlags: 1
77 | m_PrefabParentObject: {fileID: 0}
78 | m_PrefabInternal: {fileID: 100100000}
79 | m_GameObject: {fileID: 1000013934870762}
80 | m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
81 | --- !u!65 &65000013194829368
82 | BoxCollider:
83 | m_ObjectHideFlags: 1
84 | m_PrefabParentObject: {fileID: 0}
85 | m_PrefabInternal: {fileID: 100100000}
86 | m_GameObject: {fileID: 1000013934870762}
87 | m_Material: {fileID: 0}
88 | m_IsTrigger: 0
89 | m_Enabled: 1
90 | serializedVersion: 2
91 | m_Size: {x: 1, y: 1, z: 1}
92 | m_Center: {x: 0, y: 0, z: 0}
93 |
--------------------------------------------------------------------------------
/proj.unity/Assets/UnityIO/Interfaces/IDirectory.cs:
--------------------------------------------------------------------------------
1 | /*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2 | UnityIO was released with an MIT License.
3 | Arther: Byron Mayne
4 | Twitter: @ByMayne
5 |
6 |
7 | MIT License
8 |
9 | Copyright(c) 2016 Byron Mayne
10 |
11 | Permission is hereby granted, free of charge, to any person obtaining a copy
12 | of this software and associated documentation files (the "Software"), to deal
13 | in the Software without restriction, including without limitation the rights
14 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15 | copies of the Software, and to permit persons to whom the Software is
16 | furnished to do so, subject to the following conditions:
17 |
18 | The above copyright notice and this permission notice shall be included in all
19 | copies or substantial portions of the Software.
20 |
21 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27 | SOFTWARE.
28 | >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>*/
29 |
30 | using System;
31 | using System.Collections.Generic;
32 | using Object = UnityEngine.Object;
33 |
34 | namespace UnityIO.Interfaces
35 | {
36 | public interface IDirectory : IEnumerable, IComparer, IEquatable
37 | {
38 | string path { get; }
39 |
40 | ///
41 | /// Gets the system path of this file.
42 | ///
43 | string systemPath { get; }
44 |
45 | ///
46 | /// Returns just the name of the current directory.
47 | ///
48 | string name { get; }
49 |
50 | ///
51 | /// Get's the parent of this directory or a null file if this
52 | /// is the root.
53 | ///
54 | IDirectory parent { get; }
55 |
56 | void Delete();
57 | void Duplicate();
58 | void Duplicate(string newName);
59 |
60 | void Move(string targetDirectory);
61 | void Move(IDirectory targetDirectory);
62 |
63 | void Rename(string newName);
64 |
65 | void DeleteSubDirectory(string directroyName);
66 | bool SubDirectoryExists(string directoryName);
67 |
68 | bool IsEmpty(bool assetsOnly);
69 |
70 | // Directories
71 | IDirectory this[string name] { get; }
72 | IDirectory CreateDirectory(string name);
73 |
74 |
75 |
76 | // Conditionals
77 | IDirectory IfSubDirectoryExists(string name);
78 | IDirectory IfSubDirectoryDoesNotExist(string name);
79 | IDirectory IfEmpty(bool assetsOnly);
80 | IDirectory IfNotEmpty(bool assetsOnly);
81 |
82 | // IFIle
83 | IFile IfFileExists(string name);
84 | IFile CreateFile(string name, T asset) where T : Object;
85 |
86 | // IFiles
87 | IFiles GetFiles();
88 | IFiles GetFiles(bool recursive);
89 | IFiles GetFiles(string filter);
90 | IFiles GetFiles(string filter, bool recursive);
91 | }
92 | }
93 |
--------------------------------------------------------------------------------
/proj.unity/Assets/UnityIO/Files.cs:
--------------------------------------------------------------------------------
1 | /*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2 | UnityIO was released with an MIT License.
3 | Arther: Byron Mayne
4 | Twitter: @ByMayne
5 |
6 |
7 | MIT License
8 |
9 | Copyright(c) 2016 Byron Mayne
10 |
11 | Permission is hereby granted, free of charge, to any person obtaining a copy
12 | of this software and associated documentation files (the "Software"), to deal
13 | in the Software without restriction, including without limitation the rights
14 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15 | copies of the Software, and to permit persons to whom the Software is
16 | furnished to do so, subject to the following conditions:
17 |
18 | The above copyright notice and this permission notice shall be included in all
19 | copies or substantial portions of the Software.
20 |
21 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27 | SOFTWARE.
28 | >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>*/
29 |
30 | using UnityIO.Interfaces;
31 | using System.Collections.Generic;
32 | using UnityEngine;
33 |
34 | namespace UnityIO.Classes
35 | {
36 | public class Files : List, IFiles
37 | {
38 | ///
39 | /// A delegate used for modifying files.
40 | ///
41 | public delegate void FileActionDelegate(IFile file);
42 |
43 | ///
44 | /// Returns a list of all assets contained within that
45 | /// are of the type T.
46 | ///
47 | public IList LoadAllofType() where T : Object
48 | {
49 | List result = new List();
50 | for (int i = 0; i < Count; i++)
51 | {
52 | T loadedObj = this[i].LoadAsset();
53 | if (loadedObj != null)
54 | {
55 | result.Add(loadedObj);
56 | }
57 | }
58 | return result;
59 | }
60 |
61 | ///
62 | /// Returns the first file in the list of files or if no files
63 | /// exist returns a null file.
64 | ///
65 | public IFile FirstOrDefault()
66 | {
67 | if (Count > 0)
68 | {
69 | return this[0];
70 | }
71 | else
72 | {
73 | return NullFile.SHARED_INSTANCE;
74 | }
75 | }
76 |
77 | ///
78 | /// Does an action on all files in this list of files.
79 | ///
80 | /// The action you want to take.
81 | public void ForEach(FileActionDelegate action)
82 | {
83 | if(action == null)
84 | {
85 | throw new System.ArgumentNullException("Can't run a null action on all files");
86 | }
87 |
88 | for (int i = Count - 1; i >= 0; i--)
89 | {
90 | action(this[i]);
91 | }
92 | }
93 | }
94 | }
95 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributor Covenant Code of Conduct
2 |
3 | ## Our Pledge
4 |
5 | In the interest of fostering an open and welcoming environment, we as
6 | contributors and maintainers pledge to making participation in our project and
7 | our community a harassment-free experience for everyone, regardless of age, body
8 | size, disability, ethnicity, gender identity and expression, level of experience,
9 | nationality, personal appearance, race, religion, or sexual identity and
10 | orientation.
11 |
12 | ## Our Standards
13 |
14 | Examples of behavior that contributes to creating a positive environment
15 | include:
16 |
17 | * Using welcoming and inclusive language
18 | * Being respectful of differing viewpoints and experiences
19 | * Gracefully accepting constructive criticism
20 | * Focusing on what is best for the community
21 | * Showing empathy towards other community members
22 |
23 | Examples of unacceptable behavior by participants include:
24 |
25 | * The use of sexualized language or imagery and unwelcome sexual attention or
26 | advances
27 | * Trolling, insulting/derogatory comments, and personal or political attacks
28 | * Public or private harassment
29 | * Publishing others' private information, such as a physical or electronic
30 | address, without explicit permission
31 | * Other conduct which could reasonably be considered inappropriate in a
32 | professional setting
33 |
34 | ## Our Responsibilities
35 |
36 | Project maintainers are responsible for clarifying the standards of acceptable
37 | behavior and are expected to take appropriate and fair corrective action in
38 | response to any instances of unacceptable behavior.
39 |
40 | Project maintainers have the right and responsibility to remove, edit, or
41 | reject comments, commits, code, wiki edits, issues, and other contributions
42 | that are not aligned to this Code of Conduct, or to ban temporarily or
43 | permanently any contributor for other behaviors that they deem inappropriate,
44 | threatening, offensive, or harmful.
45 |
46 | ## Scope
47 |
48 | This Code of Conduct applies both within project spaces and in public spaces
49 | when an individual is representing the project or its community. Examples of
50 | representing a project or community include using an official project e-mail
51 | address, posting via an official social media account, or acting as an appointed
52 | representative at an online or offline event. Representation of a project may be
53 | further defined and clarified by project maintainers.
54 |
55 | ## Enforcement
56 |
57 | Instances of abusive, harassing, or otherwise unacceptable behavior may be
58 | reported by contacting the project team at ByronMayne+UnityIO@gmail.com. All
59 | complaints will be reviewed and investigated and will result in a response that
60 | is deemed necessary and appropriate to the circumstances. The project team is
61 | obligated to maintain confidentiality with regard to the reporter of an incident.
62 | Further details of specific enforcement policies may be posted separately.
63 |
64 | Project maintainers who do not follow or enforce the Code of Conduct in good
65 | faith may face temporary or permanent repercussions as determined by other
66 | members of the project's leadership.
67 |
68 | ## Attribution
69 |
70 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71 | available at [http://contributor-covenant.org/version/1/4][version]
72 |
73 | [homepage]: http://contributor-covenant.org
74 | [version]: http://contributor-covenant.org/version/1/4/
75 |
--------------------------------------------------------------------------------
/proj.unity/Assets/UnityIO/Editor/Unit Tests/CreatingDirectoryTests.cs:
--------------------------------------------------------------------------------
1 | /*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2 | UnityIO was released with an MIT License.
3 | Arther: Byron Mayne
4 | Twitter: @ByMayne
5 |
6 |
7 | MIT License
8 |
9 | Copyright(c) 2016 Byron Mayne
10 |
11 | Permission is hereby granted, free of charge, to any person obtaining a copy
12 | of this software and associated documentation files (the "Software"), to deal
13 | in the Software without restriction, including without limitation the rights
14 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15 | copies of the Software, and to permit persons to whom the Software is
16 | furnished to do so, subject to the following conditions:
17 |
18 | The above copyright notice and this permission notice shall be included in all
19 | copies or substantial portions of the Software.
20 |
21 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27 | SOFTWARE.
28 | >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>*/
29 |
30 | // Disable unused warning
31 | #pragma warning disable 0168
32 | using NUnit.Framework;
33 | using UnityIO;
34 |
35 | public class CreatingDirectory
36 | {
37 |
38 | [Test]
39 | public void CreateRootLevelDirectory()
40 | {
41 | IO.Root.CreateDirectory("CreateRootLevelDirectory");
42 | Assert.True(IO.Root.SubDirectoryExists("CreateRootLevelDirectory"));
43 | IO.Root.DeleteSubDirectory("CreateRootLevelDirectory");
44 | }
45 |
46 | [Test]
47 | public void CreateNestedDirectoryOneStep()
48 | {
49 | IO.Root.CreateDirectory("CreateNestedDirectoryOneStep/Folder One");
50 | Assert.True(IO.Root.SubDirectoryExists("CreateNestedDirectoryOneStep/Folder One"));
51 | IO.Root.DeleteSubDirectory("CreateNestedDirectoryOneStep");
52 | }
53 |
54 | [Test]
55 | public void CreateNestedDirectoryMultiStep()
56 | {
57 | IO.Root.CreateDirectory("CreateNestedDirectoryMultiStep").CreateDirectory("Folder One").CreateDirectory("Folder Two");
58 | Assert.True(IO.Root.SubDirectoryExists("CreateNestedDirectoryMultiStep/Folder One"));
59 | Assert.True(IO.Root.SubDirectoryExists("CreateNestedDirectoryMultiStep/Folder One/Folder Two"));
60 | IO.Root.DeleteSubDirectory("CreateNestedDirectoryMultiStep");
61 | }
62 |
63 | [Test]
64 | public void CreateNestedPreExistingRoot()
65 | {
66 | // Create the root by itself.
67 | IO.Root.CreateDirectory("CreateNestedDirectoryMultiStep");
68 | // Create it again with a child
69 | IO.Root.CreateDirectory("CreateNestedDirectoryMultiStep").CreateDirectory("MultiFolder_Temp");
70 | // Check if the child exists at the root
71 | bool directroyExistsInRoot = IO.Root.SubDirectoryExists("MultiFolder_Temp");
72 | // Clean up the root folder
73 | IO.Root["CreateNestedDirectoryMultiStep"].Delete();
74 | // If the test failed this folder will exist so we want to cleanup
75 | IO.Root.IfSubDirectoryExists("CreateNestedDirectoryMultiStep").Delete();
76 | // Fail or pass the test.
77 | Assert.False(directroyExistsInRoot);
78 | }
79 |
80 | }
81 |
--------------------------------------------------------------------------------
/proj.unity/Assets/UnityIO/Exceptions.cs:
--------------------------------------------------------------------------------
1 | /*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2 | UnityIO was released with an MIT License.
3 | Arther: Byron Mayne
4 | Twitter: @ByMayne
5 |
6 |
7 | MIT License
8 |
9 | Copyright(c) 2016 Byron Mayne
10 |
11 | Permission is hereby granted, free of charge, to any person obtaining a copy
12 | of this software and associated documentation files (the "Software"), to deal
13 | in the Software without restriction, including without limitation the rights
14 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15 | copies of the Software, and to permit persons to whom the Software is
16 | furnished to do so, subject to the following conditions:
17 |
18 | The above copyright notice and this permission notice shall be included in all
19 | copies or substantial portions of the Software.
20 |
21 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27 | SOFTWARE.
28 | >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>*/
29 |
30 | using System;
31 |
32 | namespace UnityIO.Exceptions
33 | {
34 | public class FileNotFoundException : Exception
35 | {
36 | public FileNotFoundException(string message) : base(message)
37 | {
38 |
39 | }
40 | }
41 |
42 | public class FileAlreadyExistsException : Exception
43 | {
44 | public FileAlreadyExistsException(string message) : base(message)
45 | {
46 |
47 | }
48 | }
49 |
50 | public class DirectoryNotFoundException : Exception
51 | {
52 | public DirectoryNotFoundException(string message) : base(message)
53 | {
54 |
55 | }
56 | }
57 |
58 | public class MoveException : Exception
59 | {
60 | public static string Format(string message, string from, string to)
61 | {
62 | return "Unable to move " + from + " to " + to + " because " + message;
63 | }
64 |
65 | public MoveException(string message, string from, string to) : base(Format(message, from, to))
66 | {
67 | }
68 | }
69 |
70 | public class RenameException : Exception
71 | {
72 | public static string Format(string message, string from, string to)
73 | {
74 | return "Unable to rename " + from + " to " + to + " because " + message;
75 | }
76 |
77 | public RenameException(string message, string from, string to) : base(Format(message, from, to))
78 | {
79 | }
80 | }
81 |
82 | ///
83 | /// This exception is thrown when you try to rename or move a directory and one
84 | /// already exists at that location.
85 | ///
86 | public class DirectroyAlreadyExistsException : Exception
87 | {
88 | public DirectroyAlreadyExistsException(string message) : base(message)
89 | {
90 | }
91 | }
92 |
93 | ///
94 | /// This exception is thrown when you try to name a file or directory that contains
95 | /// invalid characters.
96 | ///
97 | public class InvalidNameException : Exception
98 | {
99 | public InvalidNameException(string message) : base(message)
100 | {
101 | }
102 | }
103 | }
104 |
--------------------------------------------------------------------------------
/proj.unity/Assets/UnityIO/Interfaces/IFile.cs:
--------------------------------------------------------------------------------
1 | /*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2 | UnityIO was released with an MIT License.
3 | Arther: Byron Mayne
4 | Twitter: @ByMayne
5 |
6 |
7 | IT License
8 |
9 | Copyright(c) 2016 Byron Mayne
10 |
11 | Permission is hereby granted, free of charge, to any person obtaining a copy
12 | of this software and associated documentation files (the "Software"), to deal
13 | in the Software without restriction, including without limitation the rights
14 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15 | copies of the Software, and to permit persons to whom the Software is
16 | furnished to do so, subject to the following conditions:
17 |
18 | The above copyright notice and this permission notice shall be included in all
19 | copies or substantial portions of the Software.
20 |
21 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27 | SOFTWARE.
28 | >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>*/
29 | using UnityEngine;
30 |
31 | namespace UnityIO.Interfaces
32 | {
33 | ///
34 | /// IFile is the root interface that we use to handle all file actions. to
35 | /// see the implementation.
36 | ///
37 | public interface IFile
38 | {
39 | ///
40 | /// Gets the path to this file starting from the root of the Unity project.
41 | ///
42 | string path { get; }
43 |
44 | ///
45 | /// Gets the name of this file with it's extension included.
46 | ///
47 | string name { get; }
48 |
49 | ///
50 | /// Gets the name of this file without it's extension.
51 | ///
52 | string nameWithoutExtension { get; }
53 |
54 | ///
55 | /// Gets the extension of this file.
56 | ///
57 | string extension { get; }
58 |
59 | ///
60 | /// Returns the back directory that this file exists in.
61 | ///
62 | IDirectory directory { get; }
63 |
64 | ///
65 | /// Deletes this file.
66 | ///
67 | void Delete();
68 |
69 | ///
70 | /// Renames the files throws an exception if a file already exists with the same name.
71 | ///
72 | ///
73 | void Rename(string name);
74 |
75 | ///
76 | /// Moves a file from one location to another will force the name to be unique
77 | /// if a file already exists with the same name.
78 | ///
79 | ///
80 | void Move(string directory);
81 |
82 | ///
83 | /// Moves a file from one location to another will force the name to be unique
84 | /// if a file already exists with the same name.
85 | ///
86 | ///
87 | void Move(IDirectory directory);
88 |
89 | ///
90 | /// Copies the file on disk and will force it to have a unique name (appending a number to
91 | /// the end.
92 | ///
93 | IFile Duplicate();
94 |
95 | ///
96 | /// Copies the file on disk and renames it. Name must be unique or an exception is thrown.
97 | ///
98 | IFile Duplicate(string newName);
99 |
100 | ///
101 | /// Loads the asset that this file points too.
102 | ///
103 | ///
104 | Object LoadAsset();
105 |
106 | ///
107 | /// Load a type of from disk that this file points too.
108 | ///
109 | /// The type of object you want to load
110 | T LoadAsset() where T : Object;
111 | }
112 | }
113 |
--------------------------------------------------------------------------------
/proj.unity/Assets/UnityIO/Editor/Unit Tests/GetFilesTests.cs:
--------------------------------------------------------------------------------
1 | /*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2 | UnityIO was released with an MIT License.
3 | Arther: Byron Mayne
4 | Twitter: @ByMayne
5 |
6 |
7 | MIT License
8 |
9 | Copyright(c) 2016 Byron Mayne
10 |
11 | Permission is hereby granted, free of charge, to any person obtaining a copy
12 | of this software and associated documentation files (the "Software"), to deal
13 | in the Software without restriction, including without limitation the rights
14 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15 | copies of the Software, and to permit persons to whom the Software is
16 | furnished to do so, subject to the following conditions:
17 |
18 | The above copyright notice and this permission notice shall be included in all
19 | copies or substantial portions of the Software.
20 |
21 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27 | SOFTWARE.
28 | >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>*/
29 |
30 | using NUnit.Framework;
31 | using UnityIO;
32 | using UnityIO.Interfaces;
33 |
34 | public class GetFilesTests : UnityIOTestBase
35 | {
36 | [Test(Description = "Check if you can find assets only at the top level in " + UNIT_TEST_LOADING_TEST_ASSETS)]
37 | public void GetTopLevelFiles()
38 | {
39 | // Setup our test.
40 | var loadingDir = SetupAssetLoadingTest();
41 | // Load all our assets
42 | var files = loadingDir.GetFiles();
43 | // Should only be root level which has a total of 3 files.
44 | Assert.AreEqual(files.Count, 3, "There should be 3 files in the root of the testing directory");
45 | }
46 |
47 | [Test(Description = "Check if you can find assets only at the top level with filter in " + UNIT_TEST_LOADING_TEST_ASSETS)]
48 | public void GetRecursiveFiles()
49 | {
50 | // Setup our test.
51 | var loadingDir = SetupAssetLoadingTest();
52 | // Get all
53 | var files = loadingDir.GetFiles(recursive: true);
54 | // Should be 10 assets
55 | Assert.AreEqual(files.Count, 10, "There should be 10 files in the testing directory");
56 | }
57 |
58 | [Test(Description = "Checks if you can verify if you can find only assets in the top level directory with a filter. In this case any file with the .anim extension in " + UNIT_TEST_LOADING_TEST_ASSETS)]
59 | public void GetTopLevelWithFilters()
60 | {
61 | // Setup our test.
62 | var loadingDir = SetupAssetLoadingTest();
63 | // We are going to try to only find files ending with .anim
64 | var files = loadingDir.GetFiles(filter:"*.anim");
65 | // There should be four.
66 | Assert.AreEqual(files.Count, 1, "There should be 1 file at the root that ends with .anim in our testing directory");
67 | }
68 |
69 | [Test(Description = "Checks if you can verify if you can find all assets with a filter. In this case any file with the .anim extension in " + UNIT_TEST_LOADING_TEST_ASSETS)]
70 | public void GetRecursiveWithFilters()
71 | {
72 | // Setup our test.
73 | var loadingDir = SetupAssetLoadingTest();
74 | // We are going to try to only find files ending with .anim
75 | var files = loadingDir.GetFiles(filter: "*.anim", recursive:true);
76 | // There should be four.
77 | Assert.AreEqual(files.Count, 4, "There should be 1 file at the root that ends with .anim in our testing directory");
78 | }
79 |
80 | [Test(Description = "Test to make sure the meta information about the file is correct")]
81 | public void FileNameProperties()
82 | {
83 | // Setup our test.
84 | var loadingDir = SetupAssetLoadingTest();
85 | // We are going to try to only find files ending with .anim
86 | var file = loadingDir.GetFiles(filter: "*.anim").FirstOrDefault();
87 | // Make sure it's the correct directory.
88 | Assert.AreEqual(loadingDir.path, file.directory.path, "The directory of the file does not match.");
89 | // Make sure it's the correct extension.
90 | Assert.AreEqual(".anim", file.extension, "The extension of this class should be '.anim'.");
91 | // Make sure it's the correct extension.
92 | Assert.AreEqual("Misc Animation", file.nameWithoutExtension, "The name of this class is not correct.");
93 | }
94 | }
95 |
--------------------------------------------------------------------------------
/proj.unity/ProjectSettings/QualitySettings.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!47 &1
4 | QualitySettings:
5 | m_ObjectHideFlags: 0
6 | serializedVersion: 5
7 | m_CurrentQuality: 5
8 | m_QualitySettings:
9 | - serializedVersion: 2
10 | name: Fastest
11 | pixelLightCount: 0
12 | shadows: 0
13 | shadowResolution: 0
14 | shadowProjection: 1
15 | shadowCascades: 1
16 | shadowDistance: 15
17 | shadowNearPlaneOffset: 2
18 | shadowCascade2Split: 0.33333334
19 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667}
20 | blendWeights: 1
21 | textureQuality: 1
22 | anisotropicTextures: 0
23 | antiAliasing: 0
24 | softParticles: 0
25 | softVegetation: 0
26 | realtimeReflectionProbes: 0
27 | billboardsFaceCameraPosition: 0
28 | vSyncCount: 0
29 | lodBias: 0.3
30 | maximumLODLevel: 0
31 | particleRaycastBudget: 4
32 | asyncUploadTimeSlice: 2
33 | asyncUploadBufferSize: 4
34 | excludedTargetPlatforms: []
35 | - serializedVersion: 2
36 | name: Fast
37 | pixelLightCount: 0
38 | shadows: 0
39 | shadowResolution: 0
40 | shadowProjection: 1
41 | shadowCascades: 1
42 | shadowDistance: 20
43 | shadowNearPlaneOffset: 2
44 | shadowCascade2Split: 0.33333334
45 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667}
46 | blendWeights: 2
47 | textureQuality: 0
48 | anisotropicTextures: 0
49 | antiAliasing: 0
50 | softParticles: 0
51 | softVegetation: 0
52 | realtimeReflectionProbes: 0
53 | billboardsFaceCameraPosition: 0
54 | vSyncCount: 0
55 | lodBias: 0.4
56 | maximumLODLevel: 0
57 | particleRaycastBudget: 16
58 | asyncUploadTimeSlice: 2
59 | asyncUploadBufferSize: 4
60 | excludedTargetPlatforms: []
61 | - serializedVersion: 2
62 | name: Simple
63 | pixelLightCount: 1
64 | shadows: 1
65 | shadowResolution: 0
66 | shadowProjection: 1
67 | shadowCascades: 1
68 | shadowDistance: 20
69 | shadowNearPlaneOffset: 2
70 | shadowCascade2Split: 0.33333334
71 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667}
72 | blendWeights: 2
73 | textureQuality: 0
74 | anisotropicTextures: 1
75 | antiAliasing: 0
76 | softParticles: 0
77 | softVegetation: 0
78 | realtimeReflectionProbes: 0
79 | billboardsFaceCameraPosition: 0
80 | vSyncCount: 1
81 | lodBias: 0.7
82 | maximumLODLevel: 0
83 | particleRaycastBudget: 64
84 | asyncUploadTimeSlice: 2
85 | asyncUploadBufferSize: 4
86 | excludedTargetPlatforms: []
87 | - serializedVersion: 2
88 | name: Good
89 | pixelLightCount: 2
90 | shadows: 2
91 | shadowResolution: 1
92 | shadowProjection: 1
93 | shadowCascades: 2
94 | shadowDistance: 40
95 | shadowNearPlaneOffset: 2
96 | shadowCascade2Split: 0.33333334
97 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667}
98 | blendWeights: 2
99 | textureQuality: 0
100 | anisotropicTextures: 1
101 | antiAliasing: 0
102 | softParticles: 0
103 | softVegetation: 1
104 | realtimeReflectionProbes: 1
105 | billboardsFaceCameraPosition: 1
106 | vSyncCount: 1
107 | lodBias: 1
108 | maximumLODLevel: 0
109 | particleRaycastBudget: 256
110 | asyncUploadTimeSlice: 2
111 | asyncUploadBufferSize: 4
112 | excludedTargetPlatforms: []
113 | - serializedVersion: 2
114 | name: Beautiful
115 | pixelLightCount: 3
116 | shadows: 2
117 | shadowResolution: 2
118 | shadowProjection: 1
119 | shadowCascades: 2
120 | shadowDistance: 70
121 | shadowNearPlaneOffset: 2
122 | shadowCascade2Split: 0.33333334
123 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667}
124 | blendWeights: 4
125 | textureQuality: 0
126 | anisotropicTextures: 2
127 | antiAliasing: 2
128 | softParticles: 1
129 | softVegetation: 1
130 | realtimeReflectionProbes: 1
131 | billboardsFaceCameraPosition: 1
132 | vSyncCount: 1
133 | lodBias: 1.5
134 | maximumLODLevel: 0
135 | particleRaycastBudget: 1024
136 | asyncUploadTimeSlice: 2
137 | asyncUploadBufferSize: 4
138 | excludedTargetPlatforms: []
139 | - serializedVersion: 2
140 | name: Fantastic
141 | pixelLightCount: 4
142 | shadows: 2
143 | shadowResolution: 2
144 | shadowProjection: 1
145 | shadowCascades: 4
146 | shadowDistance: 150
147 | shadowNearPlaneOffset: 2
148 | shadowCascade2Split: 0.33333334
149 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667}
150 | blendWeights: 4
151 | textureQuality: 0
152 | anisotropicTextures: 2
153 | antiAliasing: 2
154 | softParticles: 1
155 | softVegetation: 1
156 | realtimeReflectionProbes: 1
157 | billboardsFaceCameraPosition: 1
158 | vSyncCount: 1
159 | lodBias: 2
160 | maximumLODLevel: 0
161 | particleRaycastBudget: 4096
162 | asyncUploadTimeSlice: 2
163 | asyncUploadBufferSize: 4
164 | excludedTargetPlatforms: []
165 | m_PerPlatformDefaultQuality:
166 | Android: 2
167 | Nintendo 3DS: 5
168 | PS3: 5
169 | PS4: 5
170 | PSM: 5
171 | PSP2: 2
172 | Samsung TV: 2
173 | Standalone: 5
174 | Tizen: 2
175 | Web: 5
176 | WebGL: 3
177 | WiiU: 5
178 | Windows Store Apps: 5
179 | XBOX360: 5
180 | XboxOne: 5
181 | iPhone: 2
182 | tvOS: 5
183 |
--------------------------------------------------------------------------------
/proj.unity/Assets/UnityIO/Editor/Unit Tests/ConditionalProgressTests.cs:
--------------------------------------------------------------------------------
1 | /*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2 | UnityIO was released with an MIT License.
3 | Arther: Byron Mayne
4 | Twitter: @ByMayne
5 |
6 |
7 | MIT License
8 |
9 | Copyright(c) 2016 Byron Mayne
10 |
11 | Permission is hereby granted, free of charge, to any person obtaining a copy
12 | of this software and associated documentation files (the "Software"), to deal
13 | in the Software without restriction, including without limitation the rights
14 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15 | copies of the Software, and to permit persons to whom the Software is
16 | furnished to do so, subject to the following conditions:
17 |
18 | The above copyright notice and this permission notice shall be included in all
19 | copies or substantial portions of the Software.
20 |
21 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27 | SOFTWARE.
28 | >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>*/
29 |
30 | // Disable unused warning
31 | #pragma warning disable 0168
32 | using NUnit.Framework;
33 | using UnityEngine;
34 | using UnityEditor;
35 | using UnityIO;
36 | using Object = UnityEngine.Object;
37 |
38 | public class ConditionalProgressTests : UnityIOTestBase
39 | {
40 | [Test]
41 | public void ConditionFolderRoot()
42 | {
43 | // Only create Sub Directory if Conditional Progress exists.
44 | IO.Root.IfSubDirectoryExists("Conditional Progress").CreateDirectory("Sub Directory");
45 | // It should not exists
46 | Assert.False(IO.Root.SubDirectoryExists("Conditional Progress/Sub Directory"));
47 | // Then really create it
48 | IO.Root.CreateDirectory("Conditional Progress");
49 | // Then try conditional again
50 | IO.Root.IfSubDirectoryExists("Conditional Progress").CreateDirectory("Sub Directory");
51 | // It should not exists since we created the parent directory
52 | Assert.True(IO.Root.SubDirectoryExists("Conditional Progress/Sub Directory"));
53 | // Cleanup
54 | IO.Root.IfSubDirectoryExists("Conditional Progress").Delete();
55 | }
56 |
57 | [Test]
58 | public void EmptyCheck()
59 | {
60 | // Create a new directory
61 | IO.Root.CreateDirectory("If Empty");
62 | // Check if it's empty
63 | Assert.True(IO.Root["If Empty"].IsEmpty(assetsOnly: false), "This should empty");
64 | // Add a sub folder
65 | IO.Root["If Empty"].CreateDirectory("Sub Directory");
66 | // This should be false since we say we want to include sub folders.
67 | Assert.False(IO.Root["If Empty"].IsEmpty(assetsOnly: false), "This should have passed because we have one folder.");
68 | // This should be false because we only care about Assets.
69 | Assert.False(IO.Root["If Empty"].IsEmpty(assetsOnly: true), "This should empty");
70 | // Cleanup
71 | IO.Root["If Empty"].Delete();
72 | }
73 |
74 | [Test]
75 | public void ConditionEmptyTest()
76 | {
77 | // Create a new directory
78 | IO.Root.CreateDirectory("Conditional Empty").CreateDirectory("Sub Directory");
79 | // Destroy it if it's empty (it's not).
80 | IO.Root["Conditional Empty"].IfEmpty(assetsOnly: false).Delete();
81 | // Check if it was deleted (it should not have been).
82 | Assert.True(IO.Root.SubDirectoryExists("Conditional Empty"), "The folder should not have been deleted");
83 | // Delete the next level instead this should work.
84 | IO.Root["Conditional Empty/Sub Directory"].IfEmpty(assetsOnly: false).Delete();
85 | // Check if it was deleted (it should have been).
86 | bool directroyStillExists = IO.Root.SubDirectoryExists("Conditional Empty/Sub Directory");
87 | // Clean up if the test failed
88 | IO.Root["Conditional Empty"].Delete();
89 | // Finish Test
90 | Assert.False(directroyStillExists);
91 | }
92 |
93 | [Test]
94 | [Description("Tests to see if we can cancel execution if a file does not exist. Tests both loading a valid fail and an invalid one.")]
95 | public void IfFileExists()
96 | {
97 | // Get our testingDir
98 | var testingDir = SetupAssetLoadingTest();
99 | // Load our asset only if it exists.
100 | GameObject loadedAsset = testingDir.IfFileExists("Misc Prefab").LoadAsset();
101 | // Our Asset should exist
102 | Assert.IsNotNull(loadedAsset, "We should have been able to load this asset");
103 | // Log output
104 | TestLog("Loaded " + loadedAsset.name + " successfully");
105 | // Load an invalid object.
106 | GameObject invalidObject = testingDir.IfFileExists("Fake Prefab").LoadAsset();
107 | // It should be null
108 | Assert.IsNull(invalidObject, "We should not have been able to load the asset named.");
109 | }
110 | }
111 |
--------------------------------------------------------------------------------
/proj.cs/UnityIO.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {BAABED0F-99C5-43C4-B6E7-E551A2D5C430}
8 | Exe
9 | Properties
10 | UnityIO
11 | UnityIO
12 | v4.5.2
13 | 512
14 | true
15 |
16 |
17 | AnyCPU
18 | true
19 | full
20 | false
21 | bin\Debug\
22 | DEBUG;TRACE
23 | prompt
24 | 4
25 |
26 |
27 | AnyCPU
28 | pdbonly
29 | true
30 | bin\Release\
31 | TRACE
32 | prompt
33 | 4
34 |
35 |
36 |
37 | ..\proj.unity\Library\UnityAssemblies\nunit.framework.dll
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 | ..\proj.unity\Library\UnityAssemblies\UnityEditor.dll
49 |
50 |
51 | ..\proj.unity\Library\UnityAssemblies\UnityEngine.dll
52 |
53 |
54 |
55 |
56 | Documentation\Documention.cs
57 |
58 |
59 |
60 | UnityIO\Editor\
61 |
62 |
63 | UnityIO\Editor\
64 |
65 |
66 | UnityIO\Editor\
67 |
68 |
69 | UnityIO\Editor\
70 |
71 |
72 | UnityIO\Editor\
73 |
74 |
75 | UnityIO\Editor\Interfaces\
76 |
77 |
78 | UnityIO\Editor\Interfaces\
79 |
80 |
81 | UnityIO\Editor\Interfaces\
82 |
83 |
84 | UnityIO\Editor\
85 |
86 |
87 | UnityIO\Editor\Unit Tests\
88 |
89 |
90 | UnityIO\Editor\Unit Tests\
91 |
92 |
93 | UnityIO\Editor\Unit Tests\
94 |
95 |
96 | UnityIO\Editor\Unit Tests\
97 |
98 |
99 | UnityIO\Editor\Unit Tests\
100 |
101 |
102 | UnityIO\Editor\Unit Tests\
103 |
104 |
105 | UnityIO\Editor\Unit Tests\
106 |
107 |
108 | UnityIO\Editor\Unit Tests\
109 |
110 |
111 | UnityIO\Editor\
112 |
113 |
114 |
115 |
116 | Documentation\README.md
117 |
118 |
119 |
120 |
121 |
128 |
--------------------------------------------------------------------------------
/proj.unity/Assets/UnityIO/Editor/Unit Tests/FileChangesTests.cs:
--------------------------------------------------------------------------------
1 | /*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2 | UnityIO was released with an MIT License.
3 | Arther: Byron Mayne
4 | Twitter: @ByMayne
5 |
6 |
7 | MIT License
8 |
9 | Copyright(c) 2016 Byron Mayne
10 |
11 | Permission is hereby granted, free of charge, to any person obtaining a copy
12 | of this software and associated documentation files (the "Software"), to deal
13 | in the Software without restriction, including without limitation the rights
14 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15 | copies of the Software, and to permit persons to whom the Software is
16 | furnished to do so, subject to the following conditions:
17 |
18 | The above copyright notice and this permission notice shall be included in all
19 | copies or substantial portions of the Software.
20 |
21 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27 | SOFTWARE.
28 | >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>*/
29 |
30 | // Disable unused warning
31 | #pragma warning disable 0168
32 | using NUnit.Framework;
33 | using UnityEditor;
34 | using UnityEngine;
35 | using UnityIO;
36 | using UnityIO.Classes;
37 | using UnityIO.Interfaces;
38 | using AssetDatabase = UnityEditor.AssetDatabase;
39 |
40 | public class FileChangesTests
41 | {
42 | private IDirectory m_WorkingDirectroy;
43 |
44 | [SetUp]
45 | public void Init()
46 | {
47 | // Creating our working Directory
48 | m_WorkingDirectroy = IO.Root.CreateDirectory(GetType().Name);
49 | // Create a prefab to work with.
50 | PrefabUtility.CreatePrefab(m_WorkingDirectroy.path + "/Cube.prefab", GameObject.CreatePrimitive(PrimitiveType.Cube));
51 | PrefabUtility.CreatePrefab(m_WorkingDirectroy.path + "/Cylinder.prefab", GameObject.CreatePrimitive(PrimitiveType.Cylinder));
52 | PrefabUtility.CreatePrefab(m_WorkingDirectroy.path + "/Plane.prefab", GameObject.CreatePrimitive(PrimitiveType.Plane));
53 | }
54 |
55 | [Test]
56 | [Description("Tests to see if we can duplicate a file")]
57 | public void DuplicateFile()
58 | {
59 | // Get our file
60 | IFile cube = m_WorkingDirectroy.GetFiles("*Cube*").FirstOrDefault();
61 | // Should not be null;
62 | Assert.IsNotInstanceOf(cube);
63 | // Duplicate our prefab
64 | var secondCube = cube.Duplicate();
65 | // Check if our first one still exists
66 | Assert.IsNotNull(AssetDatabase.LoadAssetAtPath(cube.path));
67 | // And our second one is alive.
68 | Assert.IsNotNull(AssetDatabase.LoadAssetAtPath(secondCube.path));
69 | }
70 |
71 | [Test]
72 | [Description("Tests to see if we can duplicate a file and give it a new name")]
73 | public void DuplicateFileWithNewName()
74 | {
75 | // Get our file
76 | IFile cube = m_WorkingDirectroy.GetFiles("*Cube*").FirstOrDefault();
77 | // Should not be null;
78 | Assert.IsNotInstanceOf(cube);
79 | // Duplicate our prefab
80 | var secondCube = cube.Duplicate("Super Box");
81 | // Check if our first one still exists
82 | Assert.IsNotNull(AssetDatabase.LoadAssetAtPath(m_WorkingDirectroy.path + "/Cube.prefab"));
83 | // And our second one is alive.
84 | Assert.IsNotNull(AssetDatabase.LoadAssetAtPath(m_WorkingDirectroy.path + "/Super Box.prefab"));
85 | }
86 |
87 |
88 | [Test]
89 | [Description("Tests to see if a file can be renamed.")]
90 | public void RenameFile()
91 | {
92 | // Get our file
93 | IFile cube = m_WorkingDirectroy.GetFiles("*Cylinder*").FirstOrDefault();
94 | // Should not be null;
95 | Assert.IsNotInstanceOf(cube);
96 | // Duplicate our prefab
97 | cube.Rename("Super Tube");
98 | // Check to make sure the original item does not exist
99 | Assert.IsNull(AssetDatabase.LoadAssetAtPath(m_WorkingDirectroy.path + "/Cylinder.prefab"), "Our old prefab still exists");
100 | // Check if the rename happened.
101 | Assert.IsNotNull(AssetDatabase.LoadAssetAtPath(m_WorkingDirectroy.path + "/Super Tube.prefab"), "The renamed prefab could not be found");
102 | }
103 |
104 |
105 | [Test]
106 | [Description("Tests to see if a file can be moved.")]
107 | public void MoveFile()
108 | {
109 | // Create directory to move stuff into.
110 | var moveTo = m_WorkingDirectroy.CreateDirectory("MoveTo");
111 | // Get our file
112 | IFile cube = m_WorkingDirectroy.GetFiles("*Plane*").FirstOrDefault();
113 | // Should not be null;
114 | Assert.IsNotInstanceOf(cube);
115 | // Duplicate our prefab
116 | cube.Move(moveTo.path);
117 | // Check to make sure the original item does not exist
118 | Assert.IsNull(AssetDatabase.LoadAssetAtPath(m_WorkingDirectroy.path + "/Plane.prefab"), "Our old prefab still exists");
119 | // Check if the rename happened.
120 | Assert.IsNotNull(AssetDatabase.LoadAssetAtPath(m_WorkingDirectroy.path + "/MoveTo/Plane.prefab"), "The renamed prefab could not be found");
121 | }
122 |
123 | [Test]
124 | [Description("Tests to make sure we can delete files.")]
125 | public void DeleteFile()
126 | {
127 | // Create a prefab to delete.
128 | PrefabUtility.CreatePrefab(m_WorkingDirectroy.path + "/Delete Me.prefab", GameObject.CreatePrimitive(PrimitiveType.Plane));
129 | // Get our file
130 | var deleteMeFile = m_WorkingDirectroy.GetFiles("*Delete Me*").FirstOrDefault();
131 | // Delete it
132 | deleteMeFile.Delete();
133 | // Check to make sure the original item does not exist
134 | Assert.IsNull(AssetDatabase.LoadAssetAtPath(m_WorkingDirectroy.path + "/Delete Me.prefab"), "Our old prefab still exists");
135 | }
136 |
137 |
138 |
139 | [TearDown]
140 | public void Dispose()
141 | {
142 | IO.Root.IfSubDirectoryExists(GetType().Name).Delete();
143 | }
144 | }
145 |
--------------------------------------------------------------------------------
/proj.unity/ProjectSettings/InputManager.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!13 &1
4 | InputManager:
5 | m_ObjectHideFlags: 0
6 | serializedVersion: 2
7 | m_Axes:
8 | - serializedVersion: 3
9 | m_Name: Horizontal
10 | descriptiveName:
11 | descriptiveNegativeName:
12 | negativeButton: left
13 | positiveButton: right
14 | altNegativeButton: a
15 | altPositiveButton: d
16 | gravity: 3
17 | dead: 0.001
18 | sensitivity: 3
19 | snap: 1
20 | invert: 0
21 | type: 0
22 | axis: 0
23 | joyNum: 0
24 | - serializedVersion: 3
25 | m_Name: Vertical
26 | descriptiveName:
27 | descriptiveNegativeName:
28 | negativeButton: down
29 | positiveButton: up
30 | altNegativeButton: s
31 | altPositiveButton: w
32 | gravity: 3
33 | dead: 0.001
34 | sensitivity: 3
35 | snap: 1
36 | invert: 0
37 | type: 0
38 | axis: 0
39 | joyNum: 0
40 | - serializedVersion: 3
41 | m_Name: Fire1
42 | descriptiveName:
43 | descriptiveNegativeName:
44 | negativeButton:
45 | positiveButton: left ctrl
46 | altNegativeButton:
47 | altPositiveButton: mouse 0
48 | gravity: 1000
49 | dead: 0.001
50 | sensitivity: 1000
51 | snap: 0
52 | invert: 0
53 | type: 0
54 | axis: 0
55 | joyNum: 0
56 | - serializedVersion: 3
57 | m_Name: Fire2
58 | descriptiveName:
59 | descriptiveNegativeName:
60 | negativeButton:
61 | positiveButton: left alt
62 | altNegativeButton:
63 | altPositiveButton: mouse 1
64 | gravity: 1000
65 | dead: 0.001
66 | sensitivity: 1000
67 | snap: 0
68 | invert: 0
69 | type: 0
70 | axis: 0
71 | joyNum: 0
72 | - serializedVersion: 3
73 | m_Name: Fire3
74 | descriptiveName:
75 | descriptiveNegativeName:
76 | negativeButton:
77 | positiveButton: left shift
78 | altNegativeButton:
79 | altPositiveButton: mouse 2
80 | gravity: 1000
81 | dead: 0.001
82 | sensitivity: 1000
83 | snap: 0
84 | invert: 0
85 | type: 0
86 | axis: 0
87 | joyNum: 0
88 | - serializedVersion: 3
89 | m_Name: Jump
90 | descriptiveName:
91 | descriptiveNegativeName:
92 | negativeButton:
93 | positiveButton: space
94 | altNegativeButton:
95 | altPositiveButton:
96 | gravity: 1000
97 | dead: 0.001
98 | sensitivity: 1000
99 | snap: 0
100 | invert: 0
101 | type: 0
102 | axis: 0
103 | joyNum: 0
104 | - serializedVersion: 3
105 | m_Name: Mouse X
106 | descriptiveName:
107 | descriptiveNegativeName:
108 | negativeButton:
109 | positiveButton:
110 | altNegativeButton:
111 | altPositiveButton:
112 | gravity: 0
113 | dead: 0
114 | sensitivity: 0.1
115 | snap: 0
116 | invert: 0
117 | type: 1
118 | axis: 0
119 | joyNum: 0
120 | - serializedVersion: 3
121 | m_Name: Mouse Y
122 | descriptiveName:
123 | descriptiveNegativeName:
124 | negativeButton:
125 | positiveButton:
126 | altNegativeButton:
127 | altPositiveButton:
128 | gravity: 0
129 | dead: 0
130 | sensitivity: 0.1
131 | snap: 0
132 | invert: 0
133 | type: 1
134 | axis: 1
135 | joyNum: 0
136 | - serializedVersion: 3
137 | m_Name: Mouse ScrollWheel
138 | descriptiveName:
139 | descriptiveNegativeName:
140 | negativeButton:
141 | positiveButton:
142 | altNegativeButton:
143 | altPositiveButton:
144 | gravity: 0
145 | dead: 0
146 | sensitivity: 0.1
147 | snap: 0
148 | invert: 0
149 | type: 1
150 | axis: 2
151 | joyNum: 0
152 | - serializedVersion: 3
153 | m_Name: Horizontal
154 | descriptiveName:
155 | descriptiveNegativeName:
156 | negativeButton:
157 | positiveButton:
158 | altNegativeButton:
159 | altPositiveButton:
160 | gravity: 0
161 | dead: 0.19
162 | sensitivity: 1
163 | snap: 0
164 | invert: 0
165 | type: 2
166 | axis: 0
167 | joyNum: 0
168 | - serializedVersion: 3
169 | m_Name: Vertical
170 | descriptiveName:
171 | descriptiveNegativeName:
172 | negativeButton:
173 | positiveButton:
174 | altNegativeButton:
175 | altPositiveButton:
176 | gravity: 0
177 | dead: 0.19
178 | sensitivity: 1
179 | snap: 0
180 | invert: 1
181 | type: 2
182 | axis: 1
183 | joyNum: 0
184 | - serializedVersion: 3
185 | m_Name: Fire1
186 | descriptiveName:
187 | descriptiveNegativeName:
188 | negativeButton:
189 | positiveButton: joystick button 0
190 | altNegativeButton:
191 | altPositiveButton:
192 | gravity: 1000
193 | dead: 0.001
194 | sensitivity: 1000
195 | snap: 0
196 | invert: 0
197 | type: 0
198 | axis: 0
199 | joyNum: 0
200 | - serializedVersion: 3
201 | m_Name: Fire2
202 | descriptiveName:
203 | descriptiveNegativeName:
204 | negativeButton:
205 | positiveButton: joystick button 1
206 | altNegativeButton:
207 | altPositiveButton:
208 | gravity: 1000
209 | dead: 0.001
210 | sensitivity: 1000
211 | snap: 0
212 | invert: 0
213 | type: 0
214 | axis: 0
215 | joyNum: 0
216 | - serializedVersion: 3
217 | m_Name: Fire3
218 | descriptiveName:
219 | descriptiveNegativeName:
220 | negativeButton:
221 | positiveButton: joystick button 2
222 | altNegativeButton:
223 | altPositiveButton:
224 | gravity: 1000
225 | dead: 0.001
226 | sensitivity: 1000
227 | snap: 0
228 | invert: 0
229 | type: 0
230 | axis: 0
231 | joyNum: 0
232 | - serializedVersion: 3
233 | m_Name: Jump
234 | descriptiveName:
235 | descriptiveNegativeName:
236 | negativeButton:
237 | positiveButton: joystick button 3
238 | altNegativeButton:
239 | altPositiveButton:
240 | gravity: 1000
241 | dead: 0.001
242 | sensitivity: 1000
243 | snap: 0
244 | invert: 0
245 | type: 0
246 | axis: 0
247 | joyNum: 0
248 | - serializedVersion: 3
249 | m_Name: Submit
250 | descriptiveName:
251 | descriptiveNegativeName:
252 | negativeButton:
253 | positiveButton: return
254 | altNegativeButton:
255 | altPositiveButton: joystick button 0
256 | gravity: 1000
257 | dead: 0.001
258 | sensitivity: 1000
259 | snap: 0
260 | invert: 0
261 | type: 0
262 | axis: 0
263 | joyNum: 0
264 | - serializedVersion: 3
265 | m_Name: Submit
266 | descriptiveName:
267 | descriptiveNegativeName:
268 | negativeButton:
269 | positiveButton: enter
270 | altNegativeButton:
271 | altPositiveButton: space
272 | gravity: 1000
273 | dead: 0.001
274 | sensitivity: 1000
275 | snap: 0
276 | invert: 0
277 | type: 0
278 | axis: 0
279 | joyNum: 0
280 | - serializedVersion: 3
281 | m_Name: Cancel
282 | descriptiveName:
283 | descriptiveNegativeName:
284 | negativeButton:
285 | positiveButton: escape
286 | altNegativeButton:
287 | altPositiveButton: joystick button 1
288 | gravity: 1000
289 | dead: 0.001
290 | sensitivity: 1000
291 | snap: 0
292 | invert: 0
293 | type: 0
294 | axis: 0
295 | joyNum: 0
296 |
--------------------------------------------------------------------------------
/proj.unity/Assets/UnityIO/Editor/Unit Tests/Documention.cs:
--------------------------------------------------------------------------------
1 | /*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2 | UnityIO was released with an MIT License.
3 | Arther: Byron Mayne
4 | Twitter: @ByMayne
5 |
6 |
7 | MIT License
8 |
9 | Copyright(c) 2016 Byron Mayne
10 |
11 | Permission is hereby granted, free of charge, to any person obtaining a copy
12 | of this software and associated documentation files (the "Software"), to deal
13 | in the Software without restriction, including without limitation the rights
14 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15 | copies of the Software, and to permit persons to whom the Software is
16 | furnished to do so, subject to the following conditions:
17 |
18 | The above copyright notice and this permission notice shall be included in all
19 | copies or substantial portions of the Software.
20 |
21 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27 | SOFTWARE.
28 | >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>*/
29 |
30 | // Disable unused warning
31 | #pragma warning disable 0168
32 | using UnityEngine;
33 | using UnityIO;
34 | using UnityIO.Interfaces;
35 |
36 | public class Documention
37 | {
38 | #pragma warning disable 0219
39 | ///
40 | /// Creates a directory the root of our project
41 | ///
42 | public void CreatingRootDirectory()
43 | {
44 | IO.Root.CreateDirectory("Favorite Animals");
45 | }
46 |
47 | ///
48 | /// Creates a nested directory in our project
49 | ///
50 | public void CreateNestedDirectory()
51 | {
52 | IO.Root.CreateDirectory("Favorite Animals/Cats");
53 | }
54 |
55 | ///
56 | /// A few more ways to create folders
57 | ///
58 | public void CreateNestedCatFolder()
59 | {
60 | // Create in a chain
61 | var catsFolder1 = IO.Root.CreateDirectory("Favorite Animals").CreateDirectory("Cats");
62 |
63 | // Break it down into two parts.
64 | var animals = IO.Root.CreateDirectory("Favorite Animals");
65 | var catsFolder2 = animals.CreateDirectory("Cats");
66 |
67 | // Do it in one step.
68 | var catsFolder3 = IO.Root.CreateDirectory("Favorite Animals/Cats");
69 |
70 | // Do it in one step with the helper
71 | var catsFolder4 = IO.Root.CreateDirectory("Favorite Animals" + IO.PATH_SPLITTER + "Cats");
72 | }
73 |
74 | ///
75 | /// Lets blow some things up
76 | ///
77 | public void Destroy()
78 | {
79 | // Get our directory and nuke it
80 | IO.Root["Favorite Animals"]["Cats"].Delete();
81 |
82 | // Delete our cats folder.
83 | IO.Root.DeleteSubDirectory("Favorite Animals/Cats");
84 | }
85 |
86 | ///
87 | /// Lets see some explosions
88 | ///
89 | public void DeleteSomethingNotReal()
90 | {
91 | IO.Root["Favorite Animals"]["Dogs"].Delete(); // Does not exist
92 | }
93 |
94 | ///
95 | /// We should play it safe.
96 | ///
97 | public void ValidateBeforeDelete()
98 | {
99 | var favoriteAnimals = IO.Root["Favorite Animals"];
100 |
101 | if (favoriteAnimals.SubDirectoryExists("Dogs"))
102 | {
103 | favoriteAnimals.DeleteSubDirectory("Dogs");
104 | }
105 | }
106 |
107 | ///
108 | /// We should play it safe and make it easy
109 | ///
110 | public void EasyValidateBeforeDelete()
111 | {
112 | IO.Root["Favorite Animals"].IfSubDirectoryExists("Dogs").Delete();
113 | }
114 |
115 | ///
116 | /// Look at the length of that things!
117 | ///
118 | public void ILikeChains()
119 | {
120 | IO.Root["Favorite Animals"].IfSubDirectoryExists("Dogs").IfSubDirectoryExists("With Four Legs").IfSubDirectoryExists("Who stink").Delete();
121 | }
122 |
123 | ///
124 | /// Find, Create, and Destroy
125 | ///
126 | public void CreateAndDestroy()
127 | {
128 | IO.Root["Favorite Animals"].IfSubDirectoryExists("Dogs").CreateDirectory("Delete Me").Delete();
129 | }
130 |
131 | ///
132 | /// A simple example of getting all files from a folder called resources at Assets/Resources.
133 | ///
134 | public void GetResourceFiles()
135 | {
136 | // Get our directory
137 | IDirectory resourcesDirectory = IO.Root["Resources"];
138 | // Get all files.
139 | IFiles files = resourcesDirectory.GetFiles();
140 |
141 | // iterate over our files and print their names
142 | for (int i = 0; i < files.Count; i++)
143 | {
144 | Debug.Log(files[i].name);
145 | }
146 | }
147 |
148 | ///
149 | /// A simple example of getting all files from a folder called resources at Assets/Resources.
150 | ///
151 | public void GetFilesRecursively()
152 | {
153 | // Get our directory
154 | IDirectory resourcesDirectory = IO.Root["Resources"];
155 | // Get all files recursively
156 | IFiles files = resourcesDirectory.GetFiles(recursive: true);
157 | }
158 |
159 | public void SearchExamples()
160 | {
161 | // Returns every asset with 'Player' in it's name.
162 | var playerFiles = IO.Root.GetFiles("*Player*");
163 | // Get everything named with 'Player' and '.anim' extension
164 | var playerAnimations = IO.Root.GetFiles("*Player*.anim");
165 | // get everything named 'Player' with one extra char maybe an 's'
166 | var playerChar = IO.Root.GetFiles("Player?");
167 | }
168 |
169 | ///
170 | /// Grabs all the files in the root directory and deletes them.
171 | ///
172 | public void DeleteAFile()
173 | {
174 | // Get all our files.
175 | var files = IO.Root.GetFiles();
176 | // Loop over them all and delete them
177 | for (int i = 0; i < files.Count; i++)
178 | {
179 | // Delete the file.
180 | files[i].Delete();
181 | }
182 |
183 | var file = IO.Root.GetFiles("DELETEME.txt").FirstOrDefault();
184 |
185 | /// Only delete our file if it exists.
186 | IO.Root.IfFileExists("DeleteMe.txt").Delete();
187 |
188 | // Get the file we want to use.
189 | IFile fileToRename = IO.Root.GetFiles("DeleteMe.txt").FirstOrDefault();
190 | // Rename it
191 | fileToRename.Rename("DontDeleteMe.txt");
192 |
193 | IO.Root.GetFiles("DeleteMe.txt").FirstOrDefault().Rename("Delete All Of The Things.txt");
194 |
195 | // Get the file we want to use.
196 | IFile fileToMove = IO.Root.GetFiles("DeleteMe.txt").FirstOrDefault();
197 | // Move it
198 | fileToRename.Move(IO.Root["Resources"].path);
199 |
200 | }
201 | }
202 |
--------------------------------------------------------------------------------
/proj.unity/Assets/UnityIO/Editor/Unit Tests/DirectoryChangesTests.cs:
--------------------------------------------------------------------------------
1 | /*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2 | UnityIO was released with an MIT License.
3 | Arther: Byron Mayne
4 | Twitter: @ByMayne
5 |
6 |
7 | MIT License
8 |
9 | Copyright(c) 2016 Byron Mayne
10 |
11 | Permission is hereby granted, free of charge, to any person obtaining a copy
12 | of this software and associated documentation files (the "Software"), to deal
13 | in the Software without restriction, including without limitation the rights
14 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15 | copies of the Software, and to permit persons to whom the Software is
16 | furnished to do so, subject to the following conditions:
17 |
18 | The above copyright notice and this permission notice shall be included in all
19 | copies or substantial portions of the Software.
20 |
21 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27 | SOFTWARE.
28 | >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>*/
29 |
30 | // Disable unused warning
31 | #pragma warning disable 0168
32 | using NUnit.Framework;
33 | using UnityIO;
34 | using UnityIO.Exceptions;
35 |
36 | public class DirectoryChangesTests
37 | {
38 | [Test]
39 | [Description("Tests to see if a a directory with one sub directory can be copied and get auto renamed")]
40 | public void DuplicateDirectory()
41 | {
42 | // Create our first folder
43 | var newFolder = IO.Root.CreateDirectory("DD");
44 | // Add a sub folder
45 | newFolder.CreateDirectory("Sub Directory");
46 | // duplicate our first one
47 | newFolder.Duplicate();
48 | // Make sure the original and it's sub directory are still in tack.
49 | Assert.True(IO.Root.SubDirectoryExists("DD"), "The original folder should be in the same place");
50 | // And it's sub folder
51 | Assert.True(IO.Root.SubDirectoryExists("DD/Sub Directory"), "The sub folder should be in the same place");
52 | // Make sure the original and it's sub directory are still in tack.
53 | Assert.True(IO.Root.SubDirectoryExists("DD 1"), "The original folder should be in the same place");
54 | // And it's sub folder
55 | Assert.True(IO.Root.SubDirectoryExists("DD 1/Sub Directory"), "The sub folder should be in the same place");
56 | }
57 |
58 | [Test]
59 | [Description("Tests to see if a a directory with one sub directory can be copied and get a new named assigned by the user")]
60 | public void DuplicateDirectoryWithName()
61 | {
62 | // Create our first folder
63 | var newFolder = IO.Root.CreateDirectory("DDWN");
64 | // Add a sub folder
65 | newFolder.CreateDirectory("Sub");
66 | // duplicate our first one
67 | newFolder.Duplicate(IO.Root.path + "/New DDWN");
68 | // Make sure the original and it's sub directory are still in tack.
69 | Assert.True(IO.Root.SubDirectoryExists("DDWN"), "The original folder should be in the same place");
70 | // And it's sub folder
71 | Assert.True(IO.Root.SubDirectoryExists("DDWN/Sub"), "The sub folder should be in the same place");
72 | // Make sure the original and it's sub directory are still in tack.
73 | Assert.True(IO.Root.SubDirectoryExists("New DDWN"), "The original folder should be in the same place");
74 | // And it's sub folder
75 | Assert.True(IO.Root.SubDirectoryExists("New DDWN/Sub"), "The sub folder should be in the same place");
76 | }
77 |
78 | [Test]
79 | [Description("Checks to see if a directory can be renamed")]
80 | public void Rename()
81 | {
82 | // Create a folder
83 | var newFolder = IO.Root.CreateDirectory("RNT");
84 | // Create a sub
85 | newFolder.CreateDirectory("Sub");
86 | // Rename it
87 | newFolder.Rename("RNT Renamed");
88 | // Old one should not exist
89 | Assert.False(IO.Root.SubDirectoryExists("RNT"), "The original folder should not exist anymore");
90 | // Check if the rename is there
91 | Assert.True(IO.Root.SubDirectoryExists("RNT Renamed"), "The original folder should not exist anymore");
92 | }
93 |
94 | [Test]
95 | [ExpectedException(ExpectedException = typeof(DirectroyAlreadyExistsException))]
96 | [Description("Checks to see if an exception is thrown when we try to rename a directory and one already exists with that name")]
97 | public void RenameWithConflict()
98 | {
99 | // Create a folder
100 | var rwc = IO.Root.CreateDirectory("RWC");
101 | // Create a second one
102 | var rwc2 = IO.Root.CreateDirectory("RWC2");
103 | // Rename the second one to cause an exception since that directory already exists.
104 | rwc2.Rename("RWC");
105 | }
106 |
107 | [Test]
108 | [Sequential]
109 | [Description("Checks to see if an exception is thrown when we try to rename a directory and the name has invalid characters.")]
110 | public void RenameWithInvalidName([Values("/", "\\", "<", ">", ":", "|", "\"")] string charactersToTest)
111 | {
112 | // The exception that was thrown.
113 | System.Exception thorwnException = null;
114 | // Create a working directory
115 | var rwc = IO.Root.CreateDirectory("RWIN");
116 | // Create a file to rename
117 | var newDir = rwc.CreateDirectory("Awesome");
118 | // Rename it with invalid characters.
119 | try
120 | {
121 | newDir.Rename(charactersToTest);
122 | }
123 | catch (System.Exception e)
124 | {
125 | thorwnException = e;
126 | }
127 |
128 | if (thorwnException is InvalidNameException)
129 | {
130 | Assert.Pass("The correct exception was thrown for the invalid character '" + charactersToTest + "'.");
131 | }
132 | else
133 | {
134 | if(thorwnException != null)
135 | {
136 | Assert.Fail("The expected exception was not captured for the invalid character '" + charactersToTest + "'. The Exception thrown was " + thorwnException.ToString());
137 | }
138 | else
139 | {
140 | Assert.Fail("No exception was thrown for invalid character '" + charactersToTest + "'");
141 | }
142 | }
143 | }
144 |
145 | [Test]
146 | [Sequential]
147 | [Description("Checks to see if an exception is thrown when we try to rename a directory and the name has invalid characters.")]
148 | public void MoveWithInvalidName([Values("/", "\\", "<", ">", ":", "|", "\"")] string charactersToTest)
149 | {
150 | // The exception that was thrown.
151 | System.Exception thorwnException = null;
152 | // Create a working directory
153 | var rwc = IO.Root.CreateDirectory("RWIN");
154 | // Create a file to rename
155 | var newDir = rwc.CreateDirectory("Awesome");
156 | // Rename it with invalid characters.
157 | try
158 | {
159 | newDir.Move(rwc.path + "/" + charactersToTest);
160 | }
161 | catch (System.Exception e)
162 | {
163 | thorwnException = e;
164 | }
165 |
166 | if (thorwnException is InvalidNameException)
167 | {
168 | Assert.Pass("The correct exception was thrown for the invalid character '" + charactersToTest + "'.");
169 | }
170 | else
171 | {
172 | if (thorwnException != null)
173 | {
174 | Assert.Fail("The expected exception was not captured for the invalid character '" + charactersToTest + "'. The Exception thrown was " + thorwnException.ToString());
175 | }
176 | else
177 | {
178 | Assert.Fail("No exception was thrown for invalid character '" + charactersToTest + "'");
179 | }
180 | }
181 | }
182 |
183 |
184 |
185 | [TearDown]
186 | public void TearDown()
187 | {
188 | IO.Root.IfSubDirectoryExists("DD").Delete();
189 | IO.Root.IfSubDirectoryExists("DD 1").Delete();
190 | IO.Root.IfSubDirectoryExists("DDWN").Delete();
191 | IO.Root.IfSubDirectoryExists("New DDWN").Delete();
192 | IO.Root.IfSubDirectoryExists("RNT").Delete();
193 | IO.Root.IfSubDirectoryExists("RNT Renamed").Delete();
194 | IO.Root.IfSubDirectoryExists("RWC").Delete();
195 | IO.Root.IfSubDirectoryExists("RWC2").Delete();
196 | IO.Root.IfSubDirectoryExists("RWIN").Delete();
197 | }
198 | }
199 |
--------------------------------------------------------------------------------
/proj.unity/Assets/UnityIO/NullFile.cs:
--------------------------------------------------------------------------------
1 | /*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2 | UnityIO was released with an MIT License.
3 | Arther: Byron Mayne
4 | Twitter: @ByMayne
5 |
6 |
7 | MIT License
8 |
9 | Copyright(c) 2016 Byron Mayne
10 |
11 | Permission is hereby granted, free of charge, to any person obtaining a copy
12 | of this software and associated documentation files (the "Software"), to deal
13 | in the Software without restriction, including without limitation the rights
14 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15 | copies of the Software, and to permit persons to whom the Software is
16 | furnished to do so, subject to the following conditions:
17 |
18 | The above copyright notice and this permission notice shall be included in all
19 | copies or substantial portions of the Software.
20 |
21 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27 | SOFTWARE.
28 | >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>*/
29 |
30 | using System;
31 | using System.Collections;
32 | using System.Collections.Generic;
33 | using UnityEditor;
34 | using UnityEngine;
35 | using UnityIO.Interfaces;
36 |
37 | namespace UnityIO.Classes
38 | {
39 | public class NullFile : IDirectory, IFile, IFiles
40 | {
41 | public static NullFile SHARED_INSTANCE = new NullFile();
42 |
43 | public string path
44 | {
45 | get { return "Null"; }
46 | }
47 |
48 | public string systemPath
49 | {
50 | get { return "Null"; }
51 | }
52 |
53 | public IDirectory this[string name]
54 | {
55 | get
56 | {
57 | return SHARED_INSTANCE;
58 | }
59 | }
60 |
61 | public IDirectory directory
62 | {
63 | get
64 | {
65 | return SHARED_INSTANCE;
66 | }
67 | }
68 |
69 | public IDirectory parent
70 | {
71 | get { return this; }
72 | }
73 |
74 | public int Count
75 | {
76 | get
77 | {
78 | return 0;
79 | }
80 | }
81 |
82 | public bool IsReadOnly
83 | {
84 | get
85 | {
86 | return false;
87 | }
88 | }
89 |
90 | public string name
91 | {
92 | get
93 | {
94 | return string.Empty;
95 | }
96 | }
97 |
98 | public string nameWithoutExtension
99 | {
100 | get
101 | {
102 | return string.Empty;
103 | }
104 | }
105 |
106 | public string extension
107 | {
108 | get
109 | {
110 | return string.Empty;
111 | }
112 | }
113 |
114 | public IFile this[int index]
115 | {
116 | get
117 | {
118 | return null;
119 | }
120 |
121 | set
122 | {
123 |
124 | // Nothing
125 | }
126 | }
127 |
128 | public IDirectory CreateDirectory(string name)
129 | {
130 | return SHARED_INSTANCE;
131 | }
132 |
133 | public void Delete()
134 | {
135 | }
136 |
137 | public void DeleteSubDirectory(string directroyName)
138 | {
139 | }
140 |
141 | public bool SubDirectoryExists(string directoryName)
142 | {
143 | return false;
144 | }
145 |
146 |
147 |
148 | public void Duplicate()
149 | {
150 | }
151 |
152 | public void Duplicate(string newName)
153 | {
154 | }
155 |
156 | public IDirectory GetDirectory(string name)
157 | {
158 | return SHARED_INSTANCE;
159 | }
160 |
161 | public IFiles GetFiles()
162 | {
163 | return SHARED_INSTANCE;
164 | }
165 |
166 | public IFiles GetFiles(string filter)
167 | {
168 | return SHARED_INSTANCE;
169 | }
170 |
171 | public IFiles GetFiles(bool recursive)
172 | {
173 | return SHARED_INSTANCE;
174 | }
175 |
176 | public IFiles GetFiles(string filter, bool recursive)
177 | {
178 | return SHARED_INSTANCE;
179 | }
180 |
181 | public IFiles GetFiles() where T : UnityEngine.Object
182 | {
183 | return SHARED_INSTANCE;
184 | }
185 |
186 | public IFiles GetFiles(string filter) where T : UnityEngine.Object
187 | {
188 | return SHARED_INSTANCE;
189 | }
190 |
191 | public IFiles GetFiles(bool recursive) where T : UnityEngine.Object
192 | {
193 | return SHARED_INSTANCE;
194 | }
195 |
196 | public IFiles GetFiles(string filter, bool recursive)
197 | {
198 | return SHARED_INSTANCE;
199 | }
200 |
201 | public IDirectory IfSubDirectoryExists(string name)
202 | {
203 | return SHARED_INSTANCE;
204 | }
205 |
206 | public IDirectory IfSubDirectoryDoesNotExist(string directoryName)
207 | {
208 | return SHARED_INSTANCE;
209 | }
210 |
211 | public IDirectory IfEmpty(bool assetsOnly)
212 | {
213 | return SHARED_INSTANCE;
214 | }
215 |
216 | public bool IsEmpty(bool assetsOnly)
217 | {
218 | return true;
219 | }
220 |
221 | public IFile IfFileExists(string name)
222 | {
223 | return SHARED_INSTANCE;
224 | }
225 |
226 | public IDirectory IfNotEmpty(bool assetsOnly)
227 | {
228 | return SHARED_INSTANCE;
229 | }
230 |
231 | public void Move(string moveDirectory)
232 | {
233 |
234 | }
235 |
236 | public void Move(IDirectory moveDirectory)
237 | {
238 |
239 | }
240 |
241 | public void Rename(string newName)
242 | {
243 | }
244 |
245 | IFile IFile.Duplicate()
246 | {
247 | return SHARED_INSTANCE;
248 | }
249 |
250 | IFile IFile.Duplicate(string newName)
251 | {
252 | return SHARED_INSTANCE;
253 | }
254 |
255 | public IEnumerator GetEnumerator()
256 | {
257 | yield return null;
258 | }
259 |
260 | IEnumerator IEnumerable.GetEnumerator()
261 | {
262 | yield return null;
263 | }
264 |
265 | public UnityEngine.Object LoadAsset()
266 | {
267 | return null;
268 | }
269 |
270 | public T LoadAsset() where T : UnityEngine.Object
271 | {
272 | return null;
273 | }
274 |
275 | public IList LoadAllofType() where T : UnityEngine.Object
276 | {
277 | return null;
278 | }
279 |
280 | public IFile FirstOrDefault()
281 | {
282 | return null;
283 | }
284 |
285 | public int IndexOf(IFile item)
286 | {
287 | return 0;
288 | }
289 |
290 | public void Insert(int index, IFile item)
291 | {
292 |
293 | }
294 |
295 | public void RemoveAt(int index)
296 | {
297 |
298 | }
299 |
300 | public void Add(IFile item)
301 | {
302 |
303 | }
304 |
305 | public void Clear()
306 | {
307 |
308 | }
309 |
310 | public bool Contains(IFile item)
311 | {
312 | return false;
313 | }
314 |
315 | public void CopyTo(IFile[] array, int arrayIndex)
316 | {
317 |
318 | }
319 |
320 | public bool Remove(IFile item)
321 | {
322 | return false;
323 | }
324 |
325 | IEnumerator IEnumerable.GetEnumerator()
326 | {
327 | throw new NotImplementedException();
328 | }
329 |
330 | public IFile CreateFile(string name, T asset) where T : UnityEngine.Object
331 | {
332 | return SHARED_INSTANCE;
333 | }
334 |
335 | public int Compare(IDirectory x, IDirectory y)
336 | {
337 | return -10;
338 | }
339 |
340 | public bool Equals(IDirectory other)
341 | {
342 | return other is NullFile;
343 | }
344 | }
345 | }
--------------------------------------------------------------------------------
/proj.unity/Assets/UnityIO/File.cs:
--------------------------------------------------------------------------------
1 | /*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2 | UnityIO was released with an MIT License.
3 | Arther: Byron Mayne
4 | Twitter: @ByMayne
5 |
6 |
7 | MIT License
8 |
9 | Copyright(c) 2016 Byron Mayne
10 |
11 | Permission is hereby granted, free of charge, to any person obtaining a copy
12 | of this software and associated documentation files (the "Software"), to deal
13 | in the Software without restriction, including without limitation the rights
14 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15 | copies of the Software, and to permit persons to whom the Software is
16 | furnished to do so, subject to the following conditions:
17 |
18 | The above copyright notice and this permission notice shall be included in all
19 | copies or substantial portions of the Software.
20 |
21 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27 | SOFTWARE.
28 | >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>*/
29 | using UnityIO.Interfaces;
30 | using UnityEngine;
31 | using UnityIO.Exceptions;
32 | using sIO = System.IO;
33 | using UnityIO.AssetDatabaseWrapper;
34 |
35 | namespace UnityIO.Classes
36 | {
37 | public class File : IFile
38 | {
39 | private string m_Directory;
40 | private string m_Extension;
41 | private string m_FileName;
42 |
43 | ///
44 | /// Gets the full path to this file starting from the Assets folder.
45 | ///
46 | public string path
47 | {
48 | get { return m_Directory + "/" + m_FileName + m_Extension; }
49 | }
50 |
51 | ///
52 | /// Gets the path to this file starting from the root of your system.
53 | ///
54 | public string systemPath
55 | {
56 | get { return IO.AssetPathToSystemPath(path); }
57 | }
58 |
59 | ///
60 | /// Gets the name of this file with it's extension.
61 | ///
62 | public string name
63 | {
64 | get { return m_FileName + m_Extension; }
65 | }
66 |
67 | ///
68 | /// Gets the name of this file without it's extension.
69 | ///
70 | public string nameWithoutExtension
71 | {
72 | get { return m_FileName; }
73 | }
74 |
75 | ///
76 | /// Gets the extension of this file.
77 | ///
78 | public string extension
79 | {
80 | get { return m_Extension; }
81 | }
82 |
83 | ///
84 | /// Creates a new instance of a file.
85 | ///
86 | public File(string path)
87 | {
88 | m_Extension = sIO.Path.GetExtension(path);
89 | m_FileName = sIO.Path.GetFileNameWithoutExtension(path);
90 | m_Directory = sIO.Path.GetDirectoryName(path);
91 | }
92 |
93 | ///
94 | /// Returns the directory that this file exists in.
95 | ///
96 | public IDirectory directory
97 | {
98 | get
99 | {
100 | return new Directory(m_Directory);
101 | }
102 | }
103 |
104 | ///
105 | /// Delete this file from disk.
106 | ///
107 | public void Delete()
108 | {
109 | // Deletes the asset
110 | AssetDatabase.DeleteAsset(path);
111 | }
112 |
113 | public IFile Duplicate()
114 | {
115 | // Get our path.
116 | string copyDir = AssetDatabase.GenerateUniqueAssetPath(path);
117 | // Copy our asset
118 | AssetDatabase.CopyAsset(path, copyDir);
119 | // Return new IFile
120 | return new File(copyDir);
121 | }
122 |
123 | ///
124 | /// Creates a copy of this file with a new name. The new name should not contain the extension
125 | /// that will be preserved automatically.
126 | ///
127 | /// The new name of the file (excluding the extension)
128 | ///
129 | public IFile Duplicate(string newName)
130 | {
131 | if(string.IsNullOrEmpty(newName))
132 | {
133 | throw new System.ArgumentNullException("You can't send a empty or null string to rename an asset. Trying to rename " + path);
134 | }
135 | // Make sure we don't have an extension.
136 | if(!string.IsNullOrEmpty(sIO.Path.GetExtension(newName)))
137 | {
138 | throw new InvalidNameException("When you duplicate an asset it should not have an extension " + newName);
139 | }
140 | // Make sure it's a valid name.
141 | if (!AssetDatabase.IsValidFileName(newName))
142 | {
143 | throw new InvalidNameException("The name '" + newName + "' contains invalid characters");
144 | }
145 | // Get our current directory
146 | string directory = System.IO.Path.GetDirectoryName(path);
147 | // and the extension
148 | string extension = System.IO.Path.GetExtension(path);
149 | // Get our path.
150 | string copyDir = AssetDatabase.GenerateUniqueAssetPath(directory + "/" + newName + extension);
151 | // Copy our asset
152 | AssetDatabase.CopyAsset(path, copyDir);
153 | // Return new IFile
154 | return new File(copyDir);
155 | }
156 |
157 | ///
158 | /// Moves the files from it's current directory to another.
159 | ///
160 | /// The directory you want to move it too
161 | public void Move(IDirectory targetDirectory)
162 | {
163 | Move(targetDirectory.path);
164 | }
165 |
166 | ///
167 | /// Moves the files from it's current directory to another.
168 | ///
169 | /// The directory you want to move it too
170 | public void Move(string targetDirectory)
171 | {
172 | // Make sure we have a valid path
173 | IO.ValidatePath(targetDirectory);
174 | // And the directory exists
175 | if(!AssetDatabase.IsValidFolder(targetDirectory))
176 | {
177 | throw new DirectoryNotFoundException("Unable to find the directory at " + targetDirectory);
178 | }
179 |
180 | // Get the current name of our file.
181 | string name = System.IO.Path.GetFileName(path);
182 |
183 | // Append the name to the end. Move can't rename.
184 | targetDirectory = targetDirectory + "/" + name;
185 |
186 | // Check to see if there will be an error.
187 | string error = AssetDatabase.ValidateMoveAsset(path, targetDirectory);
188 |
189 | // CHeck
190 | if (!string.IsNullOrEmpty(error))
191 | {
192 | // We messed up.
193 | throw new MoveException(error, path, targetDirectory);
194 | }
195 | else
196 | {
197 | // Move it we are good to go.
198 | AssetDatabase.MoveAsset(path, targetDirectory);
199 | }
200 | }
201 |
202 | ///
203 | /// Renames this file to a new name.
204 | ///
205 | public void Rename(string newName)
206 | {
207 | if (!UnityEditorInternal.InternalEditorUtility.IsValidFileName(newName))
208 | {
209 | throw new InvalidNameException("The name '" + newName + "' contains invalid characters");
210 | }
211 |
212 | if (newName.Contains("/"))
213 | {
214 | throw new RenameException("Rename can't be used to change a files location use Move(string newPath) instead.", path, newName);
215 | }
216 |
217 | string tempPath = m_Directory + "/" + newName;
218 |
219 | Object preExistingAsset = AssetDatabase.LoadAssetAtPath