├── .gitattributes ├── .gitignore ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── proj.cs ├── App.config ├── Properties │ └── AssemblyInfo.cs ├── UnityIO.csproj └── UnityIO.sln └── proj.unity ├── Assets ├── UnityIO.meta └── UnityIO │ ├── AssetDatabase.cs │ ├── AssetDatabase.cs.meta │ ├── Directory.cs │ ├── Directory.cs.meta │ ├── Editor.meta │ ├── Editor │ ├── ContextMenus.cs │ ├── ContextMenus.cs.meta │ ├── Unit Tests.meta │ └── Unit Tests │ │ ├── ConditionalProgressTests.cs │ │ ├── ConditionalProgressTests.cs.meta │ │ ├── ConvertPathTests.cs │ │ ├── ConvertPathTests.cs.meta │ │ ├── CreatingDirectoryTests.cs │ │ ├── CreatingDirectoryTests.cs.meta │ │ ├── DirectoryChangesTests.cs │ │ ├── DirectoryChangesTests.cs.meta │ │ ├── Documention.cs │ │ ├── Documention.cs.meta │ │ ├── EnumerationTests.cs │ │ ├── EnumerationTests.cs.meta │ │ ├── FileChangesTests.cs │ │ ├── FileChangesTests.cs.meta │ │ ├── GetFilesTests.cs │ │ ├── GetFilesTests.cs.meta │ │ ├── Loading Assets.meta │ │ ├── Loading Assets │ │ ├── Animations.meta │ │ ├── Animations │ │ │ ├── Died.anim │ │ │ ├── Died.anim.meta │ │ │ ├── Hit.anim │ │ │ ├── Hit.anim.meta │ │ │ ├── Player Attack.anim │ │ │ └── Player Attack.anim.meta │ │ ├── GUISkins.meta │ │ ├── GUISkins │ │ │ ├── Dark Skin.guiskin │ │ │ ├── Dark Skin.guiskin.meta │ │ │ ├── Light Skin.guiskin │ │ │ └── Light Skin.guiskin.meta │ │ ├── Misc Animation.anim │ │ ├── Misc Animation.anim.meta │ │ ├── Misc Prefab.prefab │ │ ├── Misc Prefab.prefab.meta │ │ ├── Misc Skin.guiskin │ │ ├── Misc Skin.guiskin.meta │ │ ├── Prefabs.meta │ │ └── Prefabs │ │ │ ├── Player Character.prefab │ │ │ ├── Player Character.prefab.meta │ │ │ ├── Weapon.prefab │ │ │ └── Weapon.prefab.meta │ │ ├── PathValidationTests.cs │ │ ├── PathValidationTests.cs.meta │ │ ├── UnityIOTestBase.cs │ │ └── UnityIOTestBase.cs.meta │ ├── Exceptions.cs │ ├── Exceptions.cs.meta │ ├── File.cs │ ├── File.cs.meta │ ├── Files.cs │ ├── Files.cs.meta │ ├── Interfaces.meta │ ├── Interfaces │ ├── IDirectory.cs │ ├── IDirectory.cs.meta │ ├── IFile.cs │ ├── IFile.cs.meta │ ├── IFiles.cs │ └── IFiles.cs.meta │ ├── NullFile.cs │ ├── NullFile.cs.meta │ ├── UnityIO.cs │ └── UnityIO.cs.meta └── ProjectSettings ├── AudioManager.asset ├── ClusterInputManager.asset ├── DynamicsManager.asset ├── EditorBuildSettings.asset ├── EditorSettings.asset ├── GraphicsSettings.asset ├── InputManager.asset ├── NavMeshAreas.asset ├── NetworkManager.asset ├── Physics2DSettings.asset ├── ProjectSettings.asset ├── ProjectVersion.txt ├── QualitySettings.asset ├── TagManager.asset ├── TimeManager.asset ├── UnityAdsSettings.asset └── UnityConnectSettings.asset /.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 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Gitter Chat](https://img.shields.io/badge/Gitter-Join%20Chat-red.svg)](https://gitter.im/UnityIO/Lobby) 2 | [![License](https://img.shields.io/badge/license-MIT-lightgrey.svg)](https://github.com/ByronMayne/UnityIO/blob/master/LICENSE) 3 | 4 | 5 | 6 | 7 | # Unity IO 8 | 9 | ### Description 10 | Unity IO is made to try to remove the pain of working with Unity's file system. For anyone who has done extended work has figured out Unity makes this a huge pain. All the functionality you need is spread across multiple classes including [FileUtil](https://docs.unity3d.com/ScriptReference/FileUtil.html), [AssetDatabase](https://docs.unity3d.com/ScriptReference/AssetDatabase.html), [Resources](https://docs.unity3d.com/ScriptReference/Resources.html), [File](https://msdn.microsoft.com/en-us/library/system.io.file(v=vs.110).aspx), [FileInfo](https://msdn.microsoft.com/en-us/library/system.io.fileinfo(v=vs.110).aspx), [Path](https://msdn.microsoft.com/en-us/library/system.io.path(v=vs.110).aspx), [Directory](https://msdn.microsoft.com/en-us/library/system.io.directory(v=vs.110).aspx), [Directory Info](https://msdn.microsoft.com/en-us/library/system.io.directoryinfo(v=vs.110).aspx), ect. 11 | 12 | ### Goals 13 | 14 | * Simple to use API. 15 | * Support Unity's meta files. 16 | * Allow for complex chaining with conditional execution. 17 | * Allow of loading, creating, destroying of Unity Assets. 18 | 19 | 20 | 21 | ## Directory Basics 22 | UnityIO works with the Unity asset path so all paths start from the ```Assets/``` folder. To start using UnityIO in your classes you must include the namespace ```UnityIO``` 23 | 24 | ### Creating a Directory 25 | ``` csharp 26 | /// 27 | /// Creates a directory the root of our project 28 | /// 29 | public void CreatingRootDirectory() 30 | { 31 | IO.Root.CreateDirectory("Favorite Animals"); 32 | } 33 | ``` 34 | ```IO.Root``` is the ```/Assets``` folder at the root of your Unity project. In the example above we are asking UnityIO to create a new folder called Favorite Animals at ```Assets/Favorite Animals```. 35 | ``` csharp 36 | /// 37 | /// A few more ways to create folders 38 | /// 39 | public void CreateNestedCatFolder() 40 | { 41 | // Create in a chain. 42 | var catsFolder1 = IO.Root.CreateDirectory("Favorite Animals").CreateDirectory("Cats"); 43 | 44 | // Break it down into two parts. 45 | var animals = IO.Root.CreateDirectory("Favorite Animals"); 46 | var catsFolder2 = animals.CreateDirectory("Cats"); 47 | 48 | // Do it in one step. 49 | var catsFolder3 = IO.Root.CreateDirectory("Favorite Animals/Cats"); 50 | 51 | // Do it in one step with the helper. 52 | var catsFolder4 = IO.Root.CreateDirectory("Favorite Animals" + IO.PATH_SPLITTER + "Cats"); 53 | } 54 | ``` 55 | This code is doing the same above but it will also create a subdirectory called Cats. When you want to create subdirectories you have a few ways to do it. It all really depends how you want to do it but they all have the same result. If the code were to run above only two folders would be created and all of the variables would point to the same one. 56 | 57 | #### Notes 58 | * The paths do not end with a leading slash ```/```. Unity has a habit of switching this up but UnityIO will throw a planned exception letting you know. 59 | * All directories are split using the ```/``` character. You can use the constant ```IO.PATH_SPLITTER```. 60 | 61 | 62 | ### Destroying a Directory 63 | Well it turns out all our hard work we did was for nothing! Turns out you hate cats, don't worry I get it you are a monster. I will not judge lets destroy that directory. 64 | ```csharp 65 | /// 66 | /// Let's blow some things up 67 | /// 68 | public void Destroy() 69 | { 70 | // Get our directory and nuke it 71 | IO.Root["Favorite Animals"].GetDirectory("Cats").Delete(); 72 | 73 | // Delete our cats folder. 74 | IO.Root.DeleteSubDirectory("Favorite Animals/Cats"); 75 | } 76 | ``` 77 | As with creating folder there are more than way to do things. The first example we are just finding our cats directory and tell it to kill itself with the ```Delete()``` function. The second way we are starting from the root and it will look for the subdirectory at the path we sent in. The ```DeleteSubDirectory(string name)``` just calls ```Delete()``` on the folder behind the scenes. 78 | 79 | Take that cats! 80 | 81 | You might be asking what happens if you tell it to delete a directory that does not exist. 82 | 83 | ```scharp 84 | /// 85 | /// This should do nothing. 86 | /// 87 | public void DeleteSomethingNotReal() 88 | { 89 | IO.Root["Favorite Animals"].GetDirectory("Dogs").Delete(); // Does not exist 90 | } 91 | ``` 92 | In this case you well get an ```System.IO.DirectoryNotFoundException``` since you are trying to delete something that is not there. This can be super helpful but what if you only want to delete it if it does exist? 93 | ```csharp 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 | Above you can see we are checking to see if it exists before deleting it. This way we will not get an exception which is awesome. However this can become annoying to check every element has to be checked along the way. The other more usable way to do this would be to use a conditional. 108 | ```scharp 109 | /// 110 | /// We should play it safe and make it easy 111 | /// 112 | public void EasyValidateBeforeDelete() 113 | { 114 | IO.Root["Favorite Animals"].IfDirectoryExists("Dogs").Delete(); 115 | } 116 | ``` 117 | "Wait what does ```IfDirectoryExists()``` do?" Well I am glad you asked. One of the really cool features of UnityIO is conditionals. In this case if the directory exists the function ```Delete()``` will be called on the Dogs directory. If it does not exist the function will take no effect. 118 | ```csharp 119 | /// 120 | /// Look at the length of that things! 121 | /// 122 | public void ILikeChains() 123 | { 124 | IO.Root["Favorite Animals"].IfDirectoryExists("Dogs").IfDirectoryExists("With Four Legs").IfDirectoryExists("Who stink").Delete(); 125 | } 126 | ``` 127 | In this case only the first folder exists so the first conditional will return a NullFile class which has all the same functions but none of them have any effect. So that way your code will execute only as far as it can get. You don't have to worry about null checking since the code can't break if a file is missing. You have the power to chain as many of these as you want. 128 | ``` csharp 129 | /// 130 | /// Find, Create, and Destroy 131 | /// 132 | public void CreateAndDestroy() 133 | { 134 | IO.Root["Favorite Animals"].IfDirectoryExists("Dogs").CreateDirectory("Delete Me").Delete(); 135 | } 136 | ``` 137 | 138 | #### Notes 139 | * You can delete your whole project with ```IO.Root.Delete()```. I don't suggest you do that. 140 | 141 | ### Renaming a Directory 142 | Sometimes there are cases where you want to rename you directory. To do this is pretty simple. 143 | ```csharp 144 | /// 145 | /// Pick any name that is valid 146 | /// 147 | public void RenameDirectory() 148 | { 149 | IO.Root["My Dir"].Rename("Super Dir"); 150 | } 151 | ``` 152 | This is all you have to do just make sure you don't include any ```/``` in your name as they are already preserved. If a directory already exists with that name this function will throw an ```DirectoryAlreadyExistsException()```, so make sure you check before you try to create one. 153 | 154 | ### Duplicate a Directory 155 | As with moving duplicate is just as easy. 156 | ```CSHARP 157 | public void DuplicateADirectory() 158 | { 159 | var cheeseDrive = IO.Root["Types of Cheese"]; 160 | // Creates a copy 161 | cheeseDrive.Duplicate(); 162 | // Creates a copy with a set name 163 | cheeseDrive.Duplicate("Other Types of Cheese"); 164 | } 165 | ``` 166 | The ```cheeseDrive.Duplicate()``` function will create a new copy of the cheeseDrive and all it's contents. It will then rename that drive with a number on the end to make it unique. If you want more control you can just use the overloaded function to pick a valid name. If the name is already taken you well get an exception. 167 | ## File Basics 168 | 169 | As with working with directories working with files is just as easy. UnityIO does it's best to try to make things as painless as possible. 170 | 171 | ### Anatomy a File 172 | UnityIO has two interfaces that are used when dealing with files. The first one is ```IFile``` and ```IFiles```. Ifiles is simple an extension of ```IList``` with some extended functionality that I will cover later. IFile is the one you will be dealing with the most. IFile is implemented by ```File.cs``` and ```NullFile.cs```. 173 | ### Getting a File 174 | To get a file does not require to much work. In the example below we go to the directory we want and ask for all the files in there. 175 | ``` csharp 176 | // Normally we just use var for the return types but these examples we are using 177 | // the interface types to make it more clear so we have to include the following. 178 | using UnityIO.Interfaces; 179 | 180 | /// 181 | /// A simple example of getting all files from a folder called resources 182 | /// at 'Assets/Resources' 183 | /// 184 | public void GetResourceFiles() 185 | { 186 | // Get our directory 187 | IDirectory resourcesDirectory = IO.Root["Resources"]; 188 | // Get all files. 189 | IFiles files = resourcesDirectory.GetFiles(); 190 | } 191 | ``` 192 | The code above looks for the directory ```Assets/Resources``` and returns all files that are in there. This code returns us back an ```IFiles``` which we can then just loop over to grab each file one by one. 193 | ```csharp 194 | // Get our directory 195 | IDirectory resourcesDirectory = IO.Root["Resources"]; 196 | // Get all files. 197 | IFiles files = resourcesDirectory.GetFiles(); 198 | // iterate over our files and print their names 199 | for(int i = 0; i < files.Count; i++) 200 | { 201 | Debug.Log(files[i].Name); 202 | } 203 | ``` 204 | Above we are using our IFiles and printing the names to the UnityEngine.Debug console. Lets say we wanted 205 | to also get all files recursively we can do that too. 206 | ```csharp 207 | public void GetFilesRecursively() 208 | { 209 | // Get our directory 210 | IDirectory resourcesDirectory = IO.Root["Resources"]; 211 | // Get all files recursively 212 | IFiles files = resourcesDirectory.GetFiles(recursive:true); 213 | } 214 | ``` 215 | 216 | #### Searching for files 217 | Sometimes we also might want to only select files if they match a name. UnityIO under the hood uses System.IO to find files 218 | so it has the ability to use two unique wild cards. ```*```(asterisk) means Zero or more characters in that position. ```?``` (question mark) means Zero or one character in that position. 219 | This search can not use Unity's tags like ```t:```, ```l:```, or ```ref:```. 220 | 221 | Below are a few examples of some search functions. 222 | ```csharp 223 | // Returns every asset with 'Player' in it's name. 224 | var playerFiles = IO.Root.GetFiles("*Player*"); 225 | ``` 226 | ``` csharp 227 | // Get everything named with 'Player' and '.anim' extension 228 | var playerAnimations = IO.Root.GetFiles("*Player*.anim"); 229 | ``` 230 | ```csharp 231 | // get everything named 'Player' with one extra char maybe an 's' 232 | var playerChar = IO.Root.GetFiles("Player?"); 233 | ``` 234 | 235 | ```GetFiles()``` has a few different overrides that lets you combine both the search filter and the recursive bool. 236 | 237 | Notes: 238 | * At one point I might add Regex searches to this feature but I am not sure if that is overkill. Let me know with feedback if you would like that feature. 239 | * You might notice that you don't have the open to filter by Unity types. This was done so the code does not have to be rigid. I just did not want to have to write a huge case statement for all valid Unity types an extensions that match. 240 | * When you call ```GetFiles``` the assets themselves have not been loaded into memory we are only working with the paths. 241 | 242 | ### Deleting a File 243 | Once you have your file you might just want to be able to delete it. 244 | ```csharp 245 | /// 246 | /// Grabs all the files in the root directory and deletes them. 247 | /// 248 | public void DeleteAFile() 249 | { 250 | // Get all our files. 251 | var files = IO.Root.GetFiles(); 252 | // Loop over them all and delete them 253 | for (int i = 0; i < files.Count; i++) 254 | { 255 | // Delete the file. 256 | files[i].Delete(); 257 | } 258 | } 259 | ``` 260 | This is great but lets say you want to delete a file only if it exists. Well just like the IDirectory class IFile has the option to only do tasks if a condition is met. 261 | ```csharp 262 | /// Only delete our file if it exists. 263 | IO.Root.IfFileExists("DeleteMe.txt").Delete(); 264 | ``` 265 | As expected this will only delete the file if it happens to exist on disk and otherwise have no effect. 266 | 267 | Notes: 268 | * All deletion uses AssetDatabase so the meta files are cleaned up too. 269 | * The files get deleted synchronously so if you check if it exists in the next line of code it will be cleared. 270 | * 271 | ### Renaming a File 272 | Sometimes you just want to change the file you are working with to do that try the following code. 273 | 274 | ``` csharp 275 | // Get the file we want to use. 276 | IFile fileToRename = IO.Root.GetFiles("DeleteMe.txt").FirstOrDefault(); 277 | // Rename it 278 | fileToRename.Rename("DontDeleteMe.txt"); 279 | ``` 280 | You might also notice that we used the function ```FirstOrDefault``` this is a function on ```IFiles``` the returns the first file in the list or our null file (which just takes no actions. Read about it below). One thing you should take note of is ```Rename()``` is for renaming and not moving files, use ```Move()``` for that or an exception will be thrown. 281 | ### Moving a File 282 | Moving a file is the same as renaming but you can move the file outside it's current directory. 283 | ```csharp 284 | // Get the file we want to use. 285 | IFile fileToMove = IO.Root.GetFiles("DeleteMe.txt").FirstOrDefault(); 286 | // Move it 287 | fileToRename.Move(IO.Root["Resources"].Path); 288 | ``` 289 | This will take the ```Assets/DeleteMe.txt``` and move it too ```Assets/Resources/DeleteMe.txt```. If a file already exists in that directory it will be given a unique name by append incrementing numbers to the end. 290 | 291 | ### Utility 292 | There are a few helper functions that come bundled with UnityIO that can be quite useful. 293 | 294 | #### Root 295 | ```csharp 296 | IO.Root 297 | ``` 298 | Used in many of the example above this is a shorthand to allow you to grab the root of the current Unity project you are working in. 299 | 300 | #### Convert Paths 301 | UnityIO uses all local Unity asset paths under the hood ie. ```Assets/blah/blah.png``` but if you are going to be interacting with any of C#'s System.IO libraries you will need the full system path. You can get this in a few ways. 302 | ``` csharp 303 | // Gets the full system path of a file instance 304 | string fileSystemPath = IFile.systemPath; 305 | 306 | // Gets the full system path of a directory instance 307 | string directorySystemPath = IDirectory.systemPath; 308 | ``` 309 | This is very useful if you already have created instances for ```IFiles``` and ```IDirectories``` but if you just have a raw path to convert this is not useful. To convert raw paths you can use the following. 310 | ```csharp 311 | public void GetSystemPath(string assetPath) 312 | { 313 | // Convert our asset path to a system path 314 | return IO.AssetPathToSystemPath(assetPath); 315 | } 316 | ``` 317 | or the reverse 318 | 319 | ```csharp 320 | public void GetAssetPath(string systemPath) 321 | { 322 | // Convert our system path to our asset path. 323 | return IO.SystemToAssetPath(systemPath); 324 | } 325 | ``` 326 | Both of these can be used without creating any new classes. Each of these functions checks it's input to verify if it's valid before trying to convert them. If the input is not valid an exception will be thrown so it's best to make sure you are not sending in null or empty strings. 327 | 328 | ## Meta 329 | 330 | Handcrafted by Byron Mayne [[twitter](https://twitter.com/byMayne) • [github](https://github.com/ByronMayne)] 331 | 332 | Released under the [MIT License](http://www.opensource.org/licenses/mit-license.php). 333 | 334 | If you have any feedback or suggestions for UnityIO feel free to contact me. 335 | 336 | 337 | 338 | 339 | 340 | 341 | -------------------------------------------------------------------------------- /proj.cs/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /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.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.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 | -------------------------------------------------------------------------------- /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/AssetDatabase.cs: -------------------------------------------------------------------------------- 1 | #if !UNITY_EDITOR 2 | #define RELEASE_BUILD 3 | #else 4 | using UnityEditor; 5 | using UnityEditorInternal; 6 | using uAssetDatabase = UnityEditor.AssetDatabase; 7 | #endif 8 | 9 | using System; 10 | using Object = UnityEngine.Object; 11 | using UnityEngine; 12 | using System.IO; 13 | 14 | namespace UnityIO.AssetDatabaseWrapper 15 | { 16 | internal static class AssetDatabase 17 | { 18 | /// 19 | /// Returns the root directory of our application . In the editor 20 | /// this is the path to the root of the Unity project and on device 21 | /// this is the . 22 | /// 23 | public static string rootDirectory 24 | { 25 | get 26 | { 27 | #if !RELEASE_BUILD 28 | return Application.dataPath; 29 | #else 30 | return Application.persistentDataPath; 31 | #endif 32 | } 33 | } 34 | 35 | /// 36 | /// Returns true if this path is relative to the current project 37 | /// and false if it's not. 38 | /// 39 | public static bool IsRelativePath(string path) 40 | { 41 | return path.StartsWith(rootDirectory); 42 | } 43 | 44 | /// 45 | /// Returns the first asset object of type at given path assetPath. 46 | /// 47 | /// The type you want to load 48 | /// The path of the asset 49 | /// The loaded object 50 | public static T LoadAssetAtPath(string assetPath) where T : Object 51 | { 52 | 53 | if(IsRelativePath(assetPath)) 54 | { 55 | #if !RELEASE_BUILD 56 | return uAssetDatabase.LoadAssetAtPath(assetPath); 57 | #endif 58 | } 59 | return null; 60 | } 61 | 62 | /// 63 | /// Returns the first asset object of type at given path assetPath. 64 | /// 65 | /// The path of the asset 66 | /// The type you want to load 67 | /// The loaded object 68 | public static Object LoadAssetAtPath(string assetPath, Type type) 69 | { 70 | #if !RELEASE_BUILD 71 | return uAssetDatabase.LoadAssetAtPath(assetPath, type); 72 | #else 73 | return null; 74 | #endif 75 | } 76 | 77 | /// 78 | /// Deletes the asset file at path. 79 | // Returns true if the asset has been successfully deleted, false if it doesn't exit or couldn't be removed. 80 | /// 81 | public static bool DeleteAsset(string assetPath) 82 | { 83 | #if !RELEASE_BUILD 84 | return uAssetDatabase.DeleteAsset(assetPath); 85 | #else 86 | // Convert to system path 87 | string systemPath = IO.AssetPathToSystemPath(assetPath); 88 | // Check if it exists 89 | if(File.Exists(systemPath)) 90 | { 91 | // Delete it 92 | File.Delete(systemPath); 93 | // Return true 94 | return true; 95 | } 96 | else 97 | { 98 | return false; 99 | } 100 | #endif 101 | 102 | } 103 | 104 | /// 105 | /// Creates a new unique path for an asset. 106 | /// 107 | public static string GenerateUniqueAssetPath(string assetPath) 108 | { 109 | // Get our system path since we need the full one. 110 | string systemPath = IO.AssetPathToSystemPath(assetPath); 111 | // Create a holder for a unique one. 112 | string uniquePath = systemPath; 113 | 114 | // Loop till max int (We should never have that many folder but we don't want to loop forever). 115 | for (int i = 0; i < int.MaxValue; i++) 116 | { 117 | // If the file does not exist we can break. 118 | if(!File.Exists(uniquePath)) 119 | { 120 | break; 121 | } 122 | // One with that name already exists so we append our number to the file name. 123 | uniquePath = IO.AppendName(systemPath, " " + i.ToString()); 124 | } 125 | return uniquePath; 126 | } 127 | 128 | /// 129 | /// Duplicates the asset at path and stores it at newPath. 130 | /// 131 | /// Returns true if the copy was successful. 132 | public static bool CopyAsset(string path, string newPath) 133 | { 134 | #if !RELEASE_BUILD 135 | return uAssetDatabase.CopyAsset(path, newPath); 136 | #else 137 | // Convert our path to a system path 138 | string sourceFilePath = IO.AssetPathToSystemPath(path); 139 | // Get a unique one for our detestation path. 140 | string destSystemPath = GenerateUniqueAssetPath(newPath); 141 | // Copy the file. 142 | File.Copy(sourceFilePath, destSystemPath, false); 143 | // Return our result 144 | return true. 145 | #endif 146 | } 147 | 148 | /// 149 | /// Returns true if the fileName is valid on the supported platform. 150 | /// 151 | /// The name of the file you want to check. 152 | /// True if it's valid and false if it's not. 153 | public static bool IsValidFileName(string fileName) 154 | { 155 | char[] invalidChars = Path.GetInvalidFileNameChars(); 156 | 157 | for(int i = 0; i < invalidChars.Length; i++) 158 | { 159 | if(fileName.IndexOf(invalidChars[i]) > -1) 160 | { 161 | return false; 162 | } 163 | } 164 | 165 | return true; 166 | } 167 | 168 | /// 169 | /// returns true if it exists, false otherwise false. 170 | /// 171 | public static bool IsValidFolder(string assetPath) 172 | { 173 | #if !RELEASE_BUILD 174 | return uAssetDatabase.IsValidFolder(assetPath); 175 | #else 176 | // Convert our path to a system path 177 | string sourceFilePath = IO.AssetPathToSystemPath(assetPath); 178 | // Return if it exists or not. 179 | return Directory.Exists(sourceFilePath); 180 | #endif 181 | } 182 | 183 | /// 184 | /// Checks if an asset file can be moved from one folder to another. (Without actually moving the file). 185 | /// 186 | /// The path where the asset currently resides. 187 | /// The path which the asset should be moved to. 188 | /// An empty string if the asset can be moved, otherwise an error message. 189 | public static string ValidateMoveAsset(string oldPath, string newPath) 190 | { 191 | #if !RELEASE_BUILD 192 | return uAssetDatabase.ValidateMoveAsset(oldPath, newPath); 193 | 194 | 195 | #else 196 | oldPath = IO.AssetPathToSystemPath(oldPath); 197 | newPath = IO.AssetPathToSystemPath(newPath); 198 | 199 | if(File.Exists(newPath)) 200 | { 201 | return "File Already Exists"; 202 | } 203 | 204 | if(AssetDatabase.IsValidFileName(newPath)) 205 | { 206 | return "Not valid file name"; 207 | } 208 | 209 | return string.Empty; 210 | #endif 211 | } 212 | 213 | /// 214 | /// Move an asset file from one folder to another. 215 | /// 216 | /// The path where the asset currently resides. 217 | /// The path which the asset should be moved to. 218 | /// 219 | public static string MoveAsset(string oldPath, string newPath) 220 | { 221 | #if !RELEASE_BUILD 222 | return uAssetDatabase.MoveAsset(oldPath, newPath); 223 | #else 224 | oldPath = IO.AssetPathToSystemPath(oldPath); 225 | newPath = IO.AssetPathToSystemPath(newPath); 226 | File.Move(oldPath, newPath); 227 | #endif 228 | } 229 | 230 | /// 231 | /// Rename an asset file. 232 | /// 233 | /// The path where the asset currently resides. 234 | /// The new name which should be given to the asset. 235 | /// 236 | public static string RenameAsset(string pathName, string newName) 237 | { 238 | #if !RELEASE_BUILD 239 | return uAssetDatabase.RenameAsset(pathName, newName); 240 | #endif 241 | 242 | } 243 | 244 | /// 245 | /// Create a new folder. 246 | /// 247 | /// The name of the parent folder. 248 | /// The name of the new folder. 249 | /// The GUID of the newly created folder. 250 | public static string CreateFolder(string parentFolder, string newFolderName) 251 | { 252 | #if !RELEASE_BUILD 253 | return uAssetDatabase.CreateFolder(parentFolder, newFolderName); 254 | #endif 255 | } 256 | 257 | /// 258 | /// Search the asset database using the search filter string. 259 | /// 260 | /// The filter string can contain search data. See below for details about this string. 261 | /// The folders where the search will start. 262 | /// Array of matching asset. Note that GUIDs will be returned. 263 | public static string[] FindAssets(string filter, string[] searchInFolders) 264 | { 265 | #if !RELEASE_BUILD 266 | return uAssetDatabase.FindAssets(filter, searchInFolders); 267 | #endif 268 | } 269 | 270 | /// 271 | /// Given an absolute path to a directory, this method will return an array of all it's subdirectories. 272 | /// 273 | public static string[] GetSubFolders(string path) 274 | { 275 | #if !RELEASE_BUILD 276 | return uAssetDatabase.GetSubFolders(path); 277 | #endif 278 | } 279 | 280 | /// 281 | /// Converts a system path to a project local one. 282 | /// 283 | public static string GetProjectRelativePath(string path) 284 | { 285 | #if !RELEASE_BUILD 286 | return FileUtil.GetProjectRelativePath(path); 287 | #endif 288 | } 289 | 290 | /// 291 | /// Creates a new asset at path. 292 | /// You must ensure that the path uses a supported extension ('.mat' for materials, '.cubemap' for cubemaps, '.GUISkin' 293 | /// for skins, '.anim' for animations and '.asset' for arbitrary other assets.) 294 | /// Note: Most of the uses of this function don't work on a build. 295 | /// 296 | public static void CreateAsset(T asset, string path) where T : Object 297 | { 298 | #if !RELEASE_BUILD 299 | uAssetDatabase.CreateAsset(asset, path); 300 | #endif 301 | } 302 | } 303 | } 304 | -------------------------------------------------------------------------------- /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/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/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/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/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/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/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.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/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/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/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/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: -------------------------------------------------------------------------------- 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/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/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/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/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/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: -------------------------------------------------------------------------------- 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/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/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/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/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/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/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/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: -------------------------------------------------------------------------------- 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/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/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/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/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/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/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/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/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/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/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: -------------------------------------------------------------------------------- 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/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/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/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/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/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/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 | -------------------------------------------------------------------------------- /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/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/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/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(tempPath); 220 | 221 | if (preExistingAsset != null) 222 | { 223 | throw new FileAlreadyExistsException("Rename can't be completed since an asset already exists with that name at path " + tempPath); 224 | } 225 | 226 | AssetDatabase.RenameAsset(tempPath, newName); 227 | } 228 | 229 | /// 230 | /// Loads the Unity asset at the files path. 231 | /// 232 | /// Returns the asset 233 | public UnityEngine.Object LoadAsset() 234 | { 235 | return AssetDatabase.LoadAssetAtPath(path, typeof(Object)); 236 | } 237 | 238 | /// 239 | /// Loads the Unity asset at the files path. 240 | /// 241 | /// Returns the asset 242 | public T LoadAsset() where T : UnityEngine.Object 243 | { 244 | return AssetDatabase.LoadAssetAtPath(path); 245 | } 246 | } 247 | } 248 | -------------------------------------------------------------------------------- /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: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /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/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/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/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/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/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/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/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/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/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: -------------------------------------------------------------------------------- 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 UnityIO.Classes; 32 | using UnityIO.AssetDatabaseWrapper; 33 | 34 | namespace UnityIO 35 | { 36 | public class IO 37 | { 38 | /// 39 | /// A list of chars that are not valid for file names in Unity. 40 | /// 41 | public static readonly char[] INVALID_FILE_NAME_CHARS = new char[] { '/', '\\', '<', '>', ':', '|', '"' }; 42 | /// 43 | /// The char we use to split our paths. 44 | /// 45 | public const char PATH_SPLITTER = '/'; 46 | 47 | /// 48 | /// The starting part of a path that is required for it to be an Asset Path. 49 | /// 50 | public const string ROOT_FOLDER_NAME = "Assets"; 51 | 52 | /// 53 | /// A function used to make sure that paths being sent to UnityIO are the correct type. One common 54 | /// problem with Unity's own file system is that every function expects a different format. So if 55 | /// we force the user to way and explode with fire every other way it will become easier to use. This 56 | /// will throw exceptions if the path is not valid. 57 | /// 58 | /// The path you want to check. 59 | public static void ValidatePath(string path) 60 | { 61 | if (string.IsNullOrEmpty(path)) 62 | { 63 | throw new System.IO.IOException("UnityIO. A path can not be null or empty when searching the project"); 64 | } 65 | 66 | if (path[path.Length - 1] == PATH_SPLITTER) 67 | { 68 | throw new System.IO.IOException("UnityIO: All directory paths are expected to not end with a leading slash. ( i.e. the '/' character )"); 69 | } 70 | } 71 | 72 | /// 73 | /// Checks to see if the file name contains any invalid chars that Unity does not accept. 74 | /// 75 | /// Path.GetInvalidFileNameChars() works on Windows but only returns back '/' on Mac so we have to make our own version. 76 | /// true if is valid file name otherwise, false. 77 | /// Name. 78 | public static bool IsValidFileName(string name) 79 | { 80 | for (int i = 0; i < INVALID_FILE_NAME_CHARS.Length; i++) 81 | { 82 | if (name.IndexOf(INVALID_FILE_NAME_CHARS[i]) != -1) 83 | { 84 | return false; 85 | } 86 | } 87 | return true; 88 | } 89 | 90 | /// 91 | /// Gets the root directory that is defined by 92 | /// 93 | public static IDirectory Root 94 | { 95 | get 96 | { 97 | return new Directory("Assets"); 98 | } 99 | } 100 | 101 | /// 102 | /// Creates a new class for a path within a Unity project. Can also be a full 103 | /// system path as long as it leads into this Unity project otherwise returns a . 104 | /// 105 | /// 106 | /// 107 | public static IDirectory Get(string path) 108 | { 109 | // Is just a simple Unity Path. 110 | if (path.StartsWith(AssetDatabase.rootDirectory)) 111 | { 112 | // Convert our path 113 | string assetPath = SystemToAssetPath(path); 114 | // Return the result. 115 | return new Directory(assetPath); 116 | } 117 | 118 | // If it starts with Assets it must be an asset Path 119 | if (path.StartsWith(ROOT_FOLDER_NAME)) 120 | { 121 | return new Directory(path); 122 | } 123 | 124 | // It's invalid 125 | throw new System.ArgumentException("Path", "Is not contained within the current Unity project. See: '" + path + "'."); 126 | } 127 | 128 | /// 129 | /// Converts a a full system path to a local asset path. 130 | /// 131 | /// Input (SystemPath): C:/Users/Projects/MyProject/Asset/Images/Bear.png 132 | /// Output (AssetPath) : Assets/Images/Bear.png 133 | /// 134 | /// 135 | /// 136 | /// 137 | public static string SystemToAssetPath(string systemPath) 138 | { 139 | string assetPath = string.Empty; 140 | 141 | // We have to make sure we are not working on a useless string. 142 | if (string.IsNullOrEmpty(systemPath)) 143 | { 144 | throw new System.ArgumentNullException("SystemPath", "The asset path that was sent in was null or empty. Can not convert"); 145 | } 146 | 147 | // Make sure we are in the right directory 148 | if (!systemPath.StartsWith(AssetDatabase.rootDirectory)) 149 | { 150 | throw new System.InvalidOperationException(string.Format("The path {0} does not start with {1} which is our current directory. This can't be converted", systemPath, AssetDatabase.rootDirectory)); 151 | } 152 | 153 | // Get the number of chars in our system directory path 154 | int systemDirNameLength = AssetDatabase.rootDirectory.Length; 155 | 156 | // Subtract the name of the asset folder since we want to keep that part. 157 | systemDirNameLength -= ROOT_FOLDER_NAME.Length; 158 | 159 | // Get the count of the number of letter left in our path starting from '/Assets' 160 | int assetDirNameLength = systemPath.Length - systemDirNameLength; 161 | 162 | // Substring to get our result. 163 | assetPath = systemPath.Substring(systemDirNameLength, assetDirNameLength); 164 | 165 | // Return 166 | return assetPath; 167 | } 168 | 169 | /// 170 | /// Appends a string to the end of the file name. This is before the extension. 171 | /// 172 | public static string AppendName(string assetPath, string appendedText) 173 | { 174 | // Create a holder for our name 175 | char[] appendedPath = new char[assetPath.Length + appendedText.Length]; 176 | // Get the index of our extension 177 | int extensionIndex = assetPath.LastIndexOf('.'); 178 | // Copy it into our new path 179 | assetPath.CopyTo(0, appendedPath, 0, extensionIndex); 180 | // Append our new text 181 | appendedText.CopyTo(0, appendedPath, extensionIndex + 1, appendedText.Length); 182 | // Get the length of our starting extension 183 | int extensionLength = assetPath.Length - extensionIndex; 184 | // Add back on the extension 185 | assetPath.CopyTo(extensionIndex, appendedPath, extensionIndex + appendedText.Length, extensionLength); 186 | // Return the result 187 | return new string(appendedPath); 188 | } 189 | 190 | /// 191 | /// Takes a Unity asset path and converts it to a system path. 192 | /// 193 | /// Input (AssetPath) : Assets/Images/Bear.png 194 | /// Output (SystemPath): C:/Users/Projects/MyProject/Asset/Images/Bear.png 195 | /// 196 | /// 197 | /// The Unity asset path you want to convert. 198 | /// The newly created system path. 199 | public static string AssetPathToSystemPath(string assetPath) 200 | { 201 | // A local holder for our working path. 202 | string systemPath = string.Empty; 203 | 204 | // We have to make sure we are not working on a useless string. 205 | if (string.IsNullOrEmpty(assetPath)) 206 | { 207 | throw new System.ArgumentNullException("AssetPath", "The asset path that was sent in was null or empty. Can not convert"); 208 | } 209 | 210 | // Get the index of 'Asset/' part of the path 211 | if (!assetPath.StartsWith(ROOT_FOLDER_NAME + PATH_SPLITTER)) 212 | { 213 | // This is returned by Unity and we must have it to convert 214 | throw new System.InvalidOperationException(string.Format("Can't convert '{0}' to a System Path since it does not start with '{1}'", assetPath, ROOT_FOLDER_NAME + PATH_SPLITTER)); 215 | } 216 | 217 | // Get our starting length. 218 | int pathLength = assetPath.Length; 219 | 220 | // Now subtract the root folder name 221 | pathLength -= ROOT_FOLDER_NAME.Length; 222 | 223 | // Now get the substring 224 | assetPath = assetPath.Substring(ROOT_FOLDER_NAME.Length, pathLength); 225 | 226 | // Combine them 227 | systemPath = AssetDatabase.rootDirectory + assetPath; 228 | 229 | // Return the result 230 | return systemPath; 231 | } 232 | } 233 | } -------------------------------------------------------------------------------- /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/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/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/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.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.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 | -------------------------------------------------------------------------------- /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/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/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/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/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.unity/ProjectSettings/ProjectSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!129 &1 4 | PlayerSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 8 7 | AndroidProfiler: 0 8 | defaultScreenOrientation: 4 9 | targetDevice: 2 10 | useOnDemandResources: 0 11 | accelerometerFrequency: 60 12 | companyName: DefaultCompany 13 | productName: UnityIO 14 | defaultCursor: {fileID: 0} 15 | cursorHotspot: {x: 0, y: 0} 16 | m_SplashScreenStyle: 0 17 | m_ShowUnitySplashScreen: 1 18 | m_VirtualRealitySplashScreen: {fileID: 0} 19 | m_HolographicTrackingLossScreen: {fileID: 0} 20 | defaultScreenWidth: 1024 21 | defaultScreenHeight: 768 22 | defaultScreenWidthWeb: 960 23 | defaultScreenHeightWeb: 600 24 | m_RenderingPath: 1 25 | m_MobileRenderingPath: 1 26 | m_ActiveColorSpace: 0 27 | m_MTRendering: 1 28 | m_MobileMTRendering: 0 29 | m_StackTraceTypes: 010000000100000001000000010000000100000001000000 30 | iosShowActivityIndicatorOnLoading: -1 31 | androidShowActivityIndicatorOnLoading: -1 32 | iosAppInBackgroundBehavior: 0 33 | displayResolutionDialog: 1 34 | iosAllowHTTPDownload: 1 35 | allowedAutorotateToPortrait: 1 36 | allowedAutorotateToPortraitUpsideDown: 1 37 | allowedAutorotateToLandscapeRight: 1 38 | allowedAutorotateToLandscapeLeft: 1 39 | useOSAutorotation: 1 40 | use32BitDisplayBuffer: 1 41 | disableDepthAndStencilBuffers: 0 42 | defaultIsFullScreen: 1 43 | defaultIsNativeResolution: 1 44 | runInBackground: 0 45 | captureSingleScreen: 0 46 | Override IPod Music: 0 47 | Prepare IOS For Recording: 0 48 | submitAnalytics: 1 49 | usePlayerLog: 1 50 | bakeCollisionMeshes: 0 51 | forceSingleInstance: 0 52 | resizableWindow: 0 53 | useMacAppStoreValidation: 0 54 | gpuSkinning: 0 55 | graphicsJobs: 0 56 | xboxPIXTextureCapture: 0 57 | xboxEnableAvatar: 0 58 | xboxEnableKinect: 0 59 | xboxEnableKinectAutoTracking: 0 60 | xboxEnableFitness: 0 61 | visibleInBackground: 0 62 | allowFullscreenSwitch: 1 63 | macFullscreenMode: 2 64 | d3d9FullscreenMode: 1 65 | d3d11FullscreenMode: 1 66 | xboxSpeechDB: 0 67 | xboxEnableHeadOrientation: 0 68 | xboxEnableGuest: 0 69 | xboxEnablePIXSampling: 0 70 | n3dsDisableStereoscopicView: 0 71 | n3dsEnableSharedListOpt: 1 72 | n3dsEnableVSync: 0 73 | uiUse16BitDepthBuffer: 0 74 | ignoreAlphaClear: 0 75 | xboxOneResolution: 0 76 | xboxOneMonoLoggingLevel: 0 77 | ps3SplashScreen: {fileID: 0} 78 | videoMemoryForVertexBuffers: 0 79 | psp2PowerMode: 0 80 | psp2AcquireBGM: 1 81 | wiiUTVResolution: 0 82 | wiiUGamePadMSAA: 1 83 | wiiUSupportsNunchuk: 0 84 | wiiUSupportsClassicController: 0 85 | wiiUSupportsBalanceBoard: 0 86 | wiiUSupportsMotionPlus: 0 87 | wiiUSupportsProController: 0 88 | wiiUAllowScreenCapture: 1 89 | wiiUControllerCount: 0 90 | m_SupportedAspectRatios: 91 | 4:3: 1 92 | 5:4: 1 93 | 16:10: 1 94 | 16:9: 1 95 | Others: 1 96 | bundleIdentifier: com.Company.ProductName 97 | bundleVersion: 1.0 98 | preloadedAssets: [] 99 | metroEnableIndependentInputSource: 0 100 | m_HolographicPauseOnTrackingLoss: 1 101 | xboxOneDisableKinectGpuReservation: 0 102 | singlePassStereoRendering: 0 103 | protectGraphicsMemory: 0 104 | productGUID: 4f1a48a9b23d8b740a7aa47665ec97a3 105 | AndroidBundleVersionCode: 1 106 | AndroidMinSdkVersion: 9 107 | AndroidPreferredInstallLocation: 1 108 | aotOptions: 109 | apiCompatibilityLevel: 2 110 | stripEngineCode: 1 111 | iPhoneStrippingLevel: 0 112 | iPhoneScriptCallOptimization: 0 113 | iPhoneBuildNumber: 0 114 | ForceInternetPermission: 0 115 | ForceSDCardPermission: 0 116 | CreateWallpaper: 0 117 | APKExpansionFiles: 0 118 | preloadShaders: 0 119 | StripUnusedMeshComponents: 0 120 | VertexChannelCompressionMask: 121 | serializedVersion: 2 122 | m_Bits: 238 123 | iPhoneSdkVersion: 988 124 | iPhoneTargetOSVersion: 22 125 | tvOSSdkVersion: 0 126 | tvOSTargetOSVersion: 900 127 | uIPrerenderedIcon: 0 128 | uIRequiresPersistentWiFi: 0 129 | uIRequiresFullScreen: 1 130 | uIStatusBarHidden: 1 131 | uIExitOnSuspend: 0 132 | uIStatusBarStyle: 0 133 | iPhoneSplashScreen: {fileID: 0} 134 | iPhoneHighResSplashScreen: {fileID: 0} 135 | iPhoneTallHighResSplashScreen: {fileID: 0} 136 | iPhone47inSplashScreen: {fileID: 0} 137 | iPhone55inPortraitSplashScreen: {fileID: 0} 138 | iPhone55inLandscapeSplashScreen: {fileID: 0} 139 | iPadPortraitSplashScreen: {fileID: 0} 140 | iPadHighResPortraitSplashScreen: {fileID: 0} 141 | iPadLandscapeSplashScreen: {fileID: 0} 142 | iPadHighResLandscapeSplashScreen: {fileID: 0} 143 | appleTVSplashScreen: {fileID: 0} 144 | tvOSSmallIconLayers: [] 145 | tvOSLargeIconLayers: [] 146 | tvOSTopShelfImageLayers: [] 147 | iOSLaunchScreenType: 0 148 | iOSLaunchScreenPortrait: {fileID: 0} 149 | iOSLaunchScreenLandscape: {fileID: 0} 150 | iOSLaunchScreenBackgroundColor: 151 | serializedVersion: 2 152 | rgba: 0 153 | iOSLaunchScreenFillPct: 100 154 | iOSLaunchScreenSize: 100 155 | iOSLaunchScreenCustomXibPath: 156 | iOSLaunchScreeniPadType: 0 157 | iOSLaunchScreeniPadImage: {fileID: 0} 158 | iOSLaunchScreeniPadBackgroundColor: 159 | serializedVersion: 2 160 | rgba: 0 161 | iOSLaunchScreeniPadFillPct: 100 162 | iOSLaunchScreeniPadSize: 100 163 | iOSLaunchScreeniPadCustomXibPath: 164 | iOSDeviceRequirements: [] 165 | iOSURLSchemes: [] 166 | AndroidTargetDevice: 0 167 | AndroidSplashScreenScale: 0 168 | androidSplashScreen: {fileID: 0} 169 | AndroidKeystoreName: 170 | AndroidKeyaliasName: 171 | AndroidTVCompatibility: 1 172 | AndroidIsGame: 1 173 | androidEnableBanner: 1 174 | m_AndroidBanners: 175 | - width: 320 176 | height: 180 177 | banner: {fileID: 0} 178 | androidGamepadSupportLevel: 0 179 | resolutionDialogBanner: {fileID: 0} 180 | m_BuildTargetIcons: [] 181 | m_BuildTargetBatching: [] 182 | m_BuildTargetGraphicsAPIs: [] 183 | webPlayerTemplate: APPLICATION:Default 184 | m_TemplateCustomTags: {} 185 | wiiUTitleID: 0005000011000000 186 | wiiUGroupID: 00010000 187 | wiiUCommonSaveSize: 4096 188 | wiiUAccountSaveSize: 2048 189 | wiiUOlvAccessKey: 0 190 | wiiUTinCode: 0 191 | wiiUJoinGameId: 0 192 | wiiUJoinGameModeMask: 0000000000000000 193 | wiiUCommonBossSize: 0 194 | wiiUAccountBossSize: 0 195 | wiiUAddOnUniqueIDs: [] 196 | wiiUMainThreadStackSize: 3072 197 | wiiULoaderThreadStackSize: 1024 198 | wiiUSystemHeapSize: 128 199 | wiiUTVStartupScreen: {fileID: 0} 200 | wiiUGamePadStartupScreen: {fileID: 0} 201 | wiiUProfilerLibPath: 202 | actionOnDotNetUnhandledException: 1 203 | enableInternalProfiler: 0 204 | logObjCUncaughtExceptions: 1 205 | enableCrashReportAPI: 0 206 | locationUsageDescription: 207 | XboxTitleId: 208 | XboxImageXexPath: 209 | XboxSpaPath: 210 | XboxGenerateSpa: 0 211 | XboxDeployKinectResources: 0 212 | XboxSplashScreen: {fileID: 0} 213 | xboxEnableSpeech: 0 214 | xboxAdditionalTitleMemorySize: 0 215 | xboxDeployKinectHeadOrientation: 0 216 | xboxDeployKinectHeadPosition: 0 217 | ps3TitleConfigPath: 218 | ps3DLCConfigPath: 219 | ps3ThumbnailPath: 220 | ps3BackgroundPath: 221 | ps3SoundPath: 222 | ps3NPAgeRating: 12 223 | ps3TrophyCommId: 224 | ps3NpCommunicationPassphrase: 225 | ps3TrophyPackagePath: 226 | ps3BootCheckMaxSaveGameSizeKB: 128 227 | ps3TrophyCommSig: 228 | ps3SaveGameSlots: 1 229 | ps3TrialMode: 0 230 | ps3VideoMemoryForAudio: 0 231 | ps3EnableVerboseMemoryStats: 0 232 | ps3UseSPUForUmbra: 0 233 | ps3EnableMoveSupport: 1 234 | ps3DisableDolbyEncoding: 0 235 | ps4NPAgeRating: 12 236 | ps4NPTitleSecret: 237 | ps4NPTrophyPackPath: 238 | ps4ParentalLevel: 1 239 | ps4ContentID: ED1633-NPXX51362_00-0000000000000000 240 | ps4Category: 0 241 | ps4MasterVersion: 01.00 242 | ps4AppVersion: 01.00 243 | ps4AppType: 0 244 | ps4ParamSfxPath: 245 | ps4VideoOutPixelFormat: 0 246 | ps4VideoOutResolution: 4 247 | ps4PronunciationXMLPath: 248 | ps4PronunciationSIGPath: 249 | ps4BackgroundImagePath: 250 | ps4StartupImagePath: 251 | ps4SaveDataImagePath: 252 | ps4SdkOverride: 253 | ps4BGMPath: 254 | ps4ShareFilePath: 255 | ps4ShareOverlayImagePath: 256 | ps4PrivacyGuardImagePath: 257 | ps4NPtitleDatPath: 258 | ps4RemotePlayKeyAssignment: -1 259 | ps4RemotePlayKeyMappingDir: 260 | ps4PlayTogetherPlayerCount: 0 261 | ps4EnterButtonAssignment: 1 262 | ps4ApplicationParam1: 0 263 | ps4ApplicationParam2: 0 264 | ps4ApplicationParam3: 0 265 | ps4ApplicationParam4: 0 266 | ps4DownloadDataSize: 0 267 | ps4GarlicHeapSize: 2048 268 | ps4Passcode: frAQBc8Wsa1xVPfvJcrgRYwTiizs2trQ 269 | ps4UseDebugIl2cppLibs: 0 270 | ps4pnSessions: 1 271 | ps4pnPresence: 1 272 | ps4pnFriends: 1 273 | ps4pnGameCustomData: 1 274 | playerPrefsSupport: 0 275 | ps4ReprojectionSupport: 0 276 | ps4UseAudio3dBackend: 0 277 | ps4SocialScreenEnabled: 0 278 | ps4Audio3dVirtualSpeakerCount: 14 279 | ps4attribCpuUsage: 0 280 | ps4PatchPkgPath: 281 | ps4PatchLatestPkgPath: 282 | ps4PatchChangeinfoPath: 283 | ps4attribUserManagement: 0 284 | ps4attribMoveSupport: 0 285 | ps4attrib3DSupport: 0 286 | ps4attribShareSupport: 0 287 | ps4disableAutoHideSplash: 0 288 | ps4IncludedModules: [] 289 | monoEnv: 290 | psp2Splashimage: {fileID: 0} 291 | psp2NPTrophyPackPath: 292 | psp2NPSupportGBMorGJP: 0 293 | psp2NPAgeRating: 12 294 | psp2NPTitleDatPath: 295 | psp2NPCommsID: 296 | psp2NPCommunicationsID: 297 | psp2NPCommsPassphrase: 298 | psp2NPCommsSig: 299 | psp2ParamSfxPath: 300 | psp2ManualPath: 301 | psp2LiveAreaGatePath: 302 | psp2LiveAreaBackroundPath: 303 | psp2LiveAreaPath: 304 | psp2LiveAreaTrialPath: 305 | psp2PatchChangeInfoPath: 306 | psp2PatchOriginalPackage: 307 | psp2PackagePassword: F69AzBlax3CF3EDNhm3soLBPh71Yexui 308 | psp2KeystoneFile: 309 | psp2MemoryExpansionMode: 0 310 | psp2DRMType: 0 311 | psp2StorageType: 0 312 | psp2MediaCapacity: 0 313 | psp2DLCConfigPath: 314 | psp2ThumbnailPath: 315 | psp2BackgroundPath: 316 | psp2SoundPath: 317 | psp2TrophyCommId: 318 | psp2TrophyPackagePath: 319 | psp2PackagedResourcesPath: 320 | psp2SaveDataQuota: 10240 321 | psp2ParentalLevel: 1 322 | psp2ShortTitle: Not Set 323 | psp2ContentID: IV0000-ABCD12345_00-0123456789ABCDEF 324 | psp2Category: 0 325 | psp2MasterVersion: 01.00 326 | psp2AppVersion: 01.00 327 | psp2TVBootMode: 0 328 | psp2EnterButtonAssignment: 2 329 | psp2TVDisableEmu: 0 330 | psp2AllowTwitterDialog: 1 331 | psp2Upgradable: 0 332 | psp2HealthWarning: 0 333 | psp2UseLibLocation: 0 334 | psp2InfoBarOnStartup: 0 335 | psp2InfoBarColor: 0 336 | psp2UseDebugIl2cppLibs: 0 337 | psmSplashimage: {fileID: 0} 338 | spritePackerPolicy: 339 | scriptingDefineSymbols: {} 340 | metroPackageName: UnityIO 341 | metroPackageVersion: 342 | metroCertificatePath: 343 | metroCertificatePassword: 344 | metroCertificateSubject: 345 | metroCertificateIssuer: 346 | metroCertificateNotAfter: 0000000000000000 347 | metroApplicationDescription: UnityIO 348 | wsaImages: {} 349 | metroTileShortName: 350 | metroCommandLineArgsFile: 351 | metroTileShowName: 0 352 | metroMediumTileShowName: 0 353 | metroLargeTileShowName: 0 354 | metroWideTileShowName: 0 355 | metroDefaultTileSize: 1 356 | metroTileForegroundText: 1 357 | metroTileBackgroundColor: {r: 0.13333334, g: 0.17254902, b: 0.21568628, a: 0} 358 | metroSplashScreenBackgroundColor: {r: 0.12941177, g: 0.17254902, b: 0.21568628, 359 | a: 1} 360 | metroSplashScreenUseBackgroundColor: 0 361 | platformCapabilities: {} 362 | metroFTAName: 363 | metroFTAFileTypes: [] 364 | metroProtocolName: 365 | metroCompilationOverrides: 1 366 | tizenProductDescription: 367 | tizenProductURL: 368 | tizenSigningProfileName: 369 | tizenGPSPermissions: 0 370 | tizenMicrophonePermissions: 0 371 | n3dsUseExtSaveData: 0 372 | n3dsCompressStaticMem: 1 373 | n3dsExtSaveDataNumber: 0x12345 374 | n3dsStackSize: 131072 375 | n3dsTargetPlatform: 2 376 | n3dsRegion: 7 377 | n3dsMediaSize: 0 378 | n3dsLogoStyle: 3 379 | n3dsTitle: GameName 380 | n3dsProductCode: 381 | n3dsApplicationId: 0xFF3FF 382 | stvDeviceAddress: 383 | stvProductDescription: 384 | stvProductAuthor: 385 | stvProductAuthorEmail: 386 | stvProductLink: 387 | stvProductCategory: 0 388 | XboxOneProductId: 389 | XboxOneUpdateKey: 390 | XboxOneSandboxId: 391 | XboxOneContentId: 392 | XboxOneTitleId: 393 | XboxOneSCId: 394 | XboxOneGameOsOverridePath: 395 | XboxOnePackagingOverridePath: 396 | XboxOneAppManifestOverridePath: 397 | XboxOnePackageEncryption: 0 398 | XboxOnePackageUpdateGranularity: 2 399 | XboxOneDescription: 400 | XboxOneIsContentPackage: 0 401 | XboxOneEnableGPUVariability: 0 402 | XboxOneSockets: {} 403 | XboxOneSplashScreen: {fileID: 0} 404 | XboxOneAllowedProductIds: [] 405 | XboxOnePersistentLocalStorageSize: 0 406 | intPropertyNames: 407 | - Standalone::ScriptingBackend 408 | - WebPlayer::ScriptingBackend 409 | Standalone::ScriptingBackend: 0 410 | WebPlayer::ScriptingBackend: 0 411 | boolPropertyNames: 412 | - Android::VR::enable 413 | - Metro::VR::enable 414 | - N3DS::VR::enable 415 | - PS3::VR::enable 416 | - PS4::VR::enable 417 | - PSM::VR::enable 418 | - PSP2::VR::enable 419 | - SamsungTV::VR::enable 420 | - Standalone::VR::enable 421 | - Tizen::VR::enable 422 | - WebGL::VR::enable 423 | - WebPlayer::VR::enable 424 | - WiiU::VR::enable 425 | - Xbox360::VR::enable 426 | - XboxOne::VR::enable 427 | - XboxOne::enus 428 | - iOS::VR::enable 429 | - tvOS::VR::enable 430 | Android::VR::enable: 0 431 | Metro::VR::enable: 0 432 | N3DS::VR::enable: 0 433 | PS3::VR::enable: 0 434 | PS4::VR::enable: 0 435 | PSM::VR::enable: 0 436 | PSP2::VR::enable: 0 437 | SamsungTV::VR::enable: 0 438 | Standalone::VR::enable: 0 439 | Tizen::VR::enable: 0 440 | WebGL::VR::enable: 0 441 | WebPlayer::VR::enable: 0 442 | WiiU::VR::enable: 0 443 | Xbox360::VR::enable: 0 444 | XboxOne::VR::enable: 0 445 | XboxOne::enus: 1 446 | iOS::VR::enable: 0 447 | tvOS::VR::enable: 0 448 | stringPropertyNames: 449 | - Analytics_ServiceEnabled::Analytics_ServiceEnabled 450 | - Build_ServiceEnabled::Build_ServiceEnabled 451 | - Collab_ServiceEnabled::Collab_ServiceEnabled 452 | - ErrorHub_ServiceEnabled::ErrorHub_ServiceEnabled 453 | - Game_Performance_ServiceEnabled::Game_Performance_ServiceEnabled 454 | - Hub_ServiceEnabled::Hub_ServiceEnabled 455 | - Purchasing_ServiceEnabled::Purchasing_ServiceEnabled 456 | - UNet_ServiceEnabled::UNet_ServiceEnabled 457 | - Unity_Ads_ServiceEnabled::Unity_Ads_ServiceEnabled 458 | Analytics_ServiceEnabled::Analytics_ServiceEnabled: False 459 | Build_ServiceEnabled::Build_ServiceEnabled: False 460 | Collab_ServiceEnabled::Collab_ServiceEnabled: False 461 | ErrorHub_ServiceEnabled::ErrorHub_ServiceEnabled: False 462 | Game_Performance_ServiceEnabled::Game_Performance_ServiceEnabled: False 463 | Hub_ServiceEnabled::Hub_ServiceEnabled: False 464 | Purchasing_ServiceEnabled::Purchasing_ServiceEnabled: False 465 | UNet_ServiceEnabled::UNet_ServiceEnabled: False 466 | Unity_Ads_ServiceEnabled::Unity_Ads_ServiceEnabled: False 467 | vectorPropertyNames: 468 | - Android::VR::enabledDevices 469 | - Metro::VR::enabledDevices 470 | - N3DS::VR::enabledDevices 471 | - PS3::VR::enabledDevices 472 | - PS4::VR::enabledDevices 473 | - PSM::VR::enabledDevices 474 | - PSP2::VR::enabledDevices 475 | - SamsungTV::VR::enabledDevices 476 | - Standalone::VR::enabledDevices 477 | - Tizen::VR::enabledDevices 478 | - WebGL::VR::enabledDevices 479 | - WebPlayer::VR::enabledDevices 480 | - WiiU::VR::enabledDevices 481 | - Xbox360::VR::enabledDevices 482 | - XboxOne::VR::enabledDevices 483 | - iOS::VR::enabledDevices 484 | - tvOS::VR::enabledDevices 485 | Android::VR::enabledDevices: 486 | - Oculus 487 | Metro::VR::enabledDevices: 488 | - HoloLens 489 | N3DS::VR::enabledDevices: [] 490 | PS3::VR::enabledDevices: [] 491 | PS4::VR::enabledDevices: 492 | - PlayStationVR 493 | PSM::VR::enabledDevices: [] 494 | PSP2::VR::enabledDevices: [] 495 | SamsungTV::VR::enabledDevices: [] 496 | Standalone::VR::enabledDevices: 497 | - Oculus 498 | Tizen::VR::enabledDevices: [] 499 | WebGL::VR::enabledDevices: [] 500 | WebPlayer::VR::enabledDevices: [] 501 | WiiU::VR::enabledDevices: [] 502 | Xbox360::VR::enabledDevices: [] 503 | XboxOne::VR::enabledDevices: [] 504 | iOS::VR::enabledDevices: [] 505 | tvOS::VR::enabledDevices: [] 506 | cloudProjectId: 507 | projectName: 508 | organizationId: 509 | cloudEnabled: 0 510 | -------------------------------------------------------------------------------- /proj.unity/ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 5.4.0b22-HTP 2 | m_StandardAssetsVersion: 0 3 | -------------------------------------------------------------------------------- /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/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/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/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/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 | --------------------------------------------------------------------------------