├── Tools ├── Assets │ ├── HelloWorld.png │ ├── BuildMesh.meta │ ├── Generic.meta │ ├── Draw2DCollision.meta │ ├── Draw2DCollision │ │ ├── Points_scene.unity.meta │ │ ├── Editor.meta │ │ ├── Editor │ │ │ ├── Resources.meta │ │ │ ├── Resources │ │ │ │ ├── PointsSettings.asset.meta │ │ │ │ ├── 2DCollisionSkin.guiskin.meta │ │ │ │ └── PointsSettings.asset │ │ │ ├── PointsEditor.cs.meta │ │ │ └── PointsEditor.cs │ │ ├── Points.cs.meta │ │ ├── PointsSettings.cs.meta │ │ ├── PointsSettings.cs │ │ ├── Points.cs │ │ └── Points_scene.unity │ ├── Generic │ │ ├── Editor.meta │ │ ├── Tags.cs.meta │ │ ├── CoroutineLerp.cs.meta │ │ ├── Editor │ │ │ ├── ConvertToPowerFour.cs.meta │ │ │ ├── MultipleSprite.cs.meta │ │ │ ├── PlacingSprites.cs.meta │ │ │ ├── PlacingSprites.cs │ │ │ ├── ConvertToPowerFour.cs │ │ │ └── MultipleSprite.cs │ │ ├── CoroutineLerp.cs │ │ └── Tags.cs │ ├── SpriteEditor.meta │ ├── SpriteEditor │ │ ├── Editor.meta │ │ └── Editor │ │ │ ├── SpriteEditorWindow.cs.meta │ │ │ └── SpriteEditorWindow.cs │ ├── InputFireEvents.meta │ ├── InputFireEvents │ │ ├── _Scenes.meta │ │ ├── _Scenes │ │ │ ├── InputEvent_scene.unity.meta │ │ │ └── InputEvent_scene.unity │ │ ├── _Scripts.meta │ │ └── _Scripts │ │ │ ├── Editor.meta │ │ │ ├── InputFireEvents.cs.meta │ │ │ ├── Editor │ │ │ ├── InputFireEventEditor.cs.meta │ │ │ └── InputFireEventEditor.cs │ │ │ └── InputFireEvents.cs │ ├── BuildMesh │ │ ├── BuildMesh.cs.meta │ │ ├── Triangulator.cs.meta │ │ ├── PolyColliderToMesh.cs.meta │ │ ├── PolyColliderToMesh.cs │ │ ├── BuildMesh.cs │ │ └── Triangulator.cs │ ├── AnimationEvents │ │ ├── EventAtFrame.cs.meta │ │ ├── AnimationEventListener.cs.meta │ │ ├── AnimationEventListener.cs │ │ └── EventAtFrame.cs │ ├── DisableExitTime.cs │ └── HelloWorld.png.meta ├── ProjectSettings │ ├── ProjectVersion.txt │ ├── ClusterInputManager.asset │ ├── PresetManager.asset │ ├── EditorBuildSettings.asset │ ├── NetworkManager.asset │ ├── XRSettings.asset │ ├── TimeManager.asset │ ├── VFXManager.asset │ ├── AudioManager.asset │ ├── TagManager.asset │ ├── EditorSettings.asset │ ├── DynamicsManager.asset │ ├── UnityConnectSettings.asset │ ├── Physics2DSettings.asset │ ├── NavMeshAreas.asset │ ├── GraphicsSettings.asset │ ├── QualitySettings.asset │ ├── InputManager.asset │ └── ProjectSettings.asset ├── SpriteTool_0.01_2.21.21.unitypackage ├── Packages │ └── manifest.json └── Logs │ └── Packages-Update.log ├── README.md └── .gitignore /Tools/Assets/HelloWorld.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeff-harper-games/Tools/HEAD/Tools/Assets/HelloWorld.png -------------------------------------------------------------------------------- /Tools/ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 2019.1.0f2 2 | m_EditorVersionWithRevision: 2019.1.0f2 (292b93d75a2c) 3 | -------------------------------------------------------------------------------- /Tools/SpriteTool_0.01_2.21.21.unitypackage: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeff-harper-games/Tools/HEAD/Tools/SpriteTool_0.01_2.21.21.unitypackage -------------------------------------------------------------------------------- /Tools/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 | -------------------------------------------------------------------------------- /Tools/ProjectSettings/PresetManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1386491679 &1 4 | PresetManager: 5 | m_ObjectHideFlags: 0 6 | m_DefaultList: [] 7 | -------------------------------------------------------------------------------- /Tools/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 | -------------------------------------------------------------------------------- /Tools/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 | -------------------------------------------------------------------------------- /Tools/Assets/BuildMesh.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8071bf5b0b62de14fae307c8567c9872 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Tools/Assets/Generic.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a12e4b8f62ae63244815c6a45a0f8d3b 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Tools/Assets/Draw2DCollision.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 59f79f67e1c7e5d4cb9c6483085a9653 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Tools/Assets/Draw2DCollision/Points_scene.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a1f2c022b609ef3409ad924066bb2bda 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Tools/Assets/Generic/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f0fef6bb2db13664f9155c31739021ba 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Tools/Assets/SpriteEditor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b571d5fa9871fd74e86e1537fdf1af02 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Tools/Assets/SpriteEditor/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0bfea1b48caaa334fb49b194843de882 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Tools/ProjectSettings/XRSettings.asset: -------------------------------------------------------------------------------- 1 | { 2 | "m_SettingKeys": [ 3 | "VR Device Disabled", 4 | "VR Device User Alert" 5 | ], 6 | "m_SettingValues": [ 7 | "False", 8 | "False" 9 | ] 10 | } -------------------------------------------------------------------------------- /Tools/Assets/Draw2DCollision/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e5b017a44637a94458f9b9c23fb424d0 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Tools/Assets/Draw2DCollision/Editor/Resources.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4e4bddfaa87231d4d9a888c2e450528a 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Tools/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 | Maximum Particle Timestep: 0.03 10 | -------------------------------------------------------------------------------- /Tools/Assets/Draw2DCollision/Editor/Resources/PointsSettings.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1c969b98161ce6b4199568dfdf157937 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Tools/Assets/Draw2DCollision/Editor/Resources/2DCollisionSkin.guiskin.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 01ffa6dee22c8dd4ba9860e9e18f6a2e 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Tools/Assets/InputFireEvents.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 37a5467f9545108478335154fb10e3b5 3 | folderAsset: yes 4 | timeCreated: 1509554934 5 | licenseType: Pro 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Tools/Assets/InputFireEvents/_Scenes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 37cf4d5ab9a59564abbe9c9e8f15db9d 3 | folderAsset: yes 4 | timeCreated: 1508881180 5 | licenseType: Pro 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Tools/Assets/InputFireEvents/_Scenes/InputEvent_scene.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 54319594ee48d7d4c825497f5f208e24 3 | timeCreated: 1508881197 4 | licenseType: Pro 5 | DefaultImporter: 6 | externalObjects: {} 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Tools/Assets/InputFireEvents/_Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ac654e8aaac836145a7102e28c50c982 3 | folderAsset: yes 4 | timeCreated: 1508878959 5 | licenseType: Pro 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Tools/Assets/InputFireEvents/_Scripts/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0521c0bae4c67a44d93c05fe5edf2598 3 | folderAsset: yes 4 | timeCreated: 1508878988 5 | licenseType: Pro 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Tools/Assets/Generic/Tags.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b6ffacd07e5e5f641ac94a6a5aa36427 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Tools/Assets/BuildMesh/BuildMesh.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 44b59e63d4ea2d84f86dcd3889b860fb 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Tools/Assets/BuildMesh/Triangulator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7581d95d91bc9944fa587f01dbbe5e22 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Tools/Assets/Draw2DCollision/Points.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3be0273062dcbe04e8fb563b94a56cc1 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Tools/Assets/Generic/CoroutineLerp.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7509b19e89f34234e819a8ec1f253adb 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Tools/Assets/AnimationEvents/EventAtFrame.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cb4bcf8c727c6dc4caa5d585abf81feb 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Tools/Assets/BuildMesh/PolyColliderToMesh.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1df669adb125c1e48881739c18894679 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Tools/Assets/Draw2DCollision/PointsSettings.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8dc2d548c142f094093bb480f2fb166c 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Tools/Assets/Generic/Editor/ConvertToPowerFour.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2d7e6eff65fd21b48b98a5809e7d378b 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Tools/Assets/Generic/Editor/MultipleSprite.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 264df9dbcb543804ab516ad630ddc703 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Tools/Assets/Generic/Editor/PlacingSprites.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 49634bab43e96614e8e5a6040c128506 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Tools/Assets/AnimationEvents/AnimationEventListener.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c2f75f02202d2244c9b9dfe38dc4ae9e 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Tools/Assets/Draw2DCollision/Editor/PointsEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dab0de14de955c14aa9f95845c4ca3d7 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Tools/Assets/SpriteEditor/Editor/SpriteEditorWindow.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 55bb20fd1e837fd4ba456724c3bfd94e 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Tools/Assets/AnimationEvents/AnimationEventListener.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | public class AnimationEventListener : MonoBehaviour 4 | { 5 | public delegate void Reached(); 6 | public Reached OnReached; 7 | 8 | private void FrameReached() 9 | { 10 | if (OnReached != null) 11 | OnReached.Invoke(); 12 | } 13 | } -------------------------------------------------------------------------------- /Tools/ProjectSettings/VFXManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!937362698 &1 4 | VFXManager: 5 | m_ObjectHideFlags: 0 6 | m_IndirectShader: {fileID: 0} 7 | m_CopyBufferShader: {fileID: 0} 8 | m_SortShader: {fileID: 0} 9 | m_RenderPipeSettingsPath: 10 | m_FixedTimeStep: 0.016666668 11 | m_MaxDeltaTime: 0.05 12 | -------------------------------------------------------------------------------- /Tools/Assets/InputFireEvents/_Scripts/InputFireEvents.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0ef3084ed61ed6e47bc56e68a8f6bcc9 3 | timeCreated: 1508878959 4 | licenseType: Pro 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Tools/Assets/InputFireEvents/_Scripts/Editor/InputFireEventEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b1bcd8c7b8d97ae4ea7b449ff9a8beaf 3 | timeCreated: 1508878995 4 | licenseType: Pro 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Tools 2 | Different Unity3D tools that I use/create for my development 3 | 4 | Here I will post, helpful tools, as well as editor code, I have written and use in my everyday development. 5 | 6 | ***Note*** 7 | 8 | Everything in this project is WIP, please let me know if you have any suggestions on fixes or tools to add! 9 | 10 | Follow on Twitter 11 | [@jeffdevsitall](https://twitter.com/jeffdevsitall) 12 | -------------------------------------------------------------------------------- /Tools/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_AmbisonicDecoderPlugin: 16 | m_DisableAudio: 0 17 | m_VirtualizeEffects: 1 18 | -------------------------------------------------------------------------------- /Tools/Assets/Draw2DCollision/PointsSettings.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | public class PointsSettings : ScriptableObject 6 | { 7 | public Color handleColor = Color.cyan; 8 | public Color lineColor = Color.white; 9 | public Color unselectedColor = Color.black; 10 | public float handleSize = 0.1f; 11 | public Vector2 handleRange = new Vector2(0, 1); 12 | public bool autoBuild = true; 13 | public bool edit = true; 14 | public bool showControls = true; 15 | } 16 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | [Ll]ibrary/ 2 | [Tt]emp/ 3 | [Oo]bj/ 4 | [Bb]uild/ 5 | [Bb]uilds/ 6 | Assets/AssetStoreTools* 7 | 8 | # Visual Studio 2015 cache directory 9 | /.vs/ 10 | 11 | # Autogenerated VS/MD/Consulo solution and project files 12 | ExportedObj/ 13 | .consulo/ 14 | *.csproj 15 | *.unityproj 16 | *.sln 17 | *.suo 18 | *.tmp 19 | *.user 20 | *.userprefs 21 | *.pidb 22 | *.booproj 23 | *.svd 24 | *.pdb 25 | 26 | # Unity3D generated meta files 27 | *.pidb.meta 28 | 29 | # Unity3D Generated File On Crash Reports 30 | sysinfo.txt 31 | 32 | # Builds 33 | *.apk 34 | *.unitypackage 35 | -------------------------------------------------------------------------------- /Tools/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 | -------------------------------------------------------------------------------- /Tools/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: 5 7 | m_ExternalVersionControlSupport: Visible Meta Files 8 | m_SerializationMode: 2 9 | m_DefaultBehaviorMode: 0 10 | m_SpritePackerMode: 0 11 | m_SpritePackerPaddingPower: 1 12 | m_EtcTextureCompressorBehavior: 1 13 | m_EtcTextureFastCompressor: 1 14 | m_EtcTextureNormalCompressor: 2 15 | m_EtcTextureBestCompressor: 4 16 | m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd 17 | m_ProjectGenerationRootNamespace: 18 | m_UserGeneratedProjectSuffix: 19 | m_CollabEditorSettings: 20 | inProgressEnabled: 1 21 | -------------------------------------------------------------------------------- /Tools/Assets/Draw2DCollision/Editor/Resources/PointsSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: 8dc2d548c142f094093bb480f2fb166c, type: 3} 13 | m_Name: PointsSettings 14 | m_EditorClassIdentifier: 15 | handleColor: {r: 0, g: 1, b: 1, a: 1} 16 | lineColor: {r: 1, g: 1, b: 1, a: 1} 17 | unselectedColor: {r: 0, g: 0, b: 0, a: 1} 18 | selectedPointColor: {r: 1, g: 0, b: 1, a: 1} 19 | handleSize: 0.1 20 | handleRange: {x: 0, y: 1} 21 | autoBuild: 1 22 | edit: 1 23 | showControls: 1 24 | -------------------------------------------------------------------------------- /Tools/Assets/InputFireEvents/_Scripts/InputFireEvents.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Author: Jeff Harper @jeffdevsitall 3 | */ 4 | 5 | using System.Collections.Generic; 6 | using UnityEngine; 7 | using UnityEngine.Events; 8 | 9 | public class InputFireEvents : MonoBehaviour 10 | { 11 | public List inputEvents; 12 | public bool debug; 13 | 14 | void Update () 15 | { 16 | for (int i = 0; i < inputEvents.Count; i++) 17 | { 18 | if (Input.GetKeyDown(inputEvents[i].keyInput)) 19 | { 20 | inputEvents[i].keyEvent.Invoke(); 21 | } 22 | } 23 | } 24 | } 25 | 26 | [System.Serializable] 27 | public class InputEvents 28 | { 29 | public KeyCode keyInput; 30 | public UnityEvent keyEvent; 31 | public string Name; 32 | public bool display; 33 | } 34 | -------------------------------------------------------------------------------- /Tools/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: 3 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_DefaultSolverIterations: 6 13 | m_DefaultSolverVelocityIterations: 1 14 | m_QueriesHitBackfaces: 0 15 | m_QueriesHitTriggers: 1 16 | m_EnableAdaptiveForce: 0 17 | m_EnablePCM: 1 18 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 19 | m_AutoSimulation: 1 20 | m_AutoSyncTransforms: 1 21 | -------------------------------------------------------------------------------- /Tools/Assets/DisableExitTime.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditor; 3 | using UnityEditor.Animations; 4 | 5 | public class DisableExitTime : Editor 6 | { 7 | [MenuItem("Tools/Disable Exit Time on Animation Transition _F12")] 8 | public static void Disable() 9 | { 10 | Undo.RecordObjects(Selection.objects, "Disable Exit Time"); 11 | for (int i = 0; i < Selection.objects.Length; i++) 12 | { 13 | Object sel = Selection.objects[i]; 14 | 15 | if (sel.GetType() == typeof(AnimatorStateTransition)) 16 | { 17 | AnimatorStateTransition transition = (AnimatorStateTransition)sel; 18 | transition.hasExitTime = false; 19 | transition.exitTime = 1.0f; 20 | transition.hasFixedDuration = true; 21 | transition.duration = 0.0f; 22 | } 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Tools/Assets/BuildMesh/PolyColliderToMesh.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | #if UNITY_EDITOR 3 | using UnityEditor; 4 | #endif 5 | 6 | [RequireComponent(typeof(PolygonCollider2D))] 7 | public class PolyColliderToMesh : MonoBehaviour 8 | { 9 | [SerializeField] 10 | private bool buildAtStart = true; 11 | 12 | public void Start() 13 | { 14 | if(buildAtStart) 15 | BuildMesh.Build(gameObject, GetComponent()); 16 | } 17 | } 18 | 19 | #if UNITY_EDITOR 20 | [CustomEditor(typeof(PolyColliderToMesh))] 21 | public class PointsToMeshEditor : Editor 22 | { 23 | public override void OnInspectorGUI() 24 | { 25 | base.OnInspectorGUI(); 26 | 27 | PolyColliderToMesh go = target as PolyColliderToMesh; 28 | 29 | if (GUILayout.Button("Build Mesh")) 30 | { 31 | BuildMesh.Build(go.gameObject, go.GetComponent()); 32 | } 33 | } 34 | } 35 | #endif -------------------------------------------------------------------------------- /Tools/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 | m_TestInitMode: 0 11 | CrashReportingSettings: 12 | m_EventUrl: https://perf-events.cloud.unity3d.com/api/events/crashes 13 | m_NativeEventUrl: https://perf-events.cloud.unity3d.com/symbolicate 14 | m_Enabled: 0 15 | m_CaptureEditorExceptions: 1 16 | UnityPurchasingSettings: 17 | m_Enabled: 0 18 | m_TestMode: 0 19 | UnityAnalyticsSettings: 20 | m_Enabled: 0 21 | m_InitializeOnStartup: 1 22 | m_TestMode: 0 23 | m_TestEventUrl: 24 | m_TestConfigUrl: 25 | UnityAdsSettings: 26 | m_Enabled: 0 27 | m_InitializeOnStartup: 1 28 | m_TestMode: 0 29 | m_IosGameId: 30 | m_AndroidGameId: 31 | m_GameIds: {} 32 | m_GameId: 33 | PerformanceReportingSettings: 34 | m_Enabled: 0 35 | -------------------------------------------------------------------------------- /Tools/Assets/Generic/CoroutineLerp.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using UnityEngine; 3 | 4 | public class CoroutineLerp 5 | { 6 | private Coroutine coroutine; 7 | public delegate void MarkerDelegate(bool b); 8 | public MarkerDelegate marker; 9 | public float Progress; 10 | 11 | public void Begin(float duration, MonoBehaviour mono) 12 | { 13 | if(coroutine != null) 14 | mono.StopCoroutine(coroutine); 15 | coroutine = mono.StartCoroutine(Perform(duration)); 16 | } 17 | 18 | public void Stop(MonoBehaviour mono) 19 | { 20 | if (coroutine != null) 21 | mono.StopCoroutine(coroutine); 22 | } 23 | 24 | public IEnumerator Perform(float duration) 25 | { 26 | if (marker != null) 27 | marker.Invoke(true); 28 | 29 | Progress = 0.0f; 30 | 31 | for (float t = 0; t < 1; t += Time.deltaTime / duration) 32 | { 33 | Progress = Mathf.Lerp(0.0f, 1.0f, t); 34 | yield return null; 35 | } 36 | 37 | Progress = 1.0f; 38 | 39 | if (marker != null) 40 | marker.Invoke(false); 41 | } 42 | } -------------------------------------------------------------------------------- /Tools/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: 3 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_BaumgarteScale: 0.2 17 | m_BaumgarteTimeOfImpactScale: 0.75 18 | m_TimeToSleep: 0.5 19 | m_LinearSleepTolerance: 0.01 20 | m_AngularSleepTolerance: 2 21 | m_DefaultContactOffset: 0.01 22 | m_AutoSimulation: 1 23 | m_QueriesHitTriggers: 1 24 | m_QueriesStartInColliders: 1 25 | m_ChangeStopsCallbacks: 0 26 | m_CallbacksOnDisable: 1 27 | m_AutoSyncTransforms: 1 28 | m_AlwaysShowColliders: 0 29 | m_ShowColliderSleep: 1 30 | m_ShowColliderContacts: 0 31 | m_ShowColliderAABB: 0 32 | m_ContactArrowScale: 0.2 33 | m_ColliderAwakeColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.7529412} 34 | m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432} 35 | m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745} 36 | m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804} 37 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 38 | -------------------------------------------------------------------------------- /Tools/Assets/Generic/Editor/PlacingSprites.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditor; 3 | 4 | public class PlacingSprites : Editor 5 | { 6 | [MenuItem("Tools/Place Sprites")] 7 | public static void Place() 8 | { 9 | Object[] objs = Selection.objects; 10 | for (int i = 0; i < objs.Length; i++) 11 | { 12 | if (objs[i].GetType() == typeof(Texture2D)) 13 | { 14 | Texture2D tex = (Texture2D)objs[i]; 15 | string path = AssetDatabase.GetAssetPath(tex); 16 | Object[] sprites = AssetDatabase.LoadAllAssetsAtPath(path); 17 | TextureImporter importer = (TextureImporter)TextureImporter.GetAtPath(path); 18 | float pixels = importer.spritePixelsPerUnit; 19 | GameObject parent = new GameObject(tex.name); 20 | for (int j = 0; j < sprites.Length; j++) 21 | { 22 | if (sprites[j].GetType() == typeof(Sprite)) 23 | { 24 | Sprite sprite = (Sprite)sprites[j]; 25 | GameObject go = new GameObject(sprite.name); 26 | go.transform.parent = parent.transform; 27 | SpriteRenderer sr = go.AddComponent(); 28 | sr.sprite = sprite; 29 | Rect rect = sprite.rect; 30 | sr.transform.position = new Vector2((rect.x / pixels) - ((tex.width / 2) / pixels) + rect.width / pixels / 2, 31 | (rect.y / pixels) - ((tex.height / 2) / pixels) + rect.height / pixels / 2); 32 | } 33 | } 34 | } 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /Tools/ProjectSettings/NavMeshAreas.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!126 &1 4 | NavMeshProjectSettings: 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 | m_LastAgentTypeID: -887442657 73 | m_Settings: 74 | - serializedVersion: 2 75 | agentTypeID: 0 76 | agentRadius: 0.1 77 | agentHeight: 2 78 | agentSlope: 45 79 | agentClimb: 0.75 80 | ledgeDropHeight: 0 81 | maxJumpAcrossDistance: 0 82 | minRegionArea: 2 83 | manualCellSize: 0 84 | cellSize: 0.16666667 85 | manualTileSize: 0 86 | tileSize: 256 87 | accuratePlacement: 0 88 | debug: 89 | m_Flags: 0 90 | m_SettingNames: 91 | - Humanoid 92 | -------------------------------------------------------------------------------- /Tools/Assets/BuildMesh/BuildMesh.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using UnityEngine; 3 | 4 | public static class BuildMesh 5 | { 6 | public static void Build(GameObject container, PolygonCollider2D poly) 7 | { 8 | List meshes = new List(); 9 | 10 | for (int i = 0; i < poly.pathCount; i++) 11 | { 12 | Vector2[] verts = poly.GetPath(i); 13 | 14 | // http://wiki.unity3d.com/index.php/Triangulator 15 | Triangulator tr = new Triangulator(verts); 16 | int[] indices = tr.Triangulate(); 17 | 18 | Vector3[] vertices = new Vector3[verts.Length]; 19 | for (int j = 0; j < verts.Length; j++) 20 | { 21 | vertices[j] = new Vector3(verts[j].x, verts[j].y, 0); 22 | } 23 | 24 | Mesh mesh = new Mesh(); 25 | mesh.vertices = vertices; 26 | mesh.triangles = indices; 27 | mesh.RecalculateNormals(); 28 | mesh.RecalculateBounds(); 29 | meshes.Add(mesh); 30 | } 31 | 32 | CombineInstance[] combine = new CombineInstance[meshes.Count]; 33 | for (int i = 0; i < combine.Length; i++) 34 | { 35 | combine[i].mesh = meshes[i]; 36 | combine[i].transform = container.transform.localToWorldMatrix; 37 | } 38 | 39 | 40 | MeshRenderer mr = container.GetComponent(); 41 | if (!mr) 42 | mr = container.AddComponent(); 43 | 44 | MeshFilter mf = container.GetComponent(); 45 | if(!mf) 46 | mf = container.AddComponent(); 47 | 48 | mf.sharedMesh = new Mesh(); 49 | mf.sharedMesh.CombineMeshes(combine); 50 | } 51 | } -------------------------------------------------------------------------------- /Tools/Packages/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "com.unity.ads": "2.3.1", 4 | "com.unity.analytics": "3.3.2", 5 | "com.unity.collab-proxy": "1.2.16", 6 | "com.unity.multiplayer-hlapi": "1.0.2", 7 | "com.unity.package-manager-ui": "2.1.2", 8 | "com.unity.purchasing": "2.0.6", 9 | "com.unity.timeline": "1.0.0", 10 | "com.unity.xr.legacyinputhelpers": "2.0.2", 11 | "com.unity.modules.ai": "1.0.0", 12 | "com.unity.modules.animation": "1.0.0", 13 | "com.unity.modules.assetbundle": "1.0.0", 14 | "com.unity.modules.audio": "1.0.0", 15 | "com.unity.modules.cloth": "1.0.0", 16 | "com.unity.modules.director": "1.0.0", 17 | "com.unity.modules.imageconversion": "1.0.0", 18 | "com.unity.modules.imgui": "1.0.0", 19 | "com.unity.modules.jsonserialize": "1.0.0", 20 | "com.unity.modules.particlesystem": "1.0.0", 21 | "com.unity.modules.physics": "1.0.0", 22 | "com.unity.modules.physics2d": "1.0.0", 23 | "com.unity.modules.screencapture": "1.0.0", 24 | "com.unity.modules.terrain": "1.0.0", 25 | "com.unity.modules.terrainphysics": "1.0.0", 26 | "com.unity.modules.tilemap": "1.0.0", 27 | "com.unity.modules.ui": "1.0.0", 28 | "com.unity.modules.uielements": "1.0.0", 29 | "com.unity.modules.umbra": "1.0.0", 30 | "com.unity.modules.unityanalytics": "1.0.0", 31 | "com.unity.modules.unitywebrequest": "1.0.0", 32 | "com.unity.modules.unitywebrequestassetbundle": "1.0.0", 33 | "com.unity.modules.unitywebrequestaudio": "1.0.0", 34 | "com.unity.modules.unitywebrequesttexture": "1.0.0", 35 | "com.unity.modules.unitywebrequestwww": "1.0.0", 36 | "com.unity.modules.vehicles": "1.0.0", 37 | "com.unity.modules.video": "1.0.0", 38 | "com.unity.modules.vr": "1.0.0", 39 | "com.unity.modules.wind": "1.0.0", 40 | "com.unity.modules.xr": "1.0.0" 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Tools/Logs/Packages-Update.log: -------------------------------------------------------------------------------- 1 | 2 | === Tue Feb 12 19:18:18 2019 3 | 4 | Packages were changed. 5 | Update Mode: updateDependencies 6 | 7 | The following packages were added: 8 | com.unity.analytics@3.2.2 9 | com.unity.purchasing@2.0.3 10 | com.unity.ads@2.3.1 11 | com.unity.textmeshpro@1.3.0 12 | com.unity.package-manager-ui@2.0.3 13 | com.unity.collab-proxy@1.2.15 14 | com.unity.modules.ai@1.0.0 15 | com.unity.modules.animation@1.0.0 16 | com.unity.modules.assetbundle@1.0.0 17 | com.unity.modules.audio@1.0.0 18 | com.unity.modules.cloth@1.0.0 19 | com.unity.modules.director@1.0.0 20 | com.unity.modules.imageconversion@1.0.0 21 | com.unity.modules.imgui@1.0.0 22 | com.unity.modules.jsonserialize@1.0.0 23 | com.unity.modules.particlesystem@1.0.0 24 | com.unity.modules.physics@1.0.0 25 | com.unity.modules.physics2d@1.0.0 26 | com.unity.modules.screencapture@1.0.0 27 | com.unity.modules.terrain@1.0.0 28 | com.unity.modules.terrainphysics@1.0.0 29 | com.unity.modules.tilemap@1.0.0 30 | com.unity.modules.ui@1.0.0 31 | com.unity.modules.uielements@1.0.0 32 | com.unity.modules.umbra@1.0.0 33 | com.unity.modules.unityanalytics@1.0.0 34 | com.unity.modules.unitywebrequest@1.0.0 35 | com.unity.modules.unitywebrequestassetbundle@1.0.0 36 | com.unity.modules.unitywebrequestaudio@1.0.0 37 | com.unity.modules.unitywebrequesttexture@1.0.0 38 | com.unity.modules.unitywebrequestwww@1.0.0 39 | com.unity.modules.vehicles@1.0.0 40 | com.unity.modules.video@1.0.0 41 | com.unity.modules.vr@1.0.0 42 | com.unity.modules.wind@1.0.0 43 | com.unity.modules.xr@1.0.0 44 | 45 | === Sat Apr 20 16:48:37 2019 46 | 47 | Packages were changed. 48 | Update Mode: updateDependencies 49 | 50 | The following packages were added: 51 | com.unity.timeline@1.0.0 52 | com.unity.multiplayer-hlapi@1.0.2 53 | com.unity.xr.legacyinputhelpers@2.0.2 54 | The following packages were updated: 55 | com.unity.analytics from version 3.2.2 to 3.3.2 56 | com.unity.collab-proxy from version 1.2.15 to 1.2.16 57 | com.unity.package-manager-ui from version 2.0.3 to 2.1.2 58 | com.unity.purchasing from version 2.0.3 to 2.0.6 59 | com.unity.textmeshpro from version 1.3.0 to 2.0.0 60 | -------------------------------------------------------------------------------- /Tools/Assets/Generic/Editor/ConvertToPowerFour.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditor; 3 | 4 | public class ConvertToPowerFour : Editor 5 | { 6 | [MenuItem("Tools/Power of Four #&p")] 7 | public static void Convert() 8 | { 9 | Texture2D tex = Selection.activeObject as Texture2D; 10 | if (tex) 11 | { 12 | string texPath = AssetDatabase.GetAssetPath(tex); 13 | TextureImporter importer = (TextureImporter)AssetImporter.GetAtPath(texPath); 14 | importer.crunchedCompression = false; 15 | importer.textureCompression = TextureImporterCompression.Uncompressed; 16 | importer.isReadable = true; 17 | importer.SaveAndReimport(); 18 | 19 | int width = tex.width; 20 | int height = tex.height; 21 | 22 | while (width % 4 != 0) 23 | { 24 | width++; 25 | } 26 | 27 | while (height % 4 != 0) 28 | { 29 | height++; 30 | } 31 | 32 | Texture2D newTex = new Texture2D(width, height); 33 | 34 | for (int x = 0; x < width; x++) 35 | { 36 | for (int y = 0; y < height; y++) 37 | { 38 | newTex.SetPixel(x, y, new Color(0, 0, 0, 0)); 39 | } 40 | } 41 | 42 | for (int x = 0; x < tex.width; x++) 43 | { 44 | for (int y = 0; y < tex.height; y++) 45 | { 46 | Color col = tex.GetPixel(x, y); 47 | newTex.SetPixel(x, y, col); 48 | } 49 | } 50 | 51 | newTex.Apply(); 52 | 53 | string path = AssetDatabase.GetAssetPath(tex); 54 | string absolutePath = Application.dataPath + "/" + path.Replace("Assets/", ""); 55 | System.IO.File.WriteAllBytes(absolutePath, newTex.EncodeToPNG()); 56 | 57 | importer.crunchedCompression = true; 58 | importer.compressionQuality = 50; 59 | importer.textureCompression = TextureImporterCompression.Compressed; 60 | importer.isReadable = false; 61 | importer.SaveAndReimport(); 62 | 63 | AssetDatabase.Refresh(); 64 | } 65 | else 66 | { 67 | Debug.Log("Must have a image selected"); 68 | } 69 | } 70 | } -------------------------------------------------------------------------------- /Tools/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: 12 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: 10753, guid: 0000000000000000f000000000000000, type: 0} 37 | - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} 38 | m_PreloadedShaders: [] 39 | m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, 40 | type: 0} 41 | m_CustomRenderPipeline: {fileID: 11400000, guid: b09477dffbb26f14985c38080ce46490, 42 | type: 2} 43 | m_TransparencySortMode: 0 44 | m_TransparencySortAxis: {x: 0, y: 0, z: 1} 45 | m_DefaultRenderingPath: 1 46 | m_DefaultMobileRenderingPath: 1 47 | m_TierSettings: [] 48 | m_LightmapStripping: 0 49 | m_FogStripping: 0 50 | m_InstancingStripping: 0 51 | m_LightmapKeepPlain: 1 52 | m_LightmapKeepDirCombined: 1 53 | m_LightmapKeepDynamicPlain: 1 54 | m_LightmapKeepDynamicDirCombined: 1 55 | m_LightmapKeepShadowMask: 1 56 | m_LightmapKeepSubtractive: 1 57 | m_FogKeepLinear: 1 58 | m_FogKeepExp: 1 59 | m_FogKeepExp2: 1 60 | m_AlbedoSwatchInfos: [] 61 | m_LightsUseLinearIntensity: 1 62 | m_LightsUseColorTemperature: 1 63 | -------------------------------------------------------------------------------- /Tools/Assets/Generic/Editor/MultipleSprite.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using UnityEngine; 3 | using UnityEditor; 4 | using System.IO; 5 | using UnityEditorInternal; 6 | 7 | public class MultipleSprite : EditorWindow 8 | { 9 | [MenuItem("Tools/Generate Multiple")] 10 | public static void GenerateMultiple() 11 | { 12 | string path = EditorUtility.OpenFolderPanel("Sprite Folder", "", ""); 13 | string relativePath = "Assets" + path.Substring(Application.dataPath.Length); 14 | 15 | if (!AssetDatabase.IsValidFolder(relativePath)) 16 | return; 17 | 18 | string[] folders = new string[] { relativePath }; 19 | string[] textures = AssetDatabase.FindAssets("t:Texture2D", folders); 20 | 21 | for (int i = 0; i < textures.Length; i++) 22 | { 23 | TextureImporter importer = (TextureImporter)TextureImporter.GetAtPath(AssetDatabase.GUIDToAssetPath(textures[i])); 24 | Texture2D texture = (Texture2D)AssetDatabase.LoadAssetAtPath(AssetDatabase.GUIDToAssetPath(textures[i]), typeof(Texture2D)); 25 | importer.textureType = TextureImporterType.Sprite; 26 | importer.spriteImportMode = SpriteImportMode.Multiple; 27 | importer.isReadable = true; 28 | importer.maxTextureSize = 8192; 29 | importer.filterMode = FilterMode.Point; 30 | importer.textureCompression = TextureImporterCompression.Uncompressed; 31 | 32 | AssetDatabase.Refresh(); 33 | 34 | int minimumSpriteSize = 16; 35 | int extrudeSize = 0; 36 | Rect[] rects = InternalSpriteUtility.GenerateAutomaticSpriteRectangles(texture, minimumSpriteSize, extrudeSize); 37 | 38 | string p = AssetDatabase.GUIDToAssetPath(textures[i]); 39 | string relative = p.Replace("Assets/", ""); 40 | string absolutePath = Application.dataPath + "/" + p; 41 | 42 | string filenameNoExtension = Path.GetFileNameWithoutExtension(absolutePath); 43 | List metas = new List(); 44 | int rectNum = 0; 45 | 46 | foreach (Rect rect in rects) 47 | { 48 | SpriteMetaData meta = new SpriteMetaData(); 49 | meta.rect = rect; 50 | meta.name = filenameNoExtension + "_" + rectNum++; 51 | Debug.Log(meta.name); 52 | metas.Add(meta); 53 | } 54 | 55 | importer.spritesheet = metas.ToArray(); 56 | importer.SaveAndReimport(); 57 | AssetDatabase.Refresh(); 58 | } 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /Tools/Assets/Draw2DCollision/Points.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using UnityEngine; 3 | 4 | [RequireComponent(typeof(PolygonCollider2D))] 5 | [AddComponentMenu("Tools/Points")] 6 | public class Points : MonoBehaviour 7 | { 8 | public PolygonCollider2D polyCol; 9 | public Color handleColor = Color.cyan; 10 | public Color lineColor = Color.white; 11 | public Color unselectedColor = Color.white; 12 | public float handleSize = 0.1f; 13 | public bool edit = true; 14 | public bool autoBuild = true; 15 | public bool showControls = true; 16 | public bool useGlobal = false; 17 | public PointsSettings settings; 18 | public List paths = new List(); 19 | 20 | [System.Serializable] 21 | public class Paths 22 | { 23 | public List points = new List(); 24 | } 25 | 26 | public void AddPath() 27 | { 28 | if (!polyCol) 29 | polyCol = GetComponent(); 30 | 31 | paths.Add(new Paths()); 32 | } 33 | 34 | public void RemovePath(int index) 35 | { 36 | if (!polyCol) 37 | polyCol = GetComponent(); 38 | 39 | paths.RemoveAt(index); 40 | } 41 | 42 | public void AddPoint(Vector3 pos, int path = 0) 43 | { 44 | if (!polyCol) 45 | polyCol = GetComponent(); 46 | 47 | if (path > paths.Count - 1) 48 | paths.Add(new Paths()); 49 | 50 | pos = new Vector3(pos.x, pos.y, polyCol.transform.position.z); 51 | paths[path].points.Add(pos); 52 | } 53 | 54 | public void InsertPoint(Vector3 pos, int index, int path = 0) 55 | { 56 | if (!polyCol) 57 | polyCol = GetComponent(); 58 | 59 | pos = new Vector3(pos.x, pos.y, polyCol.transform.position.z); 60 | paths[path].points.Insert(index, pos); 61 | } 62 | 63 | public void BuildCollider() 64 | { 65 | if (!polyCol) 66 | polyCol = GetComponent(); 67 | 68 | polyCol.pathCount = paths.Count; 69 | 70 | for (int i = 0; i < paths.Count; i++) 71 | { 72 | Vector2[] verts = new Vector2[paths[i].points.Count]; 73 | for (int j = 0; j < paths[i].points.Count; j++) 74 | { 75 | //Vector2 pos = new Vector2(paths[i].points[j].x - polyCol.transform.position.x, paths[i].points[j].y - polyCol.transform.position.y); 76 | verts[j] = paths[i].points[j] - polyCol.transform.position; 77 | } 78 | polyCol.SetPath(i, verts); 79 | } 80 | } 81 | } -------------------------------------------------------------------------------- /Tools/Assets/HelloWorld.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 547480f0ca5a2654d999446e71c61d68 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | externalObjects: {} 6 | serializedVersion: 9 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 0 10 | sRGBTexture: 1 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | streamingMipmaps: 0 25 | streamingMipmapsPriority: 0 26 | grayScaleToAlpha: 0 27 | generateCubemap: 6 28 | cubemapConvolution: 0 29 | seamlessCubemap: 0 30 | textureFormat: 1 31 | maxTextureSize: 2048 32 | textureSettings: 33 | serializedVersion: 2 34 | filterMode: -1 35 | aniso: -1 36 | mipBias: -100 37 | wrapU: 1 38 | wrapV: 1 39 | wrapW: -1 40 | nPOTScale: 0 41 | lightmap: 0 42 | compressionQuality: 50 43 | spriteMode: 1 44 | spriteExtrude: 1 45 | spriteMeshType: 1 46 | alignment: 0 47 | spritePivot: {x: 0.5, y: 0.5} 48 | spritePixelsToUnits: 100 49 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 50 | spriteGenerateFallbackPhysicsShape: 1 51 | alphaUsage: 1 52 | alphaIsTransparency: 1 53 | spriteTessellationDetail: -1 54 | textureType: 8 55 | textureShape: 1 56 | singleChannelComponent: 0 57 | maxTextureSizeSet: 0 58 | compressionQualitySet: 0 59 | textureFormatSet: 0 60 | platformSettings: 61 | - serializedVersion: 2 62 | buildTarget: DefaultTexturePlatform 63 | maxTextureSize: 2048 64 | resizeAlgorithm: 0 65 | textureFormat: -1 66 | textureCompression: 1 67 | compressionQuality: 50 68 | crunchedCompression: 1 69 | allowsAlphaSplitting: 0 70 | overridden: 0 71 | androidETC2FallbackOverride: 0 72 | - serializedVersion: 2 73 | buildTarget: Standalone 74 | maxTextureSize: 2048 75 | resizeAlgorithm: 0 76 | textureFormat: -1 77 | textureCompression: 1 78 | compressionQuality: 50 79 | crunchedCompression: 1 80 | allowsAlphaSplitting: 0 81 | overridden: 0 82 | androidETC2FallbackOverride: 0 83 | - serializedVersion: 2 84 | buildTarget: Android 85 | maxTextureSize: 2048 86 | resizeAlgorithm: 0 87 | textureFormat: -1 88 | textureCompression: 1 89 | compressionQuality: 50 90 | crunchedCompression: 1 91 | allowsAlphaSplitting: 0 92 | overridden: 0 93 | androidETC2FallbackOverride: 0 94 | spriteSheet: 95 | serializedVersion: 2 96 | sprites: [] 97 | outline: [] 98 | physicsShape: [] 99 | bones: [] 100 | spriteID: 0cc1c593f8b4bdf4eb356292b17ec0e4 101 | vertices: [] 102 | indices: 103 | edges: [] 104 | weights: [] 105 | spritePackingTag: 106 | pSDRemoveMatte: 0 107 | pSDShowRemoveMatteOption: 0 108 | userData: 109 | assetBundleName: 110 | assetBundleVariant: 111 | -------------------------------------------------------------------------------- /Tools/Assets/InputFireEvents/_Scripts/Editor/InputFireEventEditor.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Author: Jeff Harper @jeffdevsitall 3 | */ 4 | 5 | using UnityEngine; 6 | using UnityEditor; 7 | using UnityEditorInternal; 8 | 9 | [CustomEditor(typeof(InputFireEvents))] 10 | public class InputFireEventEditor : Editor 11 | { 12 | private ReorderableList list; 13 | private string inputEvents = "inputEvents"; 14 | private string Name = "Name"; 15 | private string keyInput = "keyInput"; 16 | private string display = "display"; 17 | private string keyEvent = "keyEvent"; 18 | 19 | private void OnEnable() 20 | { 21 | list = new ReorderableList(serializedObject, serializedObject.FindProperty(inputEvents), true, true, true, true); 22 | float lineHeight = EditorGUIUtility.singleLineHeight + 5; 23 | 24 | list.drawElementCallback = (Rect rect, int index, bool isActive, bool isFocused) => 25 | { 26 | var element = list.serializedProperty.GetArrayElementAtIndex(index); 27 | GUIStyle myStyle = new GUIStyle(); 28 | element.FindPropertyRelative(Name).stringValue = element.FindPropertyRelative(keyInput).enumNames[element.FindPropertyRelative(keyInput).enumValueIndex]; 29 | Vector2 sizeOfLabel = myStyle.CalcSize(new GUIContent(element.FindPropertyRelative(Name).stringValue + " ")); 30 | 31 | element.FindPropertyRelative(display).boolValue = EditorGUI.Foldout(new Rect(rect.x + 10, rect.y + 2, sizeOfLabel.x + 30, lineHeight), 32 | element.FindPropertyRelative(display).boolValue, element.FindPropertyRelative(Name).stringValue); 33 | 34 | if (element.FindPropertyRelative(display).boolValue) 35 | { 36 | EditorGUI.LabelField(new Rect(rect.x + 10, rect.y + lineHeight, 60, lineHeight), "KeyCode: "); 37 | EditorGUI.PropertyField(new Rect(rect.x + 75, rect.y + lineHeight, 120, lineHeight), element.FindPropertyRelative(keyInput), GUIContent.none, true); 38 | EditorGUI.LabelField(new Rect(rect.x + 10, rect.y + lineHeight, 60, lineHeight), "KeyCode: "); 39 | EditorGUI.PropertyField(new Rect(rect.x + 10, rect.y + (lineHeight * 2), rect.width - 30, lineHeight), element.FindPropertyRelative(keyEvent), GUIContent.none, true); 40 | } 41 | }; 42 | 43 | list.drawHeaderCallback = (Rect rect) => 44 | { 45 | EditorGUI.LabelField(rect, "Inputs"); 46 | }; 47 | 48 | list.elementHeightCallback = (int index) => 49 | { 50 | 51 | float height = lineHeight; 52 | SerializedProperty element = list.serializedProperty.GetArrayElementAtIndex(index); 53 | 54 | if (element.FindPropertyRelative(display).boolValue) 55 | { 56 | height += EditorGUI.GetPropertyHeight(element.FindPropertyRelative(keyEvent)) + 40; 57 | } 58 | 59 | return height; 60 | }; 61 | } 62 | 63 | public override void OnInspectorGUI() 64 | { 65 | serializedObject.Update(); 66 | list.DoLayoutList(); 67 | serializedObject.ApplyModifiedProperties(); 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /Tools/Assets/BuildMesh/Triangulator.cs: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | http://wiki.unity3d.com/index.php/Triangulator 4 | 5 | */ 6 | 7 | using UnityEngine; 8 | using System.Collections.Generic; 9 | 10 | public class Triangulator 11 | { 12 | private List m_points = new List(); 13 | 14 | public Triangulator(Vector2[] points) 15 | { 16 | m_points = new List(points); 17 | } 18 | 19 | public int[] Triangulate() 20 | { 21 | List indices = new List(); 22 | 23 | int n = m_points.Count; 24 | if (n < 3) 25 | return indices.ToArray(); 26 | 27 | int[] V = new int[n]; 28 | if (Area() > 0) 29 | { 30 | for (int v = 0; v < n; v++) 31 | V[v] = v; 32 | } 33 | else 34 | { 35 | for (int v = 0; v < n; v++) 36 | V[v] = (n - 1) - v; 37 | } 38 | 39 | int nv = n; 40 | int count = 2 * nv; 41 | for (int v = nv - 1; nv > 2;) 42 | { 43 | if ((count--) <= 0) 44 | return indices.ToArray(); 45 | 46 | int u = v; 47 | if (nv <= u) 48 | u = 0; 49 | v = u + 1; 50 | if (nv <= v) 51 | v = 0; 52 | int w = v + 1; 53 | if (nv <= w) 54 | w = 0; 55 | 56 | if (Snip(u, v, w, nv, V)) 57 | { 58 | int a, b, c, s, t; 59 | a = V[u]; 60 | b = V[v]; 61 | c = V[w]; 62 | indices.Add(a); 63 | indices.Add(b); 64 | indices.Add(c); 65 | for (s = v, t = v + 1; t < nv; s++, t++) 66 | V[s] = V[t]; 67 | nv--; 68 | count = 2 * nv; 69 | } 70 | } 71 | 72 | indices.Reverse(); 73 | return indices.ToArray(); 74 | } 75 | 76 | private float Area() 77 | { 78 | int n = m_points.Count; 79 | float A = 0.0f; 80 | for (int p = n - 1, q = 0; q < n; p = q++) 81 | { 82 | Vector2 pval = m_points[p]; 83 | Vector2 qval = m_points[q]; 84 | A += pval.x * qval.y - qval.x * pval.y; 85 | } 86 | return (A * 0.5f); 87 | } 88 | 89 | private bool Snip(int u, int v, int w, int n, int[] V) 90 | { 91 | int p; 92 | Vector2 A = m_points[V[u]]; 93 | Vector2 B = m_points[V[v]]; 94 | Vector2 C = m_points[V[w]]; 95 | if (Mathf.Epsilon > (((B.x - A.x) * (C.y - A.y)) - ((B.y - A.y) * (C.x - A.x)))) 96 | return false; 97 | for (p = 0; p < n; p++) 98 | { 99 | if ((p == u) || (p == v) || (p == w)) 100 | continue; 101 | Vector2 P = m_points[V[p]]; 102 | if (InsideTriangle(A, B, C, P)) 103 | return false; 104 | } 105 | return true; 106 | } 107 | 108 | private bool InsideTriangle(Vector2 A, Vector2 B, Vector2 C, Vector2 P) 109 | { 110 | float ax, ay, bx, by, cx, cy, apx, apy, bpx, bpy, cpx, cpy; 111 | float cCROSSap, bCROSScp, aCROSSbp; 112 | 113 | ax = C.x - B.x; ay = C.y - B.y; 114 | bx = A.x - C.x; by = A.y - C.y; 115 | cx = B.x - A.x; cy = B.y - A.y; 116 | apx = P.x - A.x; apy = P.y - A.y; 117 | bpx = P.x - B.x; bpy = P.y - B.y; 118 | cpx = P.x - C.x; cpy = P.y - C.y; 119 | 120 | aCROSSbp = ax * bpy - ay * bpx; 121 | cCROSSap = cx * apy - cy * apx; 122 | bCROSScp = bx * cpy - by * cpx; 123 | 124 | return ((aCROSSbp >= 0.0f) && (bCROSScp >= 0.0f) && (cCROSSap >= 0.0f)); 125 | } 126 | } -------------------------------------------------------------------------------- /Tools/Assets/AnimationEvents/EventAtFrame.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using UnityEngine; 3 | using UnityEngine.Events; 4 | #if UNITY_EDITOR 5 | using UnityEditor; 6 | #endif 7 | 8 | public class EventAtFrame : MonoBehaviour 9 | { 10 | public AnimationClip clip; 11 | public Animator anim; 12 | public int frame; 13 | public bool removeAfterReached; 14 | public UnityEvent frameReachedEvent; 15 | 16 | private AnimationEventListener frameEvent; 17 | private AnimationEvent evt; 18 | 19 | private void Start() 20 | { 21 | Setup(); 22 | } 23 | 24 | public void Setup() 25 | { 26 | if (!anim) 27 | { 28 | Debug.Log("No animator found.", this); 29 | return; 30 | } 31 | 32 | frameEvent = anim.GetComponent(); 33 | if(!frameEvent) 34 | frameEvent = anim.gameObject.AddComponent(); 35 | 36 | evt = new AnimationEvent(); 37 | evt.time = frame / clip.frameRate; 38 | evt.functionName = "FrameReached"; 39 | clip.AddEvent(evt); 40 | 41 | frameEvent.OnReached += FrameReached; 42 | } 43 | 44 | private void FrameReached() 45 | { 46 | frameReachedEvent.Invoke(); 47 | 48 | if (removeAfterReached) 49 | { 50 | List events = new List(clip.events); 51 | for (int i = 0; i < events.Count; i++) 52 | { 53 | if (events[i].time == evt.time && events[i].functionName == evt.functionName) 54 | { 55 | events.RemoveAt(i); 56 | break; 57 | } 58 | } 59 | clip.events = events.ToArray(); 60 | Destroy(frameEvent); 61 | } 62 | } 63 | } 64 | 65 | #if UNITY_EDITOR 66 | [CustomEditor(typeof(EventAtFrame))] 67 | public class EventAtFrameEditor : Editor 68 | { 69 | public override void OnInspectorGUI() 70 | { 71 | EventAtFrame eaf = (EventAtFrame)target; 72 | 73 | serializedObject.Update(); 74 | 75 | EditorGUILayout.PropertyField(serializedObject.FindProperty("anim"), true); 76 | 77 | if (eaf.anim) 78 | { 79 | GetClip(); 80 | 81 | if (eaf.clip) 82 | { 83 | int maxFrame = Mathf.RoundToInt(eaf.clip.frameRate * eaf.clip.length); 84 | eaf.frame = EditorGUILayout.IntSlider("Frame", eaf.frame, 0, maxFrame); 85 | } 86 | 87 | EditorGUILayout.PropertyField(serializedObject.FindProperty("removeAfterReached"), true); 88 | EditorGUILayout.PropertyField(serializedObject.FindProperty("frameReachedEvent"), true); 89 | } 90 | else 91 | EditorGUILayout.HelpBox("You must have an Animator referenced.", MessageType.Error); 92 | 93 | serializedObject.ApplyModifiedProperties(); 94 | } 95 | 96 | private void GetClip() 97 | { 98 | EventAtFrame eaf = (EventAtFrame)target; 99 | 100 | if (!eaf.anim) 101 | return; 102 | 103 | AnimationClip[] clips = eaf.anim.runtimeAnimatorController.animationClips; 104 | 105 | if (clips.Length <= 0) 106 | return; 107 | 108 | int index = 0; 109 | for (int i = 0; i < clips.Length; i++) 110 | { 111 | if (clips[i] == eaf.clip) 112 | index = i; 113 | } 114 | 115 | string[] clipNames = new string[clips.Length]; 116 | for (int i = 0; i < clips.Length; i++) 117 | { 118 | clipNames[i] = clips[i].name; 119 | } 120 | 121 | index = EditorGUILayout.Popup("Clip", index, clipNames); 122 | 123 | eaf.clip = clips[index]; 124 | } 125 | } 126 | #endif -------------------------------------------------------------------------------- /Tools/Assets/Generic/Tags.cs: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Author: Jeff Harper 4 | Twitter: @jeffdevsitall 5 | Website: jeffharper.games 6 | 7 | Copyright (c) 2019 by Jeff Harper 8 | 9 | Permission is hereby granted, free of charge, to any person obtaining a copy 10 | of this software and associated documentation files (the "Software"), to deal 11 | in the Software without restriction, including without limitation the rights 12 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | copies of the Software, and to permit persons to whom the Software is 14 | furnished to do so, subject to the following conditions: 15 | 16 | The above copyright notice and this permission notice shall be included in all 17 | copies or substantial portions of the Software. 18 | 19 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 25 | SOFTWARE. 26 | 27 | */ 28 | 29 | using System.Collections; 30 | using System.Collections.Generic; 31 | using UnityEngine; 32 | #if UNITY_EDITOR 33 | using UnityEditor; 34 | #endif 35 | 36 | [System.Serializable] 37 | public class TagList 38 | { 39 | public string[] Tags; 40 | } 41 | 42 | #if UNITY_EDITOR 43 | [CustomPropertyDrawer(typeof(TagList))] 44 | public class TagsDrawer : PropertyDrawer 45 | { 46 | public TagList tags; 47 | public Object _object; 48 | private List tempTags = new List(); 49 | private SerializedProperty tagsProp; 50 | 51 | public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) 52 | { 53 | _object = property.serializedObject.targetObject; 54 | 55 | EditorGUI.BeginProperty(position, label, property); 56 | 57 | tempTags = new List(); 58 | 59 | position = EditorGUI.PrefixLabel(position, GUIUtility.GetControlID(FocusType.Passive), label); 60 | 61 | tagsProp = property.FindPropertyRelative("Tags"); 62 | 63 | if (tagsProp.isArray) 64 | { 65 | for (int i = 0; i < tagsProp.arraySize; i++) 66 | { 67 | tempTags.Add(tagsProp.GetArrayElementAtIndex(i).stringValue); 68 | } 69 | } 70 | 71 | int tagCount = UnityEditorInternal.InternalEditorUtility.tags.Length; 72 | string str = tempTags.Count > 1 && tempTags.Count != tagCount ? "Mixed..." : tempTags.Count == 1 73 | ? tempTags[0] : tempTags.Count == tagCount ? "Everything" : "Nothing"; 74 | 75 | GUIStyle style = new GUIStyle("button"); 76 | style.alignment = TextAnchor.MiddleLeft; 77 | 78 | if (GUI.Button(position, str, style)) 79 | { 80 | GenericMenu menu = new GenericMenu(); 81 | 82 | for (int i = 0; i < UnityEditorInternal.InternalEditorUtility.tags.Length; i++) 83 | { 84 | string tag = UnityEditorInternal.InternalEditorUtility.tags[i]; 85 | bool on = false; 86 | if (tempTags.Contains(tag)) 87 | on = true; 88 | AddMenuItem(menu, on, tag, tag); 89 | } 90 | menu.ShowAsContext(); 91 | } 92 | 93 | EditorGUI.EndProperty(); 94 | } 95 | 96 | void AddMenuItem(GenericMenu menu, bool on, string menuPath, string tag) 97 | { 98 | menu.AddItem(new GUIContent(menuPath), on, OnSelect, tag); 99 | } 100 | 101 | void OnSelect(object tag) 102 | { 103 | string str = (string)tag; 104 | 105 | if (tempTags.Contains(str)) 106 | tempTags.Remove(str); 107 | else 108 | tempTags.Add(str); 109 | 110 | tagsProp.ClearArray(); 111 | for (int i = 0; i < tempTags.Count; i++) 112 | { 113 | tagsProp.InsertArrayElementAtIndex(i); 114 | SerializedProperty index = tagsProp.GetArrayElementAtIndex(i); 115 | index.stringValue = tempTags[i]; 116 | } 117 | 118 | tagsProp.serializedObject.ApplyModifiedProperties(); 119 | 120 | EditorUtility.SetDirty(_object); 121 | } 122 | } 123 | #endif 124 | -------------------------------------------------------------------------------- /Tools/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: Very Low 11 | pixelLightCount: 0 12 | shadows: 0 13 | shadowResolution: 0 14 | shadowProjection: 1 15 | shadowCascades: 1 16 | shadowDistance: 15 17 | shadowNearPlaneOffset: 3 18 | shadowCascade2Split: 0.33333334 19 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 20 | shadowmaskMode: 0 21 | blendWeights: 1 22 | textureQuality: 1 23 | anisotropicTextures: 0 24 | antiAliasing: 0 25 | softParticles: 0 26 | softVegetation: 0 27 | realtimeReflectionProbes: 0 28 | billboardsFaceCameraPosition: 0 29 | vSyncCount: 0 30 | lodBias: 0.3 31 | maximumLODLevel: 0 32 | streamingMipmapsActive: 0 33 | streamingMipmapsAddAllCameras: 1 34 | streamingMipmapsMemoryBudget: 512 35 | streamingMipmapsRenderersPerFrame: 512 36 | streamingMipmapsMaxLevelReduction: 2 37 | streamingMipmapsMaxFileIORequests: 1024 38 | particleRaycastBudget: 4 39 | asyncUploadTimeSlice: 2 40 | asyncUploadBufferSize: 4 41 | asyncUploadPersistentBuffer: 1 42 | resolutionScalingFixedDPIFactor: 1 43 | excludedTargetPlatforms: [] 44 | - serializedVersion: 2 45 | name: Low 46 | pixelLightCount: 0 47 | shadows: 0 48 | shadowResolution: 0 49 | shadowProjection: 1 50 | shadowCascades: 1 51 | shadowDistance: 20 52 | shadowNearPlaneOffset: 3 53 | shadowCascade2Split: 0.33333334 54 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 55 | shadowmaskMode: 0 56 | blendWeights: 2 57 | textureQuality: 0 58 | anisotropicTextures: 0 59 | antiAliasing: 0 60 | softParticles: 0 61 | softVegetation: 0 62 | realtimeReflectionProbes: 0 63 | billboardsFaceCameraPosition: 0 64 | vSyncCount: 0 65 | lodBias: 0.4 66 | maximumLODLevel: 0 67 | streamingMipmapsActive: 0 68 | streamingMipmapsAddAllCameras: 1 69 | streamingMipmapsMemoryBudget: 512 70 | streamingMipmapsRenderersPerFrame: 512 71 | streamingMipmapsMaxLevelReduction: 2 72 | streamingMipmapsMaxFileIORequests: 1024 73 | particleRaycastBudget: 16 74 | asyncUploadTimeSlice: 2 75 | asyncUploadBufferSize: 4 76 | asyncUploadPersistentBuffer: 1 77 | resolutionScalingFixedDPIFactor: 1 78 | excludedTargetPlatforms: [] 79 | - serializedVersion: 2 80 | name: Medium 81 | pixelLightCount: 1 82 | shadows: 1 83 | shadowResolution: 0 84 | shadowProjection: 1 85 | shadowCascades: 1 86 | shadowDistance: 20 87 | shadowNearPlaneOffset: 3 88 | shadowCascade2Split: 0.33333334 89 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 90 | shadowmaskMode: 0 91 | blendWeights: 2 92 | textureQuality: 0 93 | anisotropicTextures: 1 94 | antiAliasing: 0 95 | softParticles: 0 96 | softVegetation: 0 97 | realtimeReflectionProbes: 0 98 | billboardsFaceCameraPosition: 0 99 | vSyncCount: 1 100 | lodBias: 0.7 101 | maximumLODLevel: 0 102 | streamingMipmapsActive: 0 103 | streamingMipmapsAddAllCameras: 1 104 | streamingMipmapsMemoryBudget: 512 105 | streamingMipmapsRenderersPerFrame: 512 106 | streamingMipmapsMaxLevelReduction: 2 107 | streamingMipmapsMaxFileIORequests: 1024 108 | particleRaycastBudget: 64 109 | asyncUploadTimeSlice: 2 110 | asyncUploadBufferSize: 4 111 | asyncUploadPersistentBuffer: 1 112 | resolutionScalingFixedDPIFactor: 1 113 | excludedTargetPlatforms: [] 114 | - serializedVersion: 2 115 | name: High 116 | pixelLightCount: 2 117 | shadows: 2 118 | shadowResolution: 1 119 | shadowProjection: 1 120 | shadowCascades: 2 121 | shadowDistance: 40 122 | shadowNearPlaneOffset: 3 123 | shadowCascade2Split: 0.33333334 124 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 125 | shadowmaskMode: 1 126 | blendWeights: 2 127 | textureQuality: 0 128 | anisotropicTextures: 1 129 | antiAliasing: 0 130 | softParticles: 0 131 | softVegetation: 1 132 | realtimeReflectionProbes: 1 133 | billboardsFaceCameraPosition: 1 134 | vSyncCount: 1 135 | lodBias: 1 136 | maximumLODLevel: 0 137 | streamingMipmapsActive: 0 138 | streamingMipmapsAddAllCameras: 1 139 | streamingMipmapsMemoryBudget: 512 140 | streamingMipmapsRenderersPerFrame: 512 141 | streamingMipmapsMaxLevelReduction: 2 142 | streamingMipmapsMaxFileIORequests: 1024 143 | particleRaycastBudget: 256 144 | asyncUploadTimeSlice: 2 145 | asyncUploadBufferSize: 4 146 | asyncUploadPersistentBuffer: 1 147 | resolutionScalingFixedDPIFactor: 1 148 | excludedTargetPlatforms: [] 149 | - serializedVersion: 2 150 | name: Very High 151 | pixelLightCount: 3 152 | shadows: 2 153 | shadowResolution: 2 154 | shadowProjection: 1 155 | shadowCascades: 2 156 | shadowDistance: 70 157 | shadowNearPlaneOffset: 3 158 | shadowCascade2Split: 0.33333334 159 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 160 | shadowmaskMode: 1 161 | blendWeights: 4 162 | textureQuality: 0 163 | anisotropicTextures: 2 164 | antiAliasing: 2 165 | softParticles: 1 166 | softVegetation: 1 167 | realtimeReflectionProbes: 1 168 | billboardsFaceCameraPosition: 1 169 | vSyncCount: 1 170 | lodBias: 1.5 171 | maximumLODLevel: 0 172 | streamingMipmapsActive: 0 173 | streamingMipmapsAddAllCameras: 1 174 | streamingMipmapsMemoryBudget: 512 175 | streamingMipmapsRenderersPerFrame: 512 176 | streamingMipmapsMaxLevelReduction: 2 177 | streamingMipmapsMaxFileIORequests: 1024 178 | particleRaycastBudget: 1024 179 | asyncUploadTimeSlice: 2 180 | asyncUploadBufferSize: 4 181 | asyncUploadPersistentBuffer: 1 182 | resolutionScalingFixedDPIFactor: 1 183 | excludedTargetPlatforms: [] 184 | - serializedVersion: 2 185 | name: Ultra 186 | pixelLightCount: 4 187 | shadows: 2 188 | shadowResolution: 2 189 | shadowProjection: 1 190 | shadowCascades: 4 191 | shadowDistance: 150 192 | shadowNearPlaneOffset: 3 193 | shadowCascade2Split: 0.33333334 194 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 195 | shadowmaskMode: 1 196 | blendWeights: 4 197 | textureQuality: 0 198 | anisotropicTextures: 2 199 | antiAliasing: 2 200 | softParticles: 1 201 | softVegetation: 1 202 | realtimeReflectionProbes: 1 203 | billboardsFaceCameraPosition: 1 204 | vSyncCount: 1 205 | lodBias: 2 206 | maximumLODLevel: 0 207 | streamingMipmapsActive: 0 208 | streamingMipmapsAddAllCameras: 1 209 | streamingMipmapsMemoryBudget: 512 210 | streamingMipmapsRenderersPerFrame: 512 211 | streamingMipmapsMaxLevelReduction: 2 212 | streamingMipmapsMaxFileIORequests: 1024 213 | particleRaycastBudget: 4096 214 | asyncUploadTimeSlice: 2 215 | asyncUploadBufferSize: 4 216 | asyncUploadPersistentBuffer: 1 217 | resolutionScalingFixedDPIFactor: 1 218 | excludedTargetPlatforms: [] 219 | m_PerPlatformDefaultQuality: 220 | Android: 2 221 | Nintendo 3DS: 5 222 | Nintendo Switch: 5 223 | PS4: 5 224 | PSM: 5 225 | PSP2: 2 226 | Samsung TV: 2 227 | Standalone: 5 228 | Tizen: 2 229 | WebGL: 3 230 | WiiU: 5 231 | Windows Store Apps: 5 232 | XboxOne: 5 233 | iPhone: 2 234 | tvOS: 2 235 | -------------------------------------------------------------------------------- /Tools/Assets/Draw2DCollision/Points_scene.unity: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!29 &1 4 | OcclusionCullingSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_OcclusionBakeSettings: 8 | smallestOccluder: 5 9 | smallestHole: 0.25 10 | backfaceThreshold: 100 11 | m_SceneGUID: 00000000000000000000000000000000 12 | m_OcclusionCullingData: {fileID: 0} 13 | --- !u!104 &2 14 | RenderSettings: 15 | m_ObjectHideFlags: 0 16 | serializedVersion: 9 17 | m_Fog: 0 18 | m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} 19 | m_FogMode: 3 20 | m_FogDensity: 0.01 21 | m_LinearFogStart: 0 22 | m_LinearFogEnd: 300 23 | m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} 24 | m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} 25 | m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} 26 | m_AmbientIntensity: 1 27 | m_AmbientMode: 0 28 | m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} 29 | m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} 30 | m_HaloStrength: 0.5 31 | m_FlareStrength: 1 32 | m_FlareFadeSpeed: 3 33 | m_HaloTexture: {fileID: 0} 34 | m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} 35 | m_DefaultReflectionMode: 0 36 | m_DefaultReflectionResolution: 128 37 | m_ReflectionBounces: 1 38 | m_ReflectionIntensity: 1 39 | m_CustomReflection: {fileID: 0} 40 | m_Sun: {fileID: 0} 41 | m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1} 42 | m_UseRadianceAmbientProbe: 0 43 | --- !u!157 &3 44 | LightmapSettings: 45 | m_ObjectHideFlags: 0 46 | serializedVersion: 11 47 | m_GIWorkflowMode: 1 48 | m_GISettings: 49 | serializedVersion: 2 50 | m_BounceScale: 1 51 | m_IndirectOutputScale: 1 52 | m_AlbedoBoost: 1 53 | m_EnvironmentLightingMode: 0 54 | m_EnableBakedLightmaps: 1 55 | m_EnableRealtimeLightmaps: 1 56 | m_LightmapEditorSettings: 57 | serializedVersion: 12 58 | m_Resolution: 2 59 | m_BakeResolution: 40 60 | m_AtlasSize: 1024 61 | m_AO: 0 62 | m_AOMaxDistance: 1 63 | m_CompAOExponent: 1 64 | m_CompAOExponentDirect: 0 65 | m_ExtractAmbientOcclusion: 0 66 | m_Padding: 2 67 | m_LightmapParameters: {fileID: 0} 68 | m_LightmapsBakeMode: 1 69 | m_TextureCompression: 1 70 | m_FinalGather: 0 71 | m_FinalGatherFiltering: 1 72 | m_FinalGatherRayCount: 256 73 | m_ReflectionCompression: 2 74 | m_MixedBakeMode: 2 75 | m_BakeBackend: 1 76 | m_PVRSampling: 1 77 | m_PVRDirectSampleCount: 32 78 | m_PVRSampleCount: 512 79 | m_PVRBounces: 2 80 | m_PVREnvironmentSampleCount: 256 81 | m_PVREnvironmentReferencePointCount: 2048 82 | m_PVRFilteringMode: 1 83 | m_PVRDenoiserTypeDirect: 1 84 | m_PVRDenoiserTypeIndirect: 1 85 | m_PVRDenoiserTypeAO: 1 86 | m_PVRFilterTypeDirect: 0 87 | m_PVRFilterTypeIndirect: 0 88 | m_PVRFilterTypeAO: 0 89 | m_PVREnvironmentMIS: 1 90 | m_PVRCulling: 1 91 | m_PVRFilteringGaussRadiusDirect: 1 92 | m_PVRFilteringGaussRadiusIndirect: 5 93 | m_PVRFilteringGaussRadiusAO: 2 94 | m_PVRFilteringAtrousPositionSigmaDirect: 0.5 95 | m_PVRFilteringAtrousPositionSigmaIndirect: 2 96 | m_PVRFilteringAtrousPositionSigmaAO: 1 97 | m_ShowResolutionOverlay: 1 98 | m_ExportTrainingData: 0 99 | m_LightingDataAsset: {fileID: 0} 100 | m_UseShadowmask: 1 101 | --- !u!196 &4 102 | NavMeshSettings: 103 | serializedVersion: 2 104 | m_ObjectHideFlags: 0 105 | m_BuildSettings: 106 | serializedVersion: 2 107 | agentTypeID: 0 108 | agentRadius: 0.5 109 | agentHeight: 2 110 | agentSlope: 45 111 | agentClimb: 0.4 112 | ledgeDropHeight: 0 113 | maxJumpAcrossDistance: 0 114 | minRegionArea: 2 115 | manualCellSize: 0 116 | cellSize: 0.16666667 117 | manualTileSize: 0 118 | tileSize: 256 119 | accuratePlacement: 0 120 | debug: 121 | m_Flags: 0 122 | m_NavMeshData: {fileID: 0} 123 | --- !u!1 &171139261 124 | GameObject: 125 | m_ObjectHideFlags: 0 126 | m_CorrespondingSourceObject: {fileID: 0} 127 | m_PrefabInstance: {fileID: 0} 128 | m_PrefabAsset: {fileID: 0} 129 | serializedVersion: 6 130 | m_Component: 131 | - component: {fileID: 171139264} 132 | - component: {fileID: 171139263} 133 | - component: {fileID: 171139262} 134 | m_Layer: 0 135 | m_Name: Main Camera 136 | m_TagString: MainCamera 137 | m_Icon: {fileID: 0} 138 | m_NavMeshLayer: 0 139 | m_StaticEditorFlags: 0 140 | m_IsActive: 1 141 | --- !u!81 &171139262 142 | AudioListener: 143 | m_ObjectHideFlags: 0 144 | m_CorrespondingSourceObject: {fileID: 0} 145 | m_PrefabInstance: {fileID: 0} 146 | m_PrefabAsset: {fileID: 0} 147 | m_GameObject: {fileID: 171139261} 148 | m_Enabled: 1 149 | --- !u!20 &171139263 150 | Camera: 151 | m_ObjectHideFlags: 0 152 | m_CorrespondingSourceObject: {fileID: 0} 153 | m_PrefabInstance: {fileID: 0} 154 | m_PrefabAsset: {fileID: 0} 155 | m_GameObject: {fileID: 171139261} 156 | m_Enabled: 1 157 | serializedVersion: 2 158 | m_ClearFlags: 1 159 | m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} 160 | m_projectionMatrixMode: 1 161 | m_GateFitMode: 2 162 | m_FOVAxisMode: 0 163 | m_SensorSize: {x: 36, y: 24} 164 | m_LensShift: {x: 0, y: 0} 165 | m_FocalLength: 50 166 | m_NormalizedViewPortRect: 167 | serializedVersion: 2 168 | x: 0 169 | y: 0 170 | width: 1 171 | height: 1 172 | near clip plane: 0.3 173 | far clip plane: 1000 174 | field of view: 60 175 | orthographic: 0 176 | orthographic size: 5 177 | m_Depth: -1 178 | m_CullingMask: 179 | serializedVersion: 2 180 | m_Bits: 4294967295 181 | m_RenderingPath: -1 182 | m_TargetTexture: {fileID: 0} 183 | m_TargetDisplay: 0 184 | m_TargetEye: 3 185 | m_HDR: 1 186 | m_AllowMSAA: 1 187 | m_AllowDynamicResolution: 0 188 | m_ForceIntoRT: 0 189 | m_OcclusionCulling: 1 190 | m_StereoConvergence: 10 191 | m_StereoSeparation: 0.022 192 | --- !u!4 &171139264 193 | Transform: 194 | m_ObjectHideFlags: 0 195 | m_CorrespondingSourceObject: {fileID: 0} 196 | m_PrefabInstance: {fileID: 0} 197 | m_PrefabAsset: {fileID: 0} 198 | m_GameObject: {fileID: 171139261} 199 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 200 | m_LocalPosition: {x: 0, y: 1, z: -10} 201 | m_LocalScale: {x: 1, y: 1, z: 1} 202 | m_Children: [] 203 | m_Father: {fileID: 0} 204 | m_RootOrder: 0 205 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 206 | --- !u!1 &817117836 207 | GameObject: 208 | m_ObjectHideFlags: 0 209 | m_CorrespondingSourceObject: {fileID: 0} 210 | m_PrefabInstance: {fileID: 0} 211 | m_PrefabAsset: {fileID: 0} 212 | serializedVersion: 6 213 | m_Component: 214 | - component: {fileID: 817117838} 215 | - component: {fileID: 817117837} 216 | m_Layer: 0 217 | m_Name: Directional Light 218 | m_TagString: Untagged 219 | m_Icon: {fileID: 0} 220 | m_NavMeshLayer: 0 221 | m_StaticEditorFlags: 0 222 | m_IsActive: 1 223 | --- !u!108 &817117837 224 | Light: 225 | m_ObjectHideFlags: 0 226 | m_CorrespondingSourceObject: {fileID: 0} 227 | m_PrefabInstance: {fileID: 0} 228 | m_PrefabAsset: {fileID: 0} 229 | m_GameObject: {fileID: 817117836} 230 | m_Enabled: 1 231 | serializedVersion: 9 232 | m_Type: 1 233 | m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} 234 | m_Intensity: 1 235 | m_Range: 10 236 | m_SpotAngle: 30 237 | m_InnerSpotAngle: 21.80208 238 | m_CookieSize: 10 239 | m_Shadows: 240 | m_Type: 2 241 | m_Resolution: -1 242 | m_CustomResolution: -1 243 | m_Strength: 1 244 | m_Bias: 0.05 245 | m_NormalBias: 0.4 246 | m_NearPlane: 0.2 247 | m_CullingMatrixOverride: 248 | e00: 1 249 | e01: 0 250 | e02: 0 251 | e03: 0 252 | e10: 0 253 | e11: 1 254 | e12: 0 255 | e13: 0 256 | e20: 0 257 | e21: 0 258 | e22: 1 259 | e23: 0 260 | e30: 0 261 | e31: 0 262 | e32: 0 263 | e33: 1 264 | m_UseCullingMatrixOverride: 0 265 | m_Cookie: {fileID: 0} 266 | m_DrawHalo: 0 267 | m_Flare: {fileID: 0} 268 | m_RenderMode: 0 269 | m_CullingMask: 270 | serializedVersion: 2 271 | m_Bits: 4294967295 272 | m_RenderingLayerMask: 1 273 | m_Lightmapping: 4 274 | m_LightShadowCasterMode: 0 275 | m_AreaSize: {x: 1, y: 1} 276 | m_BounceIntensity: 1 277 | m_ColorTemperature: 6570 278 | m_UseColorTemperature: 0 279 | m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} 280 | m_UseBoundingSphereOverride: 0 281 | m_ShadowRadius: 0 282 | m_ShadowAngle: 0 283 | --- !u!4 &817117838 284 | Transform: 285 | m_ObjectHideFlags: 0 286 | m_CorrespondingSourceObject: {fileID: 0} 287 | m_PrefabInstance: {fileID: 0} 288 | m_PrefabAsset: {fileID: 0} 289 | m_GameObject: {fileID: 817117836} 290 | m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261} 291 | m_LocalPosition: {x: 0, y: 3, z: 0} 292 | m_LocalScale: {x: 1, y: 1, z: 1} 293 | m_Children: [] 294 | m_Father: {fileID: 0} 295 | m_RootOrder: 1 296 | m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} 297 | -------------------------------------------------------------------------------- /Tools/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 | - serializedVersion: 3 297 | m_Name: Enable Debug Button 1 298 | descriptiveName: 299 | descriptiveNegativeName: 300 | negativeButton: 301 | positiveButton: left ctrl 302 | altNegativeButton: 303 | altPositiveButton: joystick button 8 304 | gravity: 0 305 | dead: 0 306 | sensitivity: 0 307 | snap: 0 308 | invert: 0 309 | type: 0 310 | axis: 0 311 | joyNum: 0 312 | - serializedVersion: 3 313 | m_Name: Enable Debug Button 2 314 | descriptiveName: 315 | descriptiveNegativeName: 316 | negativeButton: 317 | positiveButton: backspace 318 | altNegativeButton: 319 | altPositiveButton: joystick button 9 320 | gravity: 0 321 | dead: 0 322 | sensitivity: 0 323 | snap: 0 324 | invert: 0 325 | type: 0 326 | axis: 0 327 | joyNum: 0 328 | - serializedVersion: 3 329 | m_Name: Debug Next 330 | descriptiveName: 331 | descriptiveNegativeName: 332 | negativeButton: 333 | positiveButton: page down 334 | altNegativeButton: 335 | altPositiveButton: joystick button 5 336 | gravity: 0 337 | dead: 0 338 | sensitivity: 0 339 | snap: 0 340 | invert: 0 341 | type: 0 342 | axis: 0 343 | joyNum: 0 344 | - serializedVersion: 3 345 | m_Name: Debug Previous 346 | descriptiveName: 347 | descriptiveNegativeName: 348 | negativeButton: 349 | positiveButton: page up 350 | altNegativeButton: 351 | altPositiveButton: joystick button 4 352 | gravity: 0 353 | dead: 0 354 | sensitivity: 0 355 | snap: 0 356 | invert: 0 357 | type: 0 358 | axis: 0 359 | joyNum: 0 360 | - serializedVersion: 3 361 | m_Name: Debug Validate 362 | descriptiveName: 363 | descriptiveNegativeName: 364 | negativeButton: 365 | positiveButton: return 366 | altNegativeButton: 367 | altPositiveButton: joystick button 0 368 | gravity: 0 369 | dead: 0 370 | sensitivity: 0 371 | snap: 0 372 | invert: 0 373 | type: 0 374 | axis: 0 375 | joyNum: 0 376 | - serializedVersion: 3 377 | m_Name: Debug Persistent 378 | descriptiveName: 379 | descriptiveNegativeName: 380 | negativeButton: 381 | positiveButton: right shift 382 | altNegativeButton: 383 | altPositiveButton: joystick button 2 384 | gravity: 0 385 | dead: 0 386 | sensitivity: 0 387 | snap: 0 388 | invert: 0 389 | type: 0 390 | axis: 0 391 | joyNum: 0 392 | - serializedVersion: 3 393 | m_Name: Debug Multiplier 394 | descriptiveName: 395 | descriptiveNegativeName: 396 | negativeButton: 397 | positiveButton: left shift 398 | altNegativeButton: 399 | altPositiveButton: joystick button 3 400 | gravity: 0 401 | dead: 0 402 | sensitivity: 0 403 | snap: 0 404 | invert: 0 405 | type: 0 406 | axis: 0 407 | joyNum: 0 408 | - serializedVersion: 3 409 | m_Name: Debug Horizontal 410 | descriptiveName: 411 | descriptiveNegativeName: 412 | negativeButton: left 413 | positiveButton: right 414 | altNegativeButton: 415 | altPositiveButton: 416 | gravity: 1000 417 | dead: 0.001 418 | sensitivity: 1000 419 | snap: 0 420 | invert: 0 421 | type: 0 422 | axis: 0 423 | joyNum: 0 424 | - serializedVersion: 3 425 | m_Name: Debug Vertical 426 | descriptiveName: 427 | descriptiveNegativeName: 428 | negativeButton: down 429 | positiveButton: up 430 | altNegativeButton: 431 | altPositiveButton: 432 | gravity: 1000 433 | dead: 0.001 434 | sensitivity: 1000 435 | snap: 0 436 | invert: 0 437 | type: 0 438 | axis: 0 439 | joyNum: 0 440 | - serializedVersion: 3 441 | m_Name: Debug Vertical 442 | descriptiveName: 443 | descriptiveNegativeName: 444 | negativeButton: down 445 | positiveButton: up 446 | altNegativeButton: 447 | altPositiveButton: 448 | gravity: 1000 449 | dead: 0.001 450 | sensitivity: 1000 451 | snap: 0 452 | invert: 0 453 | type: 2 454 | axis: 6 455 | joyNum: 0 456 | - serializedVersion: 3 457 | m_Name: Debug Horizontal 458 | descriptiveName: 459 | descriptiveNegativeName: 460 | negativeButton: left 461 | positiveButton: right 462 | altNegativeButton: 463 | altPositiveButton: 464 | gravity: 1000 465 | dead: 0.001 466 | sensitivity: 1000 467 | snap: 0 468 | invert: 0 469 | type: 2 470 | axis: 5 471 | joyNum: 0 472 | -------------------------------------------------------------------------------- /Tools/Assets/InputFireEvents/_Scenes/InputEvent_scene.unity: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!29 &1 4 | OcclusionCullingSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_OcclusionBakeSettings: 8 | smallestOccluder: 5 9 | smallestHole: 0.25 10 | backfaceThreshold: 100 11 | m_SceneGUID: 00000000000000000000000000000000 12 | m_OcclusionCullingData: {fileID: 0} 13 | --- !u!104 &2 14 | RenderSettings: 15 | m_ObjectHideFlags: 0 16 | serializedVersion: 8 17 | m_Fog: 0 18 | m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} 19 | m_FogMode: 3 20 | m_FogDensity: 0.01 21 | m_LinearFogStart: 0 22 | m_LinearFogEnd: 300 23 | m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} 24 | m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} 25 | m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} 26 | m_AmbientIntensity: 1 27 | m_AmbientMode: 0 28 | m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} 29 | m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} 30 | m_HaloStrength: 0.5 31 | m_FlareStrength: 1 32 | m_FlareFadeSpeed: 3 33 | m_HaloTexture: {fileID: 0} 34 | m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} 35 | m_DefaultReflectionMode: 0 36 | m_DefaultReflectionResolution: 128 37 | m_ReflectionBounces: 1 38 | m_ReflectionIntensity: 1 39 | m_CustomReflection: {fileID: 0} 40 | m_Sun: {fileID: 0} 41 | m_IndirectSpecularColor: {r: 0.44657898, g: 0.4964133, b: 0.5748178, a: 1} 42 | --- !u!157 &3 43 | LightmapSettings: 44 | m_ObjectHideFlags: 0 45 | serializedVersion: 11 46 | m_GIWorkflowMode: 0 47 | m_GISettings: 48 | serializedVersion: 2 49 | m_BounceScale: 1 50 | m_IndirectOutputScale: 1 51 | m_AlbedoBoost: 1 52 | m_TemporalCoherenceThreshold: 1 53 | m_EnvironmentLightingMode: 0 54 | m_EnableBakedLightmaps: 1 55 | m_EnableRealtimeLightmaps: 1 56 | m_LightmapEditorSettings: 57 | serializedVersion: 9 58 | m_Resolution: 2 59 | m_BakeResolution: 40 60 | m_TextureWidth: 1024 61 | m_TextureHeight: 1024 62 | m_AO: 0 63 | m_AOMaxDistance: 1 64 | m_CompAOExponent: 1 65 | m_CompAOExponentDirect: 0 66 | m_Padding: 2 67 | m_LightmapParameters: {fileID: 0} 68 | m_LightmapsBakeMode: 1 69 | m_TextureCompression: 1 70 | m_FinalGather: 0 71 | m_FinalGatherFiltering: 1 72 | m_FinalGatherRayCount: 256 73 | m_ReflectionCompression: 2 74 | m_MixedBakeMode: 2 75 | m_BakeBackend: 0 76 | m_PVRSampling: 1 77 | m_PVRDirectSampleCount: 32 78 | m_PVRSampleCount: 500 79 | m_PVRBounces: 2 80 | m_PVRFilterTypeDirect: 0 81 | m_PVRFilterTypeIndirect: 0 82 | m_PVRFilterTypeAO: 0 83 | m_PVRFilteringMode: 1 84 | m_PVRCulling: 1 85 | m_PVRFilteringGaussRadiusDirect: 1 86 | m_PVRFilteringGaussRadiusIndirect: 5 87 | m_PVRFilteringGaussRadiusAO: 2 88 | m_PVRFilteringAtrousPositionSigmaDirect: 0.5 89 | m_PVRFilteringAtrousPositionSigmaIndirect: 2 90 | m_PVRFilteringAtrousPositionSigmaAO: 1 91 | m_LightingDataAsset: {fileID: 0} 92 | m_UseShadowmask: 1 93 | --- !u!196 &4 94 | NavMeshSettings: 95 | serializedVersion: 2 96 | m_ObjectHideFlags: 0 97 | m_BuildSettings: 98 | serializedVersion: 2 99 | agentTypeID: 0 100 | agentRadius: 0.5 101 | agentHeight: 2 102 | agentSlope: 45 103 | agentClimb: 0.4 104 | ledgeDropHeight: 0 105 | maxJumpAcrossDistance: 0 106 | minRegionArea: 2 107 | manualCellSize: 0 108 | cellSize: 0.16666667 109 | manualTileSize: 0 110 | tileSize: 256 111 | accuratePlacement: 0 112 | debug: 113 | m_Flags: 0 114 | m_NavMeshData: {fileID: 0} 115 | --- !u!1 &68184562 116 | GameObject: 117 | m_ObjectHideFlags: 0 118 | m_PrefabParentObject: {fileID: 0} 119 | m_PrefabInternal: {fileID: 0} 120 | serializedVersion: 5 121 | m_Component: 122 | - component: {fileID: 68184564} 123 | - component: {fileID: 68184563} 124 | m_Layer: 0 125 | m_Name: InputFireEvents 126 | m_TagString: Untagged 127 | m_Icon: {fileID: 0} 128 | m_NavMeshLayer: 0 129 | m_StaticEditorFlags: 0 130 | m_IsActive: 1 131 | --- !u!114 &68184563 132 | MonoBehaviour: 133 | m_ObjectHideFlags: 0 134 | m_PrefabParentObject: {fileID: 0} 135 | m_PrefabInternal: {fileID: 0} 136 | m_GameObject: {fileID: 68184562} 137 | m_Enabled: 1 138 | m_EditorHideFlags: 0 139 | m_Script: {fileID: 11500000, guid: 0ef3084ed61ed6e47bc56e68a8f6bcc9, type: 3} 140 | m_Name: 141 | m_EditorClassIdentifier: 142 | inputEvents: 143 | - keyInput: 48 144 | keyEvent: 145 | m_PersistentCalls: 146 | m_Calls: 147 | - m_Target: {fileID: 1148362170} 148 | m_MethodName: SetActive 149 | m_Mode: 6 150 | m_Arguments: 151 | m_ObjectArgument: {fileID: 0} 152 | m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine 153 | m_IntArgument: 0 154 | m_FloatArgument: 0 155 | m_StringArgument: 156 | m_BoolArgument: 0 157 | m_CallState: 2 158 | - m_Target: {fileID: 1866503162} 159 | m_MethodName: SetActive 160 | m_Mode: 6 161 | m_Arguments: 162 | m_ObjectArgument: {fileID: 0} 163 | m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine 164 | m_IntArgument: 0 165 | m_FloatArgument: 0 166 | m_StringArgument: 167 | m_BoolArgument: 1 168 | m_CallState: 2 169 | m_TypeName: UnityEngine.Events.UnityEvent, UnityEngine.CoreModule, Version=0.0.0.0, 170 | Culture=neutral, PublicKeyToken=null 171 | Name: Alpha0 172 | display: 0 173 | description: 174 | - keyInput: 49 175 | keyEvent: 176 | m_PersistentCalls: 177 | m_Calls: 178 | - m_Target: {fileID: 1148362170} 179 | m_MethodName: SetActive 180 | m_Mode: 6 181 | m_Arguments: 182 | m_ObjectArgument: {fileID: 0} 183 | m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine 184 | m_IntArgument: 0 185 | m_FloatArgument: 0 186 | m_StringArgument: 187 | m_BoolArgument: 1 188 | m_CallState: 2 189 | - m_Target: {fileID: 1866503162} 190 | m_MethodName: SetActive 191 | m_Mode: 6 192 | m_Arguments: 193 | m_ObjectArgument: {fileID: 0} 194 | m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine 195 | m_IntArgument: 0 196 | m_FloatArgument: 0 197 | m_StringArgument: 198 | m_BoolArgument: 0 199 | m_CallState: 2 200 | m_TypeName: UnityEngine.Events.UnityEvent, UnityEngine.CoreModule, Version=0.0.0.0, 201 | Culture=neutral, PublicKeyToken=null 202 | Name: Alpha1 203 | display: 0 204 | description: 205 | debug: 0 206 | --- !u!4 &68184564 207 | Transform: 208 | m_ObjectHideFlags: 0 209 | m_PrefabParentObject: {fileID: 0} 210 | m_PrefabInternal: {fileID: 0} 211 | m_GameObject: {fileID: 68184562} 212 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 213 | m_LocalPosition: {x: 0, y: 0, z: 0} 214 | m_LocalScale: {x: 1, y: 1, z: 1} 215 | m_Children: [] 216 | m_Father: {fileID: 0} 217 | m_RootOrder: 2 218 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 219 | --- !u!1 &882409561 220 | GameObject: 221 | m_ObjectHideFlags: 0 222 | m_PrefabParentObject: {fileID: 0} 223 | m_PrefabInternal: {fileID: 0} 224 | serializedVersion: 5 225 | m_Component: 226 | - component: {fileID: 882409565} 227 | - component: {fileID: 882409564} 228 | - component: {fileID: 882409563} 229 | - component: {fileID: 882409562} 230 | m_Layer: 0 231 | m_Name: Main Camera 232 | m_TagString: MainCamera 233 | m_Icon: {fileID: 0} 234 | m_NavMeshLayer: 0 235 | m_StaticEditorFlags: 0 236 | m_IsActive: 1 237 | --- !u!81 &882409562 238 | AudioListener: 239 | m_ObjectHideFlags: 0 240 | m_PrefabParentObject: {fileID: 0} 241 | m_PrefabInternal: {fileID: 0} 242 | m_GameObject: {fileID: 882409561} 243 | m_Enabled: 1 244 | --- !u!124 &882409563 245 | Behaviour: 246 | m_ObjectHideFlags: 0 247 | m_PrefabParentObject: {fileID: 0} 248 | m_PrefabInternal: {fileID: 0} 249 | m_GameObject: {fileID: 882409561} 250 | m_Enabled: 1 251 | --- !u!20 &882409564 252 | Camera: 253 | m_ObjectHideFlags: 0 254 | m_PrefabParentObject: {fileID: 0} 255 | m_PrefabInternal: {fileID: 0} 256 | m_GameObject: {fileID: 882409561} 257 | m_Enabled: 1 258 | serializedVersion: 2 259 | m_ClearFlags: 1 260 | m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} 261 | m_NormalizedViewPortRect: 262 | serializedVersion: 2 263 | x: 0 264 | y: 0 265 | width: 1 266 | height: 1 267 | near clip plane: 0.3 268 | far clip plane: 1000 269 | field of view: 60 270 | orthographic: 0 271 | orthographic size: 5 272 | m_Depth: -1 273 | m_CullingMask: 274 | serializedVersion: 2 275 | m_Bits: 4294967295 276 | m_RenderingPath: -1 277 | m_TargetTexture: {fileID: 0} 278 | m_TargetDisplay: 0 279 | m_TargetEye: 3 280 | m_HDR: 1 281 | m_AllowMSAA: 1 282 | m_ForceIntoRT: 0 283 | m_OcclusionCulling: 1 284 | m_StereoConvergence: 10 285 | m_StereoSeparation: 0.022 286 | --- !u!4 &882409565 287 | Transform: 288 | m_ObjectHideFlags: 0 289 | m_PrefabParentObject: {fileID: 0} 290 | m_PrefabInternal: {fileID: 0} 291 | m_GameObject: {fileID: 882409561} 292 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 293 | m_LocalPosition: {x: 0, y: 1, z: -10} 294 | m_LocalScale: {x: 1, y: 1, z: 1} 295 | m_Children: [] 296 | m_Father: {fileID: 0} 297 | m_RootOrder: 0 298 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 299 | --- !u!1 &1148362170 300 | GameObject: 301 | m_ObjectHideFlags: 0 302 | m_PrefabParentObject: {fileID: 0} 303 | m_PrefabInternal: {fileID: 0} 304 | serializedVersion: 5 305 | m_Component: 306 | - component: {fileID: 1148362174} 307 | - component: {fileID: 1148362173} 308 | - component: {fileID: 1148362172} 309 | - component: {fileID: 1148362171} 310 | m_Layer: 0 311 | m_Name: Cube 312 | m_TagString: Untagged 313 | m_Icon: {fileID: 0} 314 | m_NavMeshLayer: 0 315 | m_StaticEditorFlags: 0 316 | m_IsActive: 1 317 | --- !u!23 &1148362171 318 | MeshRenderer: 319 | m_ObjectHideFlags: 0 320 | m_PrefabParentObject: {fileID: 0} 321 | m_PrefabInternal: {fileID: 0} 322 | m_GameObject: {fileID: 1148362170} 323 | m_Enabled: 1 324 | m_CastShadows: 1 325 | m_ReceiveShadows: 1 326 | m_DynamicOccludee: 1 327 | m_MotionVectors: 1 328 | m_LightProbeUsage: 1 329 | m_ReflectionProbeUsage: 1 330 | m_Materials: 331 | - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} 332 | m_StaticBatchInfo: 333 | firstSubMesh: 0 334 | subMeshCount: 0 335 | m_StaticBatchRoot: {fileID: 0} 336 | m_ProbeAnchor: {fileID: 0} 337 | m_LightProbeVolumeOverride: {fileID: 0} 338 | m_ScaleInLightmap: 1 339 | m_PreserveUVs: 1 340 | m_IgnoreNormalsForChartDetection: 0 341 | m_ImportantGI: 0 342 | m_StitchLightmapSeams: 0 343 | m_SelectedEditorRenderState: 3 344 | m_MinimumChartSize: 4 345 | m_AutoUVMaxDistance: 0.5 346 | m_AutoUVMaxAngle: 89 347 | m_LightmapParameters: {fileID: 0} 348 | m_SortingLayerID: 0 349 | m_SortingLayer: 0 350 | m_SortingOrder: 0 351 | --- !u!65 &1148362172 352 | BoxCollider: 353 | m_ObjectHideFlags: 0 354 | m_PrefabParentObject: {fileID: 0} 355 | m_PrefabInternal: {fileID: 0} 356 | m_GameObject: {fileID: 1148362170} 357 | m_Material: {fileID: 0} 358 | m_IsTrigger: 0 359 | m_Enabled: 1 360 | serializedVersion: 2 361 | m_Size: {x: 1, y: 1, z: 1} 362 | m_Center: {x: 0, y: 0, z: 0} 363 | --- !u!33 &1148362173 364 | MeshFilter: 365 | m_ObjectHideFlags: 0 366 | m_PrefabParentObject: {fileID: 0} 367 | m_PrefabInternal: {fileID: 0} 368 | m_GameObject: {fileID: 1148362170} 369 | m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} 370 | --- !u!4 &1148362174 371 | Transform: 372 | m_ObjectHideFlags: 0 373 | m_PrefabParentObject: {fileID: 0} 374 | m_PrefabInternal: {fileID: 0} 375 | m_GameObject: {fileID: 1148362170} 376 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 377 | m_LocalPosition: {x: 0, y: 0, z: 0} 378 | m_LocalScale: {x: 1, y: 1, z: 1} 379 | m_Children: [] 380 | m_Father: {fileID: 0} 381 | m_RootOrder: 3 382 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 383 | --- !u!1 &1203522834 384 | GameObject: 385 | m_ObjectHideFlags: 0 386 | m_PrefabParentObject: {fileID: 0} 387 | m_PrefabInternal: {fileID: 0} 388 | serializedVersion: 5 389 | m_Component: 390 | - component: {fileID: 1203522836} 391 | - component: {fileID: 1203522835} 392 | m_Layer: 0 393 | m_Name: Directional Light 394 | m_TagString: Untagged 395 | m_Icon: {fileID: 0} 396 | m_NavMeshLayer: 0 397 | m_StaticEditorFlags: 0 398 | m_IsActive: 1 399 | --- !u!108 &1203522835 400 | Light: 401 | m_ObjectHideFlags: 0 402 | m_PrefabParentObject: {fileID: 0} 403 | m_PrefabInternal: {fileID: 0} 404 | m_GameObject: {fileID: 1203522834} 405 | m_Enabled: 1 406 | serializedVersion: 8 407 | m_Type: 1 408 | m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} 409 | m_Intensity: 1 410 | m_Range: 10 411 | m_SpotAngle: 30 412 | m_CookieSize: 10 413 | m_Shadows: 414 | m_Type: 2 415 | m_Resolution: -1 416 | m_CustomResolution: -1 417 | m_Strength: 1 418 | m_Bias: 0.05 419 | m_NormalBias: 0.4 420 | m_NearPlane: 0.2 421 | m_Cookie: {fileID: 0} 422 | m_DrawHalo: 0 423 | m_Flare: {fileID: 0} 424 | m_RenderMode: 0 425 | m_CullingMask: 426 | serializedVersion: 2 427 | m_Bits: 4294967295 428 | m_Lightmapping: 4 429 | m_AreaSize: {x: 1, y: 1} 430 | m_BounceIntensity: 1 431 | m_ColorTemperature: 6570 432 | m_UseColorTemperature: 0 433 | m_ShadowRadius: 0 434 | m_ShadowAngle: 0 435 | --- !u!4 &1203522836 436 | Transform: 437 | m_ObjectHideFlags: 0 438 | m_PrefabParentObject: {fileID: 0} 439 | m_PrefabInternal: {fileID: 0} 440 | m_GameObject: {fileID: 1203522834} 441 | m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261} 442 | m_LocalPosition: {x: 0, y: 3, z: 0} 443 | m_LocalScale: {x: 1, y: 1, z: 1} 444 | m_Children: [] 445 | m_Father: {fileID: 0} 446 | m_RootOrder: 1 447 | m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} 448 | --- !u!1 &1866503162 449 | GameObject: 450 | m_ObjectHideFlags: 0 451 | m_PrefabParentObject: {fileID: 0} 452 | m_PrefabInternal: {fileID: 0} 453 | serializedVersion: 5 454 | m_Component: 455 | - component: {fileID: 1866503166} 456 | - component: {fileID: 1866503165} 457 | - component: {fileID: 1866503164} 458 | - component: {fileID: 1866503163} 459 | m_Layer: 0 460 | m_Name: Sphere 461 | m_TagString: Untagged 462 | m_Icon: {fileID: 0} 463 | m_NavMeshLayer: 0 464 | m_StaticEditorFlags: 0 465 | m_IsActive: 0 466 | --- !u!23 &1866503163 467 | MeshRenderer: 468 | m_ObjectHideFlags: 0 469 | m_PrefabParentObject: {fileID: 0} 470 | m_PrefabInternal: {fileID: 0} 471 | m_GameObject: {fileID: 1866503162} 472 | m_Enabled: 1 473 | m_CastShadows: 1 474 | m_ReceiveShadows: 1 475 | m_DynamicOccludee: 1 476 | m_MotionVectors: 1 477 | m_LightProbeUsage: 1 478 | m_ReflectionProbeUsage: 1 479 | m_Materials: 480 | - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} 481 | m_StaticBatchInfo: 482 | firstSubMesh: 0 483 | subMeshCount: 0 484 | m_StaticBatchRoot: {fileID: 0} 485 | m_ProbeAnchor: {fileID: 0} 486 | m_LightProbeVolumeOverride: {fileID: 0} 487 | m_ScaleInLightmap: 1 488 | m_PreserveUVs: 1 489 | m_IgnoreNormalsForChartDetection: 0 490 | m_ImportantGI: 0 491 | m_StitchLightmapSeams: 0 492 | m_SelectedEditorRenderState: 3 493 | m_MinimumChartSize: 4 494 | m_AutoUVMaxDistance: 0.5 495 | m_AutoUVMaxAngle: 89 496 | m_LightmapParameters: {fileID: 0} 497 | m_SortingLayerID: 0 498 | m_SortingLayer: 0 499 | m_SortingOrder: 0 500 | --- !u!135 &1866503164 501 | SphereCollider: 502 | m_ObjectHideFlags: 0 503 | m_PrefabParentObject: {fileID: 0} 504 | m_PrefabInternal: {fileID: 0} 505 | m_GameObject: {fileID: 1866503162} 506 | m_Material: {fileID: 0} 507 | m_IsTrigger: 0 508 | m_Enabled: 1 509 | serializedVersion: 2 510 | m_Radius: 0.5 511 | m_Center: {x: 0, y: 0, z: 0} 512 | --- !u!33 &1866503165 513 | MeshFilter: 514 | m_ObjectHideFlags: 0 515 | m_PrefabParentObject: {fileID: 0} 516 | m_PrefabInternal: {fileID: 0} 517 | m_GameObject: {fileID: 1866503162} 518 | m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} 519 | --- !u!4 &1866503166 520 | Transform: 521 | m_ObjectHideFlags: 0 522 | m_PrefabParentObject: {fileID: 0} 523 | m_PrefabInternal: {fileID: 0} 524 | m_GameObject: {fileID: 1866503162} 525 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 526 | m_LocalPosition: {x: 2, y: 0, z: 0} 527 | m_LocalScale: {x: 1, y: 1, z: 1} 528 | m_Children: [] 529 | m_Father: {fileID: 0} 530 | m_RootOrder: 4 531 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 532 | -------------------------------------------------------------------------------- /Tools/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: 16 7 | productGUID: d79ca2a867579ca4baa60b60a2f059f1 8 | AndroidProfiler: 0 9 | AndroidFilterTouchesWhenObscured: 0 10 | AndroidEnableSustainedPerformanceMode: 0 11 | defaultScreenOrientation: 4 12 | targetDevice: 2 13 | useOnDemandResources: 0 14 | accelerometerFrequency: 60 15 | companyName: DefaultCompany 16 | productName: Tools 17 | defaultCursor: {fileID: 0} 18 | cursorHotspot: {x: 0, y: 0} 19 | m_SplashScreenBackgroundColor: {r: 0.13725491, g: 0.12156863, b: 0.1254902, a: 1} 20 | m_ShowUnitySplashScreen: 1 21 | m_ShowUnitySplashLogo: 1 22 | m_SplashScreenOverlayOpacity: 1 23 | m_SplashScreenAnimation: 1 24 | m_SplashScreenLogoStyle: 1 25 | m_SplashScreenDrawMode: 0 26 | m_SplashScreenBackgroundAnimationZoom: 1 27 | m_SplashScreenLogoAnimationZoom: 1 28 | m_SplashScreenBackgroundLandscapeAspect: 1 29 | m_SplashScreenBackgroundPortraitAspect: 1 30 | m_SplashScreenBackgroundLandscapeUvs: 31 | serializedVersion: 2 32 | x: 0 33 | y: 0 34 | width: 1 35 | height: 1 36 | m_SplashScreenBackgroundPortraitUvs: 37 | serializedVersion: 2 38 | x: 0 39 | y: 0 40 | width: 1 41 | height: 1 42 | m_SplashScreenLogos: [] 43 | m_VirtualRealitySplashScreen: {fileID: 0} 44 | m_HolographicTrackingLossScreen: {fileID: 0} 45 | defaultScreenWidth: 1024 46 | defaultScreenHeight: 768 47 | defaultScreenWidthWeb: 960 48 | defaultScreenHeightWeb: 600 49 | m_StereoRenderingPath: 0 50 | m_ActiveColorSpace: 0 51 | m_MTRendering: 1 52 | m_StackTraceTypes: 010000000100000001000000010000000100000001000000 53 | iosShowActivityIndicatorOnLoading: -1 54 | androidShowActivityIndicatorOnLoading: -1 55 | iosAppInBackgroundBehavior: 0 56 | displayResolutionDialog: 1 57 | iosAllowHTTPDownload: 1 58 | allowedAutorotateToPortrait: 1 59 | allowedAutorotateToPortraitUpsideDown: 1 60 | allowedAutorotateToLandscapeRight: 1 61 | allowedAutorotateToLandscapeLeft: 1 62 | useOSAutorotation: 1 63 | use32BitDisplayBuffer: 1 64 | preserveFramebufferAlpha: 0 65 | disableDepthAndStencilBuffers: 0 66 | androidStartInFullscreen: 1 67 | androidRenderOutsideSafeArea: 0 68 | androidBlitType: 1 69 | defaultIsNativeResolution: 1 70 | macRetinaSupport: 1 71 | runInBackground: 0 72 | captureSingleScreen: 0 73 | muteOtherAudioSources: 0 74 | Prepare IOS For Recording: 0 75 | Force IOS Speakers When Recording: 0 76 | deferSystemGesturesMode: 0 77 | hideHomeButton: 0 78 | submitAnalytics: 1 79 | usePlayerLog: 1 80 | bakeCollisionMeshes: 0 81 | forceSingleInstance: 0 82 | resizableWindow: 0 83 | useMacAppStoreValidation: 0 84 | macAppStoreCategory: public.app-category.games 85 | gpuSkinning: 0 86 | graphicsJobs: 0 87 | xboxPIXTextureCapture: 0 88 | xboxEnableAvatar: 0 89 | xboxEnableKinect: 0 90 | xboxEnableKinectAutoTracking: 0 91 | xboxEnableFitness: 0 92 | visibleInBackground: 1 93 | allowFullscreenSwitch: 1 94 | graphicsJobMode: 0 95 | fullscreenMode: 1 96 | xboxSpeechDB: 0 97 | xboxEnableHeadOrientation: 0 98 | xboxEnableGuest: 0 99 | xboxEnablePIXSampling: 0 100 | metalFramebufferOnly: 0 101 | xboxOneResolution: 0 102 | xboxOneSResolution: 0 103 | xboxOneXResolution: 3 104 | xboxOneMonoLoggingLevel: 0 105 | xboxOneLoggingLevel: 1 106 | xboxOneDisableEsram: 0 107 | xboxOnePresentImmediateThreshold: 0 108 | switchQueueCommandMemory: 1048576 109 | switchQueueControlMemory: 16384 110 | switchQueueComputeMemory: 262144 111 | switchNVNShaderPoolsGranularity: 33554432 112 | switchNVNDefaultPoolsGranularity: 16777216 113 | switchNVNOtherPoolsGranularity: 16777216 114 | vulkanEnableSetSRGBWrite: 0 115 | m_SupportedAspectRatios: 116 | 4:3: 1 117 | 5:4: 1 118 | 16:10: 1 119 | 16:9: 1 120 | Others: 1 121 | bundleVersion: 1.0 122 | preloadedAssets: [] 123 | metroInputSource: 0 124 | wsaTransparentSwapchain: 0 125 | m_HolographicPauseOnTrackingLoss: 1 126 | xboxOneDisableKinectGpuReservation: 0 127 | xboxOneEnable7thCore: 0 128 | vrSettings: 129 | cardboard: 130 | depthFormat: 0 131 | enableTransitionView: 0 132 | daydream: 133 | depthFormat: 0 134 | useSustainedPerformanceMode: 0 135 | enableVideoLayer: 0 136 | useProtectedVideoMemory: 0 137 | minimumSupportedHeadTracking: 0 138 | maximumSupportedHeadTracking: 1 139 | hololens: 140 | depthFormat: 1 141 | depthBufferSharingEnabled: 0 142 | lumin: 143 | depthFormat: 0 144 | frameTiming: 2 145 | enableGLCache: 0 146 | glCacheMaxBlobSize: 524288 147 | glCacheMaxFileSize: 8388608 148 | oculus: 149 | sharedDepthBuffer: 1 150 | dashSupport: 1 151 | enable360StereoCapture: 0 152 | isWsaHolographicRemotingEnabled: 0 153 | protectGraphicsMemory: 0 154 | enableFrameTimingStats: 0 155 | useHDRDisplay: 0 156 | m_ColorGamuts: 00000000 157 | targetPixelDensity: 30 158 | resolutionScalingMode: 0 159 | androidSupportedAspectRatio: 1 160 | androidMaxAspectRatio: 2.1 161 | applicationIdentifier: {} 162 | buildNumber: {} 163 | AndroidBundleVersionCode: 1 164 | AndroidMinSdkVersion: 16 165 | AndroidTargetSdkVersion: 0 166 | AndroidPreferredInstallLocation: 1 167 | aotOptions: 168 | stripEngineCode: 1 169 | iPhoneStrippingLevel: 0 170 | iPhoneScriptCallOptimization: 0 171 | ForceInternetPermission: 0 172 | ForceSDCardPermission: 0 173 | CreateWallpaper: 0 174 | APKExpansionFiles: 0 175 | keepLoadedShadersAlive: 0 176 | StripUnusedMeshComponents: 0 177 | VertexChannelCompressionMask: 214 178 | iPhoneSdkVersion: 988 179 | iOSTargetOSVersionString: 9.0 180 | tvOSSdkVersion: 0 181 | tvOSRequireExtendedGameController: 0 182 | tvOSTargetOSVersionString: 9.0 183 | uIPrerenderedIcon: 0 184 | uIRequiresPersistentWiFi: 0 185 | uIRequiresFullScreen: 1 186 | uIStatusBarHidden: 1 187 | uIExitOnSuspend: 0 188 | uIStatusBarStyle: 0 189 | iPhoneSplashScreen: {fileID: 0} 190 | iPhoneHighResSplashScreen: {fileID: 0} 191 | iPhoneTallHighResSplashScreen: {fileID: 0} 192 | iPhone47inSplashScreen: {fileID: 0} 193 | iPhone55inPortraitSplashScreen: {fileID: 0} 194 | iPhone55inLandscapeSplashScreen: {fileID: 0} 195 | iPhone58inPortraitSplashScreen: {fileID: 0} 196 | iPhone58inLandscapeSplashScreen: {fileID: 0} 197 | iPadPortraitSplashScreen: {fileID: 0} 198 | iPadHighResPortraitSplashScreen: {fileID: 0} 199 | iPadLandscapeSplashScreen: {fileID: 0} 200 | iPadHighResLandscapeSplashScreen: {fileID: 0} 201 | iPhone65inPortraitSplashScreen: {fileID: 0} 202 | iPhone65inLandscapeSplashScreen: {fileID: 0} 203 | iPhone61inPortraitSplashScreen: {fileID: 0} 204 | iPhone61inLandscapeSplashScreen: {fileID: 0} 205 | appleTVSplashScreen: {fileID: 0} 206 | appleTVSplashScreen2x: {fileID: 0} 207 | tvOSSmallIconLayers: [] 208 | tvOSSmallIconLayers2x: [] 209 | tvOSLargeIconLayers: [] 210 | tvOSLargeIconLayers2x: [] 211 | tvOSTopShelfImageLayers: [] 212 | tvOSTopShelfImageLayers2x: [] 213 | tvOSTopShelfImageWideLayers: [] 214 | tvOSTopShelfImageWideLayers2x: [] 215 | iOSLaunchScreenType: 0 216 | iOSLaunchScreenPortrait: {fileID: 0} 217 | iOSLaunchScreenLandscape: {fileID: 0} 218 | iOSLaunchScreenBackgroundColor: 219 | serializedVersion: 2 220 | rgba: 0 221 | iOSLaunchScreenFillPct: 100 222 | iOSLaunchScreenSize: 100 223 | iOSLaunchScreenCustomXibPath: 224 | iOSLaunchScreeniPadType: 0 225 | iOSLaunchScreeniPadImage: {fileID: 0} 226 | iOSLaunchScreeniPadBackgroundColor: 227 | serializedVersion: 2 228 | rgba: 0 229 | iOSLaunchScreeniPadFillPct: 100 230 | iOSLaunchScreeniPadSize: 100 231 | iOSLaunchScreeniPadCustomXibPath: 232 | iOSUseLaunchScreenStoryboard: 0 233 | iOSLaunchScreenCustomStoryboardPath: 234 | iOSDeviceRequirements: [] 235 | iOSURLSchemes: [] 236 | iOSBackgroundModes: 0 237 | iOSMetalForceHardShadows: 0 238 | metalEditorSupport: 1 239 | metalAPIValidation: 1 240 | iOSRenderExtraFrameOnPause: 0 241 | appleDeveloperTeamID: 242 | iOSManualSigningProvisioningProfileID: 243 | tvOSManualSigningProvisioningProfileID: 244 | iOSManualSigningProvisioningProfileType: 0 245 | tvOSManualSigningProvisioningProfileType: 0 246 | appleEnableAutomaticSigning: 0 247 | iOSRequireARKit: 0 248 | iOSAutomaticallyDetectAndAddCapabilities: 1 249 | appleEnableProMotion: 0 250 | clonedFromGUID: 00000000000000000000000000000000 251 | templatePackageId: 252 | templateDefaultScene: 253 | AndroidTargetArchitectures: 5 254 | AndroidSplashScreenScale: 0 255 | androidSplashScreen: {fileID: 0} 256 | AndroidKeystoreName: '{inproject}: ' 257 | AndroidKeyaliasName: 258 | AndroidBuildApkPerCpuArchitecture: 0 259 | AndroidTVCompatibility: 1 260 | AndroidIsGame: 1 261 | AndroidEnableTango: 0 262 | androidEnableBanner: 1 263 | androidUseLowAccuracyLocation: 0 264 | androidUseCustomKeystore: 0 265 | m_AndroidBanners: 266 | - width: 320 267 | height: 180 268 | banner: {fileID: 0} 269 | androidGamepadSupportLevel: 0 270 | resolutionDialogBanner: {fileID: 0} 271 | m_BuildTargetIcons: [] 272 | m_BuildTargetPlatformIcons: [] 273 | m_BuildTargetBatching: [] 274 | m_BuildTargetGraphicsAPIs: [] 275 | m_BuildTargetVRSettings: [] 276 | m_BuildTargetEnableVuforiaSettings: [] 277 | openGLRequireES31: 0 278 | openGLRequireES31AEP: 0 279 | openGLRequireES32: 0 280 | m_TemplateCustomTags: {} 281 | mobileMTRendering: 282 | Android: 1 283 | iPhone: 1 284 | tvOS: 1 285 | m_BuildTargetGroupLightmapEncodingQuality: 286 | - m_BuildTarget: Standalone 287 | m_EncodingQuality: 1 288 | - m_BuildTarget: XboxOne 289 | m_EncodingQuality: 1 290 | - m_BuildTarget: PS4 291 | m_EncodingQuality: 1 292 | m_BuildTargetGroupLightmapSettings: [] 293 | playModeTestRunnerEnabled: 0 294 | runPlayModeTestAsEditModeTest: 0 295 | actionOnDotNetUnhandledException: 1 296 | enableInternalProfiler: 0 297 | logObjCUncaughtExceptions: 1 298 | enableCrashReportAPI: 0 299 | cameraUsageDescription: 300 | locationUsageDescription: 301 | microphoneUsageDescription: 302 | switchNetLibKey: 303 | switchSocketMemoryPoolSize: 6144 304 | switchSocketAllocatorPoolSize: 128 305 | switchSocketConcurrencyLimit: 14 306 | switchScreenResolutionBehavior: 2 307 | switchUseCPUProfiler: 0 308 | switchApplicationID: 0x01004b9000490000 309 | switchNSODependencies: 310 | switchTitleNames_0: 311 | switchTitleNames_1: 312 | switchTitleNames_2: 313 | switchTitleNames_3: 314 | switchTitleNames_4: 315 | switchTitleNames_5: 316 | switchTitleNames_6: 317 | switchTitleNames_7: 318 | switchTitleNames_8: 319 | switchTitleNames_9: 320 | switchTitleNames_10: 321 | switchTitleNames_11: 322 | switchTitleNames_12: 323 | switchTitleNames_13: 324 | switchTitleNames_14: 325 | switchPublisherNames_0: 326 | switchPublisherNames_1: 327 | switchPublisherNames_2: 328 | switchPublisherNames_3: 329 | switchPublisherNames_4: 330 | switchPublisherNames_5: 331 | switchPublisherNames_6: 332 | switchPublisherNames_7: 333 | switchPublisherNames_8: 334 | switchPublisherNames_9: 335 | switchPublisherNames_10: 336 | switchPublisherNames_11: 337 | switchPublisherNames_12: 338 | switchPublisherNames_13: 339 | switchPublisherNames_14: 340 | switchIcons_0: {fileID: 0} 341 | switchIcons_1: {fileID: 0} 342 | switchIcons_2: {fileID: 0} 343 | switchIcons_3: {fileID: 0} 344 | switchIcons_4: {fileID: 0} 345 | switchIcons_5: {fileID: 0} 346 | switchIcons_6: {fileID: 0} 347 | switchIcons_7: {fileID: 0} 348 | switchIcons_8: {fileID: 0} 349 | switchIcons_9: {fileID: 0} 350 | switchIcons_10: {fileID: 0} 351 | switchIcons_11: {fileID: 0} 352 | switchIcons_12: {fileID: 0} 353 | switchIcons_13: {fileID: 0} 354 | switchIcons_14: {fileID: 0} 355 | switchSmallIcons_0: {fileID: 0} 356 | switchSmallIcons_1: {fileID: 0} 357 | switchSmallIcons_2: {fileID: 0} 358 | switchSmallIcons_3: {fileID: 0} 359 | switchSmallIcons_4: {fileID: 0} 360 | switchSmallIcons_5: {fileID: 0} 361 | switchSmallIcons_6: {fileID: 0} 362 | switchSmallIcons_7: {fileID: 0} 363 | switchSmallIcons_8: {fileID: 0} 364 | switchSmallIcons_9: {fileID: 0} 365 | switchSmallIcons_10: {fileID: 0} 366 | switchSmallIcons_11: {fileID: 0} 367 | switchSmallIcons_12: {fileID: 0} 368 | switchSmallIcons_13: {fileID: 0} 369 | switchSmallIcons_14: {fileID: 0} 370 | switchManualHTML: 371 | switchAccessibleURLs: 372 | switchLegalInformation: 373 | switchMainThreadStackSize: 1048576 374 | switchPresenceGroupId: 375 | switchLogoHandling: 0 376 | switchReleaseVersion: 0 377 | switchDisplayVersion: 1.0.0 378 | switchStartupUserAccount: 0 379 | switchTouchScreenUsage: 0 380 | switchSupportedLanguagesMask: 0 381 | switchLogoType: 0 382 | switchApplicationErrorCodeCategory: 383 | switchUserAccountSaveDataSize: 0 384 | switchUserAccountSaveDataJournalSize: 0 385 | switchApplicationAttribute: 0 386 | switchCardSpecSize: -1 387 | switchCardSpecClock: -1 388 | switchRatingsMask: 0 389 | switchRatingsInt_0: 0 390 | switchRatingsInt_1: 0 391 | switchRatingsInt_2: 0 392 | switchRatingsInt_3: 0 393 | switchRatingsInt_4: 0 394 | switchRatingsInt_5: 0 395 | switchRatingsInt_6: 0 396 | switchRatingsInt_7: 0 397 | switchRatingsInt_8: 0 398 | switchRatingsInt_9: 0 399 | switchRatingsInt_10: 0 400 | switchRatingsInt_11: 0 401 | switchLocalCommunicationIds_0: 402 | switchLocalCommunicationIds_1: 403 | switchLocalCommunicationIds_2: 404 | switchLocalCommunicationIds_3: 405 | switchLocalCommunicationIds_4: 406 | switchLocalCommunicationIds_5: 407 | switchLocalCommunicationIds_6: 408 | switchLocalCommunicationIds_7: 409 | switchParentalControl: 0 410 | switchAllowsScreenshot: 1 411 | switchAllowsVideoCapturing: 1 412 | switchAllowsRuntimeAddOnContentInstall: 0 413 | switchDataLossConfirmation: 0 414 | switchUserAccountLockEnabled: 0 415 | switchSystemResourceMemory: 16777216 416 | switchSupportedNpadStyles: 3 417 | switchNativeFsCacheSize: 32 418 | switchIsHoldTypeHorizontal: 0 419 | switchSupportedNpadCount: 8 420 | switchSocketConfigEnabled: 0 421 | switchTcpInitialSendBufferSize: 32 422 | switchTcpInitialReceiveBufferSize: 64 423 | switchTcpAutoSendBufferSizeMax: 256 424 | switchTcpAutoReceiveBufferSizeMax: 256 425 | switchUdpSendBufferSize: 9 426 | switchUdpReceiveBufferSize: 42 427 | switchSocketBufferEfficiency: 4 428 | switchSocketInitializeEnabled: 1 429 | switchNetworkInterfaceManagerInitializeEnabled: 1 430 | switchPlayerConnectionEnabled: 1 431 | ps4NPAgeRating: 12 432 | ps4NPTitleSecret: 433 | ps4NPTrophyPackPath: 434 | ps4ParentalLevel: 11 435 | ps4ContentID: ED1633-NPXX51362_00-0000000000000000 436 | ps4Category: 0 437 | ps4MasterVersion: 01.00 438 | ps4AppVersion: 01.00 439 | ps4AppType: 0 440 | ps4ParamSfxPath: 441 | ps4VideoOutPixelFormat: 0 442 | ps4VideoOutInitialWidth: 1920 443 | ps4VideoOutBaseModeInitialWidth: 1920 444 | ps4VideoOutReprojectionRate: 60 445 | ps4PronunciationXMLPath: 446 | ps4PronunciationSIGPath: 447 | ps4BackgroundImagePath: 448 | ps4StartupImagePath: 449 | ps4StartupImagesFolder: 450 | ps4IconImagesFolder: 451 | ps4SaveDataImagePath: 452 | ps4SdkOverride: 453 | ps4BGMPath: 454 | ps4ShareFilePath: 455 | ps4ShareOverlayImagePath: 456 | ps4PrivacyGuardImagePath: 457 | ps4NPtitleDatPath: 458 | ps4RemotePlayKeyAssignment: -1 459 | ps4RemotePlayKeyMappingDir: 460 | ps4PlayTogetherPlayerCount: 0 461 | ps4EnterButtonAssignment: 1 462 | ps4ApplicationParam1: 0 463 | ps4ApplicationParam2: 0 464 | ps4ApplicationParam3: 0 465 | ps4ApplicationParam4: 0 466 | ps4DownloadDataSize: 0 467 | ps4GarlicHeapSize: 2048 468 | ps4ProGarlicHeapSize: 2560 469 | playerPrefsMaxSize: 32768 470 | ps4Passcode: frAQBc8Wsa1xVPfvJcrgRYwTiizs2trQ 471 | ps4pnSessions: 1 472 | ps4pnPresence: 1 473 | ps4pnFriends: 1 474 | ps4pnGameCustomData: 1 475 | playerPrefsSupport: 0 476 | enableApplicationExit: 0 477 | resetTempFolder: 1 478 | restrictedAudioUsageRights: 0 479 | ps4UseResolutionFallback: 0 480 | ps4ReprojectionSupport: 0 481 | ps4UseAudio3dBackend: 0 482 | ps4SocialScreenEnabled: 0 483 | ps4ScriptOptimizationLevel: 0 484 | ps4Audio3dVirtualSpeakerCount: 14 485 | ps4attribCpuUsage: 0 486 | ps4PatchPkgPath: 487 | ps4PatchLatestPkgPath: 488 | ps4PatchChangeinfoPath: 489 | ps4PatchDayOne: 0 490 | ps4attribUserManagement: 0 491 | ps4attribMoveSupport: 0 492 | ps4attrib3DSupport: 0 493 | ps4attribShareSupport: 0 494 | ps4attribExclusiveVR: 0 495 | ps4disableAutoHideSplash: 0 496 | ps4videoRecordingFeaturesUsed: 0 497 | ps4contentSearchFeaturesUsed: 0 498 | ps4attribEyeToEyeDistanceSettingVR: 0 499 | ps4IncludedModules: [] 500 | monoEnv: 501 | splashScreenBackgroundSourceLandscape: {fileID: 0} 502 | splashScreenBackgroundSourcePortrait: {fileID: 0} 503 | spritePackerPolicy: 504 | webGLMemorySize: 256 505 | webGLExceptionSupport: 1 506 | webGLNameFilesAsHashes: 0 507 | webGLDataCaching: 0 508 | webGLDebugSymbols: 0 509 | webGLEmscriptenArgs: 510 | webGLModulesDirectory: 511 | webGLTemplate: APPLICATION:Default 512 | webGLAnalyzeBuildSize: 0 513 | webGLUseEmbeddedResources: 0 514 | webGLCompressionFormat: 1 515 | webGLLinkerTarget: 1 516 | webGLThreadsSupport: 0 517 | webGLWasmStreaming: 0 518 | scriptingDefineSymbols: 519 | 1: UNITY_POST_PROCESSING_STACK_V2 520 | 4: UNITY_POST_PROCESSING_STACK_V2 521 | 7: UNITY_POST_PROCESSING_STACK_V2 522 | 13: UNITY_POST_PROCESSING_STACK_V2 523 | 14: UNITY_POST_PROCESSING_STACK_V2 524 | 19: UNITY_POST_PROCESSING_STACK_V2 525 | 21: UNITY_POST_PROCESSING_STACK_V2 526 | 25: UNITY_POST_PROCESSING_STACK_V2 527 | 26: UNITY_POST_PROCESSING_STACK_V2 528 | 27: UNITY_POST_PROCESSING_STACK_V2 529 | 28: UNITY_POST_PROCESSING_STACK_V2 530 | platformArchitecture: {} 531 | scriptingBackend: {} 532 | il2cppCompilerConfiguration: {} 533 | managedStrippingLevel: {} 534 | incrementalIl2cppBuild: {} 535 | allowUnsafeCode: 0 536 | additionalIl2CppArgs: 537 | scriptingRuntimeVersion: 0 538 | gcIncremental: 0 539 | gcWBarrierValidation: 0 540 | apiCompatibilityLevelPerPlatform: {} 541 | m_RenderingPath: 1 542 | m_MobileRenderingPath: 1 543 | metroPackageName: Tools 544 | metroPackageVersion: 545 | metroCertificatePath: 546 | metroCertificatePassword: 547 | metroCertificateSubject: 548 | metroCertificateIssuer: 549 | metroCertificateNotAfter: 0000000000000000 550 | metroApplicationDescription: Tools 551 | wsaImages: {} 552 | metroTileShortName: 553 | metroTileShowName: 0 554 | metroMediumTileShowName: 0 555 | metroLargeTileShowName: 0 556 | metroWideTileShowName: 0 557 | metroSupportStreamingInstall: 0 558 | metroLastRequiredScene: 0 559 | metroDefaultTileSize: 1 560 | metroTileForegroundText: 2 561 | metroTileBackgroundColor: {r: 0.13333334, g: 0.17254902, b: 0.21568628, a: 0} 562 | metroSplashScreenBackgroundColor: {r: 0.12941177, g: 0.17254902, b: 0.21568628, 563 | a: 1} 564 | metroSplashScreenUseBackgroundColor: 0 565 | platformCapabilities: {} 566 | metroTargetDeviceFamilies: {} 567 | metroFTAName: 568 | metroFTAFileTypes: [] 569 | metroProtocolName: 570 | XboxOneProductId: 571 | XboxOneUpdateKey: 572 | XboxOneSandboxId: 573 | XboxOneContentId: 574 | XboxOneTitleId: 575 | XboxOneSCId: 576 | XboxOneGameOsOverridePath: 577 | XboxOnePackagingOverridePath: 578 | XboxOneAppManifestOverridePath: 579 | XboxOneVersion: 1.0.0.0 580 | XboxOnePackageEncryption: 0 581 | XboxOnePackageUpdateGranularity: 2 582 | XboxOneDescription: 583 | XboxOneLanguage: 584 | - enus 585 | XboxOneCapability: [] 586 | XboxOneGameRating: {} 587 | XboxOneIsContentPackage: 0 588 | XboxOneEnableGPUVariability: 0 589 | XboxOneSockets: {} 590 | XboxOneSplashScreen: {fileID: 0} 591 | XboxOneAllowedProductIds: [] 592 | XboxOnePersistentLocalStorageSize: 0 593 | XboxOneXTitleMemory: 8 594 | xboxOneScriptCompiler: 0 595 | XboxOneOverrideIdentityName: 596 | vrEditorSettings: 597 | daydream: 598 | daydreamIconForeground: {fileID: 0} 599 | daydreamIconBackground: {fileID: 0} 600 | cloudServicesEnabled: {} 601 | luminIcon: 602 | m_Name: 603 | m_ModelFolderPath: 604 | m_PortalFolderPath: 605 | luminCert: 606 | m_CertPath: 607 | m_SignPackage: 1 608 | luminIsChannelApp: 0 609 | luminVersion: 610 | m_VersionCode: 1 611 | m_VersionName: 612 | facebookSdkVersion: 7.9.4 613 | facebookAppId: 614 | facebookCookies: 1 615 | facebookLogging: 1 616 | facebookStatus: 1 617 | facebookXfbml: 0 618 | facebookFrictionlessRequests: 1 619 | apiCompatibilityLevel: 2 620 | cloudProjectId: 621 | framebufferDepthMemorylessMode: 0 622 | projectName: 623 | organizationId: 624 | cloudEnabled: 0 625 | enableNativePlatformBackendsForNewInputSystem: 0 626 | disableOldInputManagerSupport: 0 627 | legacyClampBlendShapeWeights: 1 628 | -------------------------------------------------------------------------------- /Tools/Assets/Draw2DCollision/Editor/PointsEditor.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEditor; 5 | 6 | [CustomEditor(typeof(Points))] 7 | public class PointsEditor : Editor 8 | { 9 | private int? mouseOverPoint; 10 | private int rightClickPoint; 11 | private int rightClickPath; 12 | private bool dragging; 13 | private int currentPath = 0; 14 | private float height = 200; 15 | private float collapseHeight = 155; 16 | private float expandedHeight = 245; 17 | private float width = 210; 18 | 19 | private Color handleColor = Color.cyan; 20 | private Color lineColor = Color.white; 21 | private Color unselectedColor = Color.white; 22 | private float handleSize = 0.1f; 23 | private bool edit = true; 24 | private bool autoBuild = true; 25 | private bool showControls = true; 26 | 27 | private SceneView view; 28 | private bool locked = false; 29 | private bool is2D = false; 30 | 31 | private bool showPositionSetting = false; 32 | private Vector2 positionSettingStart; 33 | 34 | [MenuItem("GameObject/2D Object/Points", false)] 35 | public static void Create() 36 | { 37 | GameObject go = new GameObject("Points"); 38 | go.AddComponent(); 39 | Selection.activeGameObject = go; 40 | } 41 | 42 | public override void OnInspectorGUI() 43 | { 44 | //base.OnInspectorGUI(); 45 | EditorGUILayout.ObjectField("Script", MonoScript.FromMonoBehaviour((Points)target), typeof(Points), false); 46 | } 47 | 48 | private void OnEnable() 49 | { 50 | locked = false; 51 | } 52 | 53 | private void OnDisable() 54 | { 55 | if (view) 56 | view.in2DMode = is2D; 57 | } 58 | 59 | public void OnSceneGUI() 60 | { 61 | Event e = Event.current; 62 | if (e.type == EventType.Layout) 63 | HandleUtility.AddDefaultControl(GUIUtility.GetControlID(FocusType.Passive)); 64 | 65 | #region Set SceneView Settings 66 | SceneView currentView = SceneView.currentDrawingSceneView; 67 | if (view != currentView || !locked) 68 | { 69 | is2D = currentView.in2DMode; 70 | currentView.in2DMode = true; 71 | view = currentView; 72 | locked = true; 73 | } 74 | #endregion 75 | 76 | Points points = (Points)target; 77 | 78 | #region Determine Global Settings 79 | if (points.useGlobal) 80 | { 81 | if (!points.settings) 82 | points.settings = (PointsSettings)Resources.Load("PointsSettings", typeof(PointsSettings)); 83 | 84 | if (!points.settings) 85 | { 86 | Handles.BeginGUI(); 87 | GUI.Box(new Rect(5, 5, width + 10, height + 10), ""); 88 | GUILayout.BeginArea(new Rect(10, 10, width, height)); 89 | 90 | GUILayout.Label("Points Settings", EditorStyles.boldLabel); 91 | 92 | if (GUILayout.Button("Create Global Settings")) 93 | { 94 | string path = EditorUtility.SaveFolderPanel("Choose a folder", "", ""); 95 | string relative = path.Replace(Application.dataPath, "Assets"); 96 | if (AssetDatabase.IsValidFolder(relative)) 97 | { 98 | points.settings = CreateInstance(); 99 | AssetDatabase.CreateAsset(points.settings, relative + "/PointsSettings.asset"); 100 | } 101 | } 102 | 103 | if (GUILayout.Button("Locate Global Settings")) 104 | { 105 | string path = EditorUtility.OpenFilePanel("Find Points Settings", "", "asset"); 106 | string relative = path.Replace(Application.dataPath, "Assets"); 107 | points.settings = (PointsSettings)AssetDatabase.LoadAssetAtPath(relative, typeof(PointsSettings)); 108 | 109 | if (!points.settings) 110 | Debug.LogError("Invalid File"); 111 | } 112 | 113 | GUILayout.EndArea(); 114 | Handles.EndGUI(); 115 | 116 | return; 117 | } 118 | } 119 | #endregion 120 | 121 | Ray mouseRay = HandleUtility.GUIPointToWorldRay(e.mousePosition); 122 | float drawPlaneHeight = 0; 123 | float dstToDrawPlane = (drawPlaneHeight - mouseRay.origin.z) / mouseRay.direction.z; 124 | Vector3 mousePosition = mouseRay.GetPoint(dstToDrawPlane); 125 | 126 | if (e.type == EventType.Repaint && edit) 127 | Draw(mousePosition); 128 | else 129 | { 130 | Input(e, mousePosition); 131 | HandleUtility.Repaint(); 132 | } 133 | 134 | #region Control Window 135 | autoBuild = points.useGlobal ? points.settings.autoBuild : points.autoBuild; 136 | edit = points.useGlobal ? points.settings.edit : points.edit; 137 | 138 | Handles.BeginGUI(); 139 | GUI.Box(new Rect(5, 5, width + 10, height + 10), CreateTexture((int)width + 10, (int)height + 10, new Color(1,1,1,.75f))); 140 | GUI.contentColor = Color.black; 141 | GUI.backgroundColor = Color.white; 142 | GUILayout.BeginArea(new Rect(10, 10, width, height)); 143 | 144 | GUILayout.BeginHorizontal(); 145 | GUILayout.Label("Points Settings", EditorStyles.boldLabel); 146 | string str = points.useGlobal ? "Global" : "Local"; 147 | 148 | GUI.contentColor = Color.white; 149 | if (GUILayout.Button(str)) 150 | { 151 | points.useGlobal = !points.useGlobal; 152 | return; 153 | } 154 | GUILayout.EndHorizontal(); 155 | 156 | GUI.contentColor = Color.black; 157 | GUILayout.BeginHorizontal(); 158 | GUILayout.Label("Edit", GUILayout.Width(80)); 159 | if(!points.useGlobal) 160 | points.edit = EditorGUILayout.Toggle(points.edit); 161 | else 162 | points.settings.edit = EditorGUILayout.Toggle(points.settings.edit); 163 | GUILayout.EndHorizontal(); 164 | 165 | GUILayout.BeginHorizontal(); 166 | GUILayout.Label("Auto Build", GUILayout.Width(80)); 167 | if(!points.useGlobal) 168 | points.autoBuild = EditorGUILayout.Toggle(points.autoBuild, GUILayout.Width(30)); 169 | else 170 | points.settings.autoBuild = EditorGUILayout.Toggle(points.settings.autoBuild, GUILayout.Width(30)); 171 | if (!autoBuild) 172 | { 173 | GUI.contentColor = Color.white; 174 | if (GUILayout.Button("Build")) 175 | points.BuildCollider(); 176 | GUI.contentColor = Color.black; 177 | } 178 | GUILayout.EndHorizontal(); 179 | 180 | GUILayout.BeginHorizontal(); 181 | GUILayout.Label("Handle Size", GUILayout.Width(80)); 182 | if (!points.useGlobal) 183 | points.handleSize = GUILayout.HorizontalSlider(points.handleSize, 0, 1, GUILayout.Width(width - 85)); 184 | else 185 | points.settings.handleSize = GUILayout.HorizontalSlider(points.settings.handleSize, points.settings.handleRange.x, points.settings.handleRange.y, GUILayout.Width(width - 85)); 186 | GUILayout.EndHorizontal(); 187 | 188 | GUILayout.BeginHorizontal(); 189 | GUILayout.Label("Handle Color", GUILayout.Width(80)); 190 | if (!points.useGlobal) 191 | points.handleColor = EditorGUILayout.ColorField(points.handleColor); 192 | else 193 | points.settings.handleColor = EditorGUILayout.ColorField(points.settings.handleColor); 194 | GUILayout.EndHorizontal(); 195 | 196 | GUILayout.BeginHorizontal(); 197 | GUILayout.Label("Line Color", GUILayout.Width(80)); 198 | if (!points.useGlobal) 199 | points.lineColor = EditorGUILayout.ColorField(points.lineColor); 200 | else 201 | points.settings.lineColor = EditorGUILayout.ColorField(points.settings.lineColor); 202 | GUILayout.EndHorizontal(); 203 | 204 | GUILayout.BeginHorizontal(); 205 | GUILayout.Label("Default Color", GUILayout.Width(80)); 206 | if (!points.useGlobal) 207 | points.unselectedColor = EditorGUILayout.ColorField(points.unselectedColor); 208 | else 209 | points.settings.unselectedColor = EditorGUILayout.ColorField(points.settings.unselectedColor); 210 | GUILayout.EndHorizontal(); 211 | 212 | GUILayout.Space(5); 213 | 214 | if (!points.useGlobal) 215 | points.showControls = EditorGUILayout.Foldout(points.showControls, "Controls"); 216 | else 217 | points.settings.showControls = EditorGUILayout.Foldout(points.settings.showControls, "Controls", true); 218 | showControls = points.useGlobal ? points.settings.showControls : points.showControls; 219 | if (showControls) 220 | { 221 | GUILayout.Label("Shift + Left Click = Add Point"); 222 | GUILayout.Label("Control + Left Click = Delete Point"); 223 | GUILayout.Label("Left Click + Drag = Move Point"); 224 | GUILayout.Label("Shift + Right Click = Add Path"); 225 | GUILayout.Label("Control + Right Click = Delete Path"); 226 | height = expandedHeight; 227 | } 228 | else 229 | height = collapseHeight; 230 | 231 | GUILayout.EndArea(); 232 | Handles.EndGUI(); 233 | #endregion 234 | 235 | #region Position Popup Settings 236 | if (showPositionSetting) 237 | { 238 | Handles.BeginGUI(); 239 | 240 | Vector3 pos = points.paths[currentPath].points[rightClickPoint]; 241 | pos.x = points.paths[currentPath].points[rightClickPoint].x + handleSize; 242 | Vector2 v2 = HandleUtility.WorldToGUIPoint(pos); 243 | 244 | GUI.DrawTexture(new Rect(v2.x + 5, v2.y - 15f, 260, 25), CreateTexture(215, 25, handleColor)); 245 | 246 | GUILayout.BeginArea(new Rect(v2.x + 10, v2.y - 10f, 250, 20)); 247 | 248 | EditorGUILayout.BeginHorizontal(); 249 | 250 | float x = points.paths[currentPath].points[rightClickPoint].x; 251 | float y = points.paths[currentPath].points[rightClickPoint].y; 252 | 253 | Color textColor = new Color(); 254 | if (handleColor.r < 0.5f && handleColor.g < 0.5f && handleColor.b < 0.5f) 255 | textColor = Color.white; 256 | else 257 | textColor = Color.black; 258 | 259 | GUISkin skin = (GUISkin)Resources.Load("2DCollisionSkin", typeof(GUISkin)); 260 | GUIStyle labelStyle = new GUIStyle(skin.GetStyle("label")); 261 | GUIStyle textStyle = new GUIStyle(skin.GetStyle("textField")); 262 | 263 | EditorGUI.BeginChangeCheck(); 264 | 265 | GUI.contentColor = textColor; 266 | EditorGUILayout.LabelField("x", labelStyle, GUILayout.Width(15)); 267 | GUI.contentColor = Color.white; 268 | x = EditorGUILayout.FloatField(x); 269 | GUI.contentColor = textColor; 270 | EditorGUILayout.LabelField("y", labelStyle, GUILayout.Width(15)); 271 | GUI.contentColor = Color.white; 272 | y = EditorGUILayout.FloatField(y); 273 | points.paths[currentPath].points[rightClickPoint] = new Vector3(x, y); 274 | 275 | if (GUI.changed) 276 | { 277 | if (autoBuild) 278 | points.BuildCollider(); 279 | } 280 | 281 | EditorGUILayout.EndHorizontal(); 282 | 283 | GUILayout.EndArea(); 284 | 285 | Handles.EndGUI(); 286 | } 287 | #endregion 288 | } 289 | 290 | private void Draw(Vector3 mouse) 291 | { 292 | Points points = (Points)target; 293 | 294 | mouseOverPoint = null; 295 | 296 | handleSize = points.useGlobal ? points.settings.handleSize : points.handleSize; 297 | lineColor = points.useGlobal ? points.settings.lineColor : points.lineColor; 298 | handleColor = points.useGlobal ? points.settings.handleColor : points.handleColor; 299 | unselectedColor = points.useGlobal ? points.settings.unselectedColor : points.unselectedColor; 300 | 301 | #region Draw Lines 302 | for (int i = 0; i < points.paths.Count; i++) 303 | { 304 | if (i == currentPath) 305 | Handles.color = lineColor; 306 | else 307 | Handles.color = unselectedColor; 308 | 309 | for (int j = 0; j < points.paths[i].points.Count; j++) 310 | { 311 | Vector3 p1 = new Vector3(points.paths[i].points[j].x, points.paths[i].points[j].y, points.paths[i].points[j].z); 312 | Vector3 p2 = Vector2.zero; 313 | if (j > 0) 314 | p2 = new Vector3(points.paths[i].points[j - 1].x, points.paths[i].points[j - 1].y, points.paths[i].points[j - 1].z); 315 | else 316 | p2 = new Vector3(points.paths[i].points[points.paths[i].points.Count - 1].x, points.paths[i].points[points.paths[i].points.Count - 1].y, 317 | points.paths[i].points[points.paths[i].points.Count - 1].z); 318 | Handles.DrawLine(p1, p2); 319 | } 320 | } 321 | #endregion 322 | 323 | #region Draw Points 324 | for (int i = 0; i < points.paths.Count; i++) 325 | { 326 | if (i == currentPath) 327 | Handles.color = handleColor; 328 | else 329 | Handles.color = unselectedColor; 330 | 331 | for (int j = 0; j < points.paths[i].points.Count; j++) 332 | { 333 | Handles.DrawSolidDisc(points.paths[i].points[j], Vector3.back, handleSize); 334 | if (MouseOver(mouse, points.paths[i].points[j])) 335 | { 336 | mouseOverPoint = j; 337 | currentPath = i; 338 | } 339 | } 340 | } 341 | #endregion 342 | 343 | if (mouseOverPoint == null) 344 | dragging = false; 345 | 346 | if (currentPath != rightClickPath) 347 | showPositionSetting = false; 348 | } 349 | 350 | private void Input(Event e, Vector3 mouse) 351 | { 352 | Points points = (Points)target; 353 | Rect rect = new Rect(5, 5, width + 10, height + 10); 354 | 355 | #region Input while over point 356 | if (!rect.Contains(e.mousePosition) && mouseOverPoint != null) 357 | { 358 | if (mouseOverPoint != null) 359 | { 360 | if (dragging) 361 | { 362 | Undo.RecordObject(points, "Point Moved"); 363 | points.paths[currentPath].points[(int)mouseOverPoint] = mouse; 364 | if (autoBuild) 365 | points.BuildCollider(); 366 | } 367 | 368 | if (e.type == EventType.MouseDown && e.button == 0 && e.modifiers != EventModifiers.Shift) 369 | { 370 | if (e.modifiers != EventModifiers.Control) 371 | dragging = true; 372 | } 373 | 374 | if (e.type == EventType.MouseUp && e.button == 0) 375 | dragging = false; 376 | 377 | if (e.type == EventType.MouseDown && e.button == 0 && e.modifiers == EventModifiers.Control) 378 | { 379 | Undo.RecordObject(points, "Point Removed"); 380 | points.paths[currentPath].points.RemoveAt((int)mouseOverPoint); 381 | if (autoBuild) 382 | points.BuildCollider(); 383 | } 384 | 385 | if (e.type == EventType.MouseDown && e.button == 1 && e.modifiers != EventModifiers.Control) 386 | { 387 | positionSettingStart = e.mousePosition; 388 | 389 | GenericMenu menu = new GenericMenu(); 390 | menu.AddItem(new GUIContent("Set Position"), false, Callback, 1); 391 | 392 | string str = showPositionSetting ? "Close" : "Cancel"; 393 | menu.AddItem(new GUIContent(str), false, Callback, 2); 394 | menu.ShowAsContext(); 395 | } 396 | 397 | if (e.type == EventType.MouseDown && e.button == 1 && e.modifiers == EventModifiers.Control) 398 | { 399 | Undo.RecordObject(points, "Remove Path"); 400 | points.RemovePath(currentPath); 401 | if (autoBuild) 402 | points.BuildCollider(); 403 | } 404 | 405 | if (e.type == EventType.MouseDown) 406 | { 407 | if ((int)mouseOverPoint != rightClickPoint) 408 | showPositionSetting = false; 409 | } 410 | } 411 | } 412 | #endregion 413 | 414 | #region Input while not over point 415 | if (!rect.Contains(e.mousePosition) && mouseOverPoint == null) 416 | { 417 | if (e.type == EventType.MouseDown && e.button == 0 && e.modifiers == EventModifiers.Shift) 418 | { 419 | handleSize = points.useGlobal ? points.settings.handleSize : points.handleSize; 420 | 421 | float closestLine = handleSize; 422 | int index = -1; 423 | Vector2 m2 = new Vector2(mouse.x, mouse.y); 424 | for (int i = 0; i < points.paths.Count; i++) 425 | { 426 | for (int j = 0; j < points.paths[i].points.Count; j++) 427 | { 428 | Vector2 p1 = new Vector2(points.paths[i].points[j].x, points.paths[i].points[j].y); 429 | Vector2 p2 = Vector2.zero; 430 | if (j > 0) 431 | p2 = new Vector2(points.paths[i].points[j-1].x, points.paths[i].points[j-1].y); 432 | else 433 | p2 = new Vector2(points.paths[i].points[points.paths[i].points.Count - 1].x, points.paths[i].points[points.paths[i].points.Count - 1].y); 434 | 435 | float dist = HandleUtility.DistancePointToLineSegment(m2, p1, p2); 436 | 437 | if (dist < closestLine) 438 | { 439 | closestLine = dist; 440 | index = j; 441 | } 442 | } 443 | } 444 | 445 | Undo.RecordObject(points, "Add Point"); 446 | 447 | if (index > -1) 448 | points.InsertPoint(m2, index, currentPath); 449 | else 450 | points.AddPoint(m2, currentPath); 451 | 452 | SceneView.RepaintAll(); 453 | if(autoBuild) 454 | points.BuildCollider(); 455 | } 456 | 457 | if (e.type == EventType.MouseDown && e.button == 1 && e.modifiers == EventModifiers.Shift) 458 | { 459 | Undo.RecordObject(points, "Add Path"); 460 | points.AddPath(); 461 | currentPath = points.paths.Count - 1; 462 | points.AddPoint(mouse, currentPath); 463 | if (autoBuild) 464 | points.BuildCollider(); 465 | } 466 | } 467 | #endregion 468 | } 469 | 470 | #region Utility Methods 471 | private void Callback(object obj) 472 | { 473 | Points points = (Points)target; 474 | // Do something 475 | switch ((int)obj) 476 | { 477 | case 1: 478 | rightClickPoint = (int)mouseOverPoint; 479 | rightClickPath = currentPath; 480 | showPositionSetting = true; 481 | break; 482 | case 2: 483 | showPositionSetting = false; 484 | break; 485 | default: 486 | break; 487 | } 488 | } 489 | 490 | private Texture2D CreateTexture(int width, int height, Color col) 491 | { 492 | Color[] pixels = new Color[width * height]; 493 | for (int i = 0; i < pixels.Length; ++i) 494 | { 495 | pixels[i] = col; 496 | } 497 | Texture2D result = new Texture2D(width, height); 498 | result.SetPixels(pixels); 499 | result.Apply(); 500 | return result; 501 | } 502 | 503 | private bool MouseOver(Vector3 mouse, Vector3 pos) 504 | { 505 | Points points = (Points)target; 506 | 507 | bool x = false; 508 | bool y = false; 509 | 510 | if (mouse.x > pos.x - handleSize && mouse.x < pos.x + handleSize) 511 | x = true; 512 | if (mouse.y > pos.y - handleSize && mouse.y < pos.y + handleSize) 513 | y = true; 514 | 515 | if (x && y) 516 | return true; 517 | else 518 | return false; 519 | } 520 | #endregion 521 | } -------------------------------------------------------------------------------- /Tools/Assets/SpriteEditor/Editor/SpriteEditorWindow.cs: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Author: Jeff Harper 4 | Twitter: @jeffdevsitall 5 | Website: jeffharper.games 6 | 7 | Copyright (c) 2019 by Jeff Harper 8 | 9 | Permission is hereby granted, free of charge, to any person obtaining a copy 10 | of this software and associated documentation files (the "Software"), to deal 11 | in the Software without restriction, including without limitation the rights 12 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | copies of the Software, and to permit persons to whom the Software is 14 | furnished to do so, subject to the following conditions: 15 | 16 | The above copyright notice and this permission notice shall be included in all 17 | copies or substantial portions of the Software. 18 | 19 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 25 | SOFTWARE. 26 | 27 | */ 28 | 29 | using System.Collections.Generic; 30 | using UnityEngine; 31 | using UnityEditor; 32 | using System.Linq; 33 | using UnityEditorInternal; 34 | using System.IO; 35 | 36 | public class SpriteEditorWindow : EditorWindow 37 | { 38 | #region Variables 39 | private int tab = 0; 40 | public List sprites = new List(); 41 | private bool powerOf4 = true; 42 | private bool autoSplice = true; 43 | private bool placeInScene = false; 44 | private SpriteImportMode mode = SpriteImportMode.Single; 45 | private bool showBackground; 46 | private string[] convertMaxSize = new string[] { "32", "64", "128", "256", "512", "1024", "2048", "4096", "8192" }; 47 | private int size = 6; 48 | private TextureImporterCompression compressionQuality = TextureImporterCompression.Compressed; 49 | private bool useCrunch = true; 50 | private int quality = 50; 51 | private bool alreadyPower4; 52 | private bool updateMode = true; 53 | private ReorderableList list; 54 | private bool dragging; 55 | private bool showList = true; 56 | private int splitSize = 6; 57 | private TextureImporterType splitImporterType = TextureImporterType.Sprite; 58 | private bool useImportSettings = true; 59 | private bool createSplitFolder = true; 60 | #endregion 61 | 62 | [MenuItem("Tools/Sprite Editor")] 63 | public static void LaunchSpriteEditor() 64 | { 65 | SpriteEditorWindow window = GetWindow(); 66 | window.Show(); 67 | } 68 | 69 | private void OnEnable() 70 | { 71 | DrawList(); 72 | } 73 | 74 | private void DrawList() 75 | { 76 | SerializedObject so = new SerializedObject(this); 77 | list = new ReorderableList(so, so.FindProperty("sprites"), true, false, false, true); 78 | 79 | list.drawElementCallback = 80 | (Rect rect, int index, bool isActive, bool isFocused) => { 81 | var element = list.serializedProperty.GetArrayElementAtIndex(index); 82 | EditorGUI.ObjectField(new Rect(rect.x, rect.y, rect.width / 3, EditorGUIUtility.singleLineHeight), element, GUIContent.none); 83 | if (sprites[index]) 84 | { 85 | string label = sprites[index].width + "px X " + sprites[index].height + "px"; 86 | EditorGUI.LabelField(new Rect(rect.x + rect.width / 3 + 50, rect.y, rect.width / 3 - 50, EditorGUIUtility.singleLineHeight), label); 87 | if (GUI.Button(new Rect(rect.x + ((rect.width / 3) * 2 + 100), rect.y, rect.width / 3 - 100, EditorGUIUtility.singleLineHeight), "Focus")) 88 | Selection.activeObject = sprites[index]; 89 | } 90 | }; 91 | 92 | list.onRemoveCallback = (ReorderableList removeList) => 93 | { 94 | sprites.RemoveAt(removeList.index); 95 | ReorderableList.defaultBehaviours.DoRemoveButton(removeList); 96 | DrawList(); 97 | }; 98 | } 99 | 100 | private void OnGUI() 101 | { 102 | if (!dragging) 103 | { 104 | int previousTab = tab; 105 | tab = GUILayout.Toolbar(tab, new string[] { "Single", "Batch" }); 106 | if (tab == 0) 107 | DisplaySingle(); 108 | else 109 | { 110 | if (previousTab != tab) 111 | DrawList(); 112 | DisplayBatch(); 113 | } 114 | } 115 | else 116 | { 117 | GUILayout.BeginArea(new Rect(0, position.height / 2 - 50, position.width, 100)); 118 | GUIStyle style = new GUIStyle(); 119 | style.fontSize = 50; 120 | style.alignment = TextAnchor.MiddleCenter; 121 | GUILayout.Label("Drop Textures or Folder To Add", style); 122 | GUILayout.EndArea(); 123 | } 124 | 125 | var e = Event.current.type; 126 | if (e == EventType.DragUpdated) 127 | { 128 | dragging = true; 129 | Vector2 mouse = GUIUtility.GUIToScreenPoint(Event.current.mousePosition); 130 | if (position.Contains(mouse)) 131 | { 132 | DragAndDrop.visualMode = DragAndDropVisualMode.Copy; 133 | Event.current.Use(); 134 | } 135 | } 136 | else if (e == EventType.DragPerform) 137 | { 138 | DragAndDrop.AcceptDrag(); 139 | for (int i = 0; i < DragAndDrop.objectReferences.Length; i++) 140 | { 141 | Object obj = DragAndDrop.objectReferences[i]; 142 | if (obj.GetType() == typeof(Texture2D)) 143 | { 144 | if (tab != 0) 145 | { 146 | bool missing = false; 147 | for (int j = 0; j < sprites.Count; j++) 148 | { 149 | if (!sprites[j]) 150 | { 151 | sprites[j] = (Texture2D)obj; 152 | missing = true; 153 | break; 154 | } 155 | } 156 | if (!sprites.Contains((Texture2D)obj) && !missing) 157 | sprites.Add((Texture2D)obj); 158 | } 159 | else 160 | { 161 | sprites[0] = (Texture2D)obj; 162 | break; 163 | } 164 | } 165 | else 166 | { 167 | if (obj.GetType() == typeof(DefaultAsset)) 168 | { 169 | string path = DragAndDrop.paths[i]; 170 | string[] guids = AssetDatabase.FindAssets("t:Texture2D", new string[] { path }); 171 | for (int j = 0; j < guids.Length; j++) 172 | { 173 | Texture2D tex = (Texture2D)AssetDatabase.LoadAssetAtPath(AssetDatabase.GUIDToAssetPath(guids[j]), typeof(Texture2D)); 174 | if (!sprites.Contains(tex)) 175 | sprites.Add(tex); 176 | } 177 | } 178 | } 179 | } 180 | DrawList(); 181 | dragging = false; 182 | Event.current.Use(); 183 | } 184 | else if (e == EventType.DragExited) 185 | { 186 | dragging = false; 187 | } 188 | } 189 | 190 | private void DisplaySingle() 191 | { 192 | // make sure the list is not empty 193 | // if so add null sprite 194 | if (sprites.Count == 0) 195 | sprites.Add(null); 196 | 197 | 198 | EditorGUILayout.BeginHorizontal(); 199 | 200 | // begin left column for variables and properties 201 | EditorGUILayout.BeginVertical(GUILayout.Width(position.width / 2)); 202 | // start horizontal row 203 | EditorGUILayout.BeginHorizontal(); 204 | // label for sprite 205 | EditorGUILayout.LabelField("Sprite", GUILayout.Width(130)); 206 | // display the sprite object for the 0 index 207 | sprites[0] = (Texture2D)EditorGUILayout.ObjectField(sprites[0], typeof(Texture2D), true); 208 | if (sprites[0]) 209 | { 210 | if (GUILayout.Button("Focus", GUILayout.Width(60))) 211 | Selection.activeObject = sprites[0]; 212 | } 213 | // end horizontal row 214 | EditorGUILayout.EndHorizontal(); 215 | 216 | if (!sprites[0]) 217 | return; 218 | 219 | TextureImporter importer = (TextureImporter)TextureImporter.GetAtPath(AssetDatabase.GetAssetPath(sprites[0])); 220 | 221 | // start horizontal row 222 | EditorGUILayout.BeginHorizontal(); 223 | // label for sprite 224 | EditorGUILayout.LabelField("Show Checkers", GUILayout.Width(130)); 225 | // toggle for power of 4 226 | showBackground = EditorGUILayout.Toggle(showBackground, GUILayout.Width(40)); 227 | // end horizontal row 228 | EditorGUILayout.EndHorizontal(); 229 | 230 | if (sprites[0].width % 4 == 0 && sprites[0].height % 4 == 0) 231 | alreadyPower4 = true; 232 | else 233 | alreadyPower4 = false; 234 | 235 | if (!alreadyPower4) 236 | { 237 | // start horizontal row 238 | EditorGUILayout.BeginHorizontal(); 239 | // label for sprite 240 | EditorGUILayout.LabelField("Power of 4", GUILayout.Width(130)); 241 | // toggle for power of 4 242 | powerOf4 = EditorGUILayout.Toggle(powerOf4, GUILayout.Width(40)); 243 | if (powerOf4) 244 | { 245 | EditorGUILayout.LabelField("Adds white space to make both width and height divisible by 4"); 246 | if (GUILayout.Button("Apply")) 247 | { 248 | MakePowerOf4(sprites[0]); 249 | } 250 | } 251 | // end horizontal row 252 | EditorGUILayout.EndHorizontal(); 253 | } 254 | 255 | EditorGUILayout.Space(); 256 | 257 | EditorGUILayout.LabelField("Sprite Mode Settings", EditorStyles.boldLabel); 258 | 259 | // start horizontal row 260 | EditorGUILayout.BeginHorizontal(); 261 | // label for sprite mode 262 | EditorGUILayout.LabelField("Sprite Mode", GUILayout.Width(130)); 263 | // enum popup for sprite mode 264 | mode = (SpriteImportMode)EditorGUILayout.EnumPopup(mode); 265 | // end horizontal row 266 | EditorGUILayout.EndHorizontal(); 267 | 268 | // start horizontal row 269 | EditorGUILayout.BeginHorizontal(); 270 | EditorGUILayout.LabelField("", GUILayout.Width(130)); 271 | if (mode != importer.spriteImportMode) 272 | { 273 | if (GUILayout.Button("Convert")) 274 | { 275 | importer.spriteImportMode = mode; 276 | importer.SaveAndReimport(); 277 | } 278 | } 279 | else 280 | { 281 | if (mode == SpriteImportMode.Multiple) 282 | { 283 | /* 284 | if (GUILayout.Button("Launch Sprite Editor")) 285 | { 286 | Selection.activeObject = sprites[0]; 287 | EditorWindow.GetWindow(typeof(EditorWindow).Assembly.GetTypes().Where(t => t.Name == "SpriteEditorWindow").FirstOrDefault()); 288 | } 289 | */ 290 | 291 | if (GUILayout.Button("Generate Multiple Sprites")) 292 | GenerateMultiple(sprites[0]); 293 | 294 | if (GUILayout.Button("Layout")) 295 | PlaceInScene(sprites[0]); 296 | } 297 | } 298 | 299 | // end horizontal row 300 | EditorGUILayout.EndHorizontal(); 301 | 302 | EditorGUILayout.Space(); 303 | 304 | EditorGUILayout.LabelField("Import Settings", EditorStyles.boldLabel); 305 | 306 | // start horizontal row 307 | EditorGUILayout.BeginHorizontal(); 308 | // label for max size 309 | EditorGUILayout.LabelField("Max Size", GUILayout.Width(130)); 310 | size = EditorGUILayout.Popup(size, convertMaxSize); 311 | if (int.Parse(convertMaxSize[size]) != importer.maxTextureSize) 312 | { 313 | if (GUILayout.Button("Apply")) 314 | { 315 | importer.maxTextureSize = int.Parse(convertMaxSize[size]); 316 | importer.SaveAndReimport(); 317 | AssetDatabase.Refresh(); 318 | } 319 | } 320 | // end horizontal row 321 | EditorGUILayout.EndHorizontal(); 322 | 323 | // start horizontal row 324 | EditorGUILayout.BeginHorizontal(); 325 | // label for max size 326 | EditorGUILayout.LabelField("Compression", GUILayout.Width(130)); 327 | if (powerOf4 || alreadyPower4) 328 | { 329 | compressionQuality = (TextureImporterCompression)EditorGUILayout.EnumPopup(compressionQuality); 330 | if (compressionQuality != importer.textureCompression) 331 | { 332 | if (GUILayout.Button("Apply")) 333 | { 334 | importer.textureCompression = compressionQuality; 335 | importer.SaveAndReimport(); 336 | AssetDatabase.Refresh(); 337 | } 338 | } 339 | } 340 | else 341 | EditorGUILayout.LabelField("Must be power of 4"); 342 | // end horizontal row 343 | EditorGUILayout.EndHorizontal(); 344 | 345 | // start horizontal row 346 | EditorGUILayout.BeginHorizontal(); 347 | // label for max size 348 | EditorGUILayout.LabelField("Crunch Compression", GUILayout.Width(130)); 349 | if (powerOf4 || alreadyPower4) 350 | { 351 | useCrunch = EditorGUILayout.Toggle(useCrunch); 352 | if (useCrunch != importer.crunchedCompression) 353 | { 354 | if (GUILayout.Button("Apply")) 355 | { 356 | importer.crunchedCompression = useCrunch; 357 | importer.SaveAndReimport(); 358 | AssetDatabase.Refresh(); 359 | } 360 | } 361 | } 362 | else 363 | EditorGUILayout.LabelField("Must be power of 4"); 364 | // end horizontal row 365 | EditorGUILayout.EndHorizontal(); 366 | 367 | if (useCrunch || importer.crunchedCompression) 368 | { 369 | // start horizontal row 370 | EditorGUILayout.BeginHorizontal(); 371 | // label for max size 372 | EditorGUILayout.LabelField("Compressor Quality", GUILayout.Width(130)); 373 | if (powerOf4 || alreadyPower4) 374 | { 375 | quality = EditorGUILayout.IntSlider(quality, 0, 100); 376 | if (quality != importer.compressionQuality) 377 | { 378 | if (GUILayout.Button("Apply")) 379 | { 380 | importer.compressionQuality = quality; 381 | importer.SaveAndReimport(); 382 | AssetDatabase.Refresh(); 383 | } 384 | } 385 | } 386 | else 387 | EditorGUILayout.LabelField("Must be power of 4"); 388 | // end horizontal row 389 | EditorGUILayout.EndHorizontal(); 390 | } 391 | 392 | bool changed = false; 393 | if (quality != importer.compressionQuality) 394 | { 395 | changed = true; 396 | } 397 | else if (useCrunch != importer.crunchedCompression) 398 | { 399 | changed = true; 400 | } 401 | else if (compressionQuality != importer.textureCompression) 402 | { 403 | changed = true; 404 | } 405 | else if (int.Parse(convertMaxSize[size]) != importer.maxTextureSize) 406 | { 407 | changed = true; 408 | } 409 | 410 | // start horizontal row 411 | EditorGUILayout.BeginHorizontal(); 412 | EditorGUILayout.LabelField("", GUILayout.Width(130)); 413 | GUI.enabled = changed; 414 | if (GUILayout.Button("Revert All")) 415 | { 416 | quality = importer.compressionQuality; 417 | useCrunch = importer.crunchedCompression; 418 | compressionQuality = importer.textureCompression; 419 | for (int i = 0; i < convertMaxSize.Length; i++) 420 | { 421 | if (int.Parse(convertMaxSize[i]) == importer.maxTextureSize) 422 | size = i; 423 | } 424 | } 425 | 426 | if (GUILayout.Button("Apply All")) 427 | { 428 | importer.compressionQuality = quality; 429 | importer.crunchedCompression = useCrunch; 430 | importer.textureCompression = compressionQuality; 431 | importer.compressionQuality = quality; 432 | importer.maxTextureSize = int.Parse(convertMaxSize[size]); 433 | importer.SaveAndReimport(); 434 | AssetDatabase.Refresh(); 435 | } 436 | 437 | GUI.enabled = true; 438 | // end horizontal row 439 | EditorGUILayout.EndHorizontal(); 440 | 441 | 442 | GUILayout.Space(20); 443 | EditorGUILayout.LabelField("Split Settings", EditorStyles.boldLabel); 444 | 445 | // start horizontal row 446 | EditorGUILayout.BeginHorizontal(); 447 | // label for max size 448 | EditorGUILayout.LabelField("Max Size", GUILayout.Width(130)); 449 | splitSize = EditorGUILayout.Popup(splitSize, convertMaxSize); 450 | // end horizontal row 451 | EditorGUILayout.EndHorizontal(); 452 | 453 | EditorGUILayout.BeginHorizontal(); 454 | EditorGUILayout.LabelField("Texture Type", GUILayout.Width(130)); 455 | splitImporterType = (TextureImporterType)EditorGUILayout.EnumPopup(splitImporterType); 456 | EditorGUILayout.EndHorizontal(); 457 | 458 | EditorGUILayout.BeginHorizontal(); 459 | EditorGUILayout.LabelField("Use Import Settings", GUILayout.Width(130)); 460 | useImportSettings = EditorGUILayout.Toggle(useImportSettings); 461 | EditorGUILayout.EndHorizontal(); 462 | 463 | EditorGUILayout.BeginHorizontal(); 464 | EditorGUILayout.LabelField("Create folder", GUILayout.Width(130)); 465 | createSplitFolder = EditorGUILayout.Toggle(createSplitFolder); 466 | EditorGUILayout.EndHorizontal(); 467 | 468 | EditorGUILayout.BeginHorizontal(); 469 | EditorGUILayout.LabelField("", GUILayout.Width(130)); 470 | if (GUILayout.Button("Apply")) 471 | SplitSprite(sprites[0]); 472 | EditorGUILayout.EndHorizontal(); 473 | 474 | // end vertical column 475 | EditorGUILayout.EndVertical(); 476 | 477 | Rect rect = EditorGUILayout.BeginVertical(GUILayout.Width(position.width / 2)); 478 | 479 | Texture2D tex = sprites[0]; 480 | float width = tex.width; 481 | float height = tex.height; 482 | 483 | if (width > height) 484 | { 485 | width = width < (position.width / 2) - 130 ? width : (position.width / 2) - 130; 486 | float ratio = width / tex.width; 487 | height = height * ratio; 488 | } 489 | else 490 | { 491 | height = height < (position.height - 130) ? height : (position.height - 130); 492 | float ratio = height / tex.height; 493 | width = width * ratio; 494 | } 495 | 496 | float texWidth = tex.width; 497 | float texHeight = tex.height; 498 | if (powerOf4) 499 | { 500 | while (texWidth % 4 != 0) 501 | { 502 | texWidth++; 503 | } 504 | 505 | while (texHeight % 4 != 0) 506 | { 507 | texHeight++; 508 | } 509 | } 510 | 511 | // draw texture 512 | if(showBackground) 513 | EditorGUI.DrawTextureTransparent(new Rect(rect.x + 5, rect.y + 5, width, height), tex); 514 | else 515 | GUI.DrawTexture(new Rect(rect.x + 5, rect.y + 5, width, height), tex); 516 | 517 | GUIStyle style = new GUIStyle(); 518 | float w = style.CalcSize(new GUIContent(texWidth + "px")).x; 519 | float lineW = (width - w) / 2.0f; 520 | 521 | GUI.DrawTexture(new Rect(rect.x + 5, rect.y + height + 10, lineW - 5, 2), CreateTexture(2, 2, Color.black)); 522 | GUI.Label(new Rect(rect.x + 5 + (width / 2) - (w / 2), rect.y + height + 12 - 7.5f, w + 5, 15), texWidth + "px"); 523 | GUI.DrawTexture(new Rect(rect.x + 5 + w + lineW + 5, rect.y + height + 10, lineW - 5, 2), CreateTexture(2, 2, Color.black)); 524 | 525 | Vector2 h = style.CalcSize(new GUIContent(texHeight + "px")); 526 | float lineH = (height - h.y) / 2.0f; 527 | 528 | GUI.DrawTexture(new Rect(rect.x + 10 + width, rect.y + 5, 2, lineH - 5), CreateTexture(2, 2, Color.black)); 529 | GUI.Label(new Rect(rect.x + 5 + width, rect.y + (height / 2) - (h.y/2) + 5, h.x + 5, h.y + 5), texHeight + "px"); 530 | GUI.DrawTexture(new Rect(rect.x + 10 + width, rect.y + 5 + h.y + lineH + 5, 2, lineH - 5), CreateTexture(2, 2, Color.black)); 531 | 532 | EditorGUILayout.EndVertical(); 533 | 534 | EditorGUILayout.EndHorizontal(); 535 | } 536 | 537 | private void DisplayBatch() 538 | { 539 | SerializedObject so = new SerializedObject(this); 540 | so.Update(); 541 | 542 | EditorGUILayout.BeginHorizontal(); 543 | showList = EditorGUILayout.Foldout(showList, "Textures", true); 544 | if (GUILayout.Button("Clear Textures", GUILayout.Width(100))) 545 | { 546 | sprites.Clear(); 547 | DrawList(); 548 | } 549 | EditorGUILayout.EndHorizontal(); 550 | if (showList) 551 | { 552 | EditorGUILayout.Space(); 553 | list.DoLayoutList(); 554 | } 555 | 556 | EditorGUILayout.BeginHorizontal(); 557 | EditorGUILayout.PrefixLabel("Sprite Mode"); 558 | updateMode = EditorGUILayout.Toggle(updateMode, GUILayout.Width(40)); 559 | if(updateMode) 560 | mode = (SpriteImportMode)EditorGUILayout.EnumPopup(mode); 561 | EditorGUILayout.EndHorizontal(); 562 | 563 | if (mode == SpriteImportMode.Multiple) 564 | { 565 | EditorGUILayout.BeginHorizontal(); 566 | EditorGUILayout.PrefixLabel("Auto Splice"); 567 | autoSplice = EditorGUILayout.Toggle(autoSplice, GUILayout.Width(40)); 568 | if (autoSplice) 569 | EditorGUILayout.LabelField("Caution! This will override any existing splices."); 570 | EditorGUILayout.EndHorizontal(); 571 | } 572 | 573 | 574 | EditorGUILayout.BeginHorizontal(); 575 | EditorGUILayout.PrefixLabel("Power of 4"); 576 | powerOf4 = EditorGUILayout.Toggle(powerOf4, GUILayout.Width(40)); 577 | if (powerOf4) 578 | EditorGUILayout.LabelField("Adds white space to make both width and height divisible by 4."); 579 | EditorGUILayout.EndHorizontal(); 580 | 581 | placeInScene = EditorGUILayout.Toggle("Layout In Scene", placeInScene); 582 | 583 | size = EditorGUILayout.Popup("Max Size", size, convertMaxSize); 584 | 585 | compressionQuality = (TextureImporterCompression)EditorGUILayout.EnumPopup("Compression", compressionQuality); 586 | useCrunch = EditorGUILayout.Toggle("Crunch Compression", useCrunch); 587 | quality = EditorGUILayout.IntSlider("Compressor Quality", quality, 0, 100); 588 | 589 | if (GUILayout.Button("Convert")) 590 | { 591 | for (int i = 0; i < sprites.Count; i++) 592 | { 593 | if (powerOf4) 594 | MakePowerOf4(sprites[i]); 595 | if (mode == SpriteImportMode.Multiple && autoSplice) 596 | GenerateMultiple(sprites[i]); 597 | 598 | UpdateSettings(sprites[i]); 599 | 600 | if (placeInScene) 601 | PlaceInScene(sprites[i]); 602 | } 603 | 604 | AssetDatabase.Refresh(); 605 | } 606 | 607 | so.ApplyModifiedProperties(); 608 | } 609 | 610 | private Texture2D CreateTexture(int width, int height, Color col) 611 | { 612 | Color[] pixels = new Color[width * height]; 613 | for (int i = 0; i < pixels.Length; ++i) 614 | { 615 | pixels[i] = col; 616 | } 617 | Texture2D result = new Texture2D(width, height); 618 | result.SetPixels(pixels); 619 | result.Apply(); 620 | return result; 621 | } 622 | 623 | private void MakePowerOf4(Texture2D tex) 624 | { 625 | string texPath = AssetDatabase.GetAssetPath(tex); 626 | TextureImporter importer = (TextureImporter)AssetImporter.GetAtPath(texPath); 627 | 628 | bool crunch = importer.crunchedCompression = false; 629 | TextureImporterCompression compression = importer.textureCompression; 630 | bool readable = importer.isReadable; 631 | 632 | importer.crunchedCompression = false; 633 | importer.textureCompression = TextureImporterCompression.Uncompressed; 634 | importer.isReadable = true; 635 | importer.SaveAndReimport(); 636 | 637 | int width = tex.width; 638 | int height = tex.height; 639 | 640 | while (width % 4 != 0) 641 | { 642 | width++; 643 | } 644 | 645 | while (height % 4 != 0) 646 | { 647 | height++; 648 | } 649 | 650 | Texture2D newTex = new Texture2D(width, height); 651 | 652 | for (int x = 0; x < width; x++) 653 | { 654 | for (int y = 0; y < height; y++) 655 | { 656 | newTex.SetPixel(x, y, new Color(0, 0, 0, 0)); 657 | } 658 | } 659 | 660 | for (int x = 0; x < tex.width; x++) 661 | { 662 | for (int y = 0; y < tex.height; y++) 663 | { 664 | Color col = tex.GetPixel(x, y); 665 | newTex.SetPixel(x, y, col); 666 | } 667 | } 668 | 669 | newTex.Apply(); 670 | 671 | string path = AssetDatabase.GetAssetPath(tex); 672 | string absolutePath = Application.dataPath + "/" + path.Replace("Assets/", ""); 673 | System.IO.File.WriteAllBytes(absolutePath, newTex.EncodeToPNG()); 674 | 675 | importer.crunchedCompression = crunch; 676 | importer.textureCompression = compression; 677 | importer.isReadable = readable; 678 | importer.SaveAndReimport(); 679 | 680 | AssetDatabase.Refresh(); 681 | } 682 | 683 | private void PlaceInScene(Texture2D tex) 684 | { 685 | //Texture2D tex = (Texture2D)objs[i]; 686 | string path = AssetDatabase.GetAssetPath(tex); 687 | Object[] sprites = AssetDatabase.LoadAllAssetsAtPath(path); 688 | TextureImporter importer = (TextureImporter)TextureImporter.GetAtPath(path); 689 | float pixels = importer.spritePixelsPerUnit; 690 | GameObject parent = new GameObject(tex.name); 691 | for (int j = 0; j < sprites.Length; j++) 692 | { 693 | if (sprites[j].GetType() == typeof(Sprite)) 694 | { 695 | Sprite sprite = (Sprite)sprites[j]; 696 | GameObject go = new GameObject(sprite.name); 697 | go.transform.parent = parent.transform; 698 | SpriteRenderer sr = go.AddComponent(); 699 | sr.sprite = sprite; 700 | Rect rect = sprite.rect; 701 | sr.transform.position = new Vector2((rect.x / pixels) - ((tex.width / 2) / pixels) + rect.width / pixels / 2, 702 | (rect.y / pixels) - ((tex.height / 2) / pixels) + rect.height / pixels / 2); 703 | } 704 | } 705 | } 706 | 707 | private void GenerateMultiple(Texture2D tex) 708 | { 709 | Debug.Log("Generate Multiple: " + tex.name); 710 | 711 | TextureImporter importer = (TextureImporter)TextureImporter.GetAtPath(AssetDatabase.GetAssetPath(tex)); 712 | TextureImporterCompression compression = importer.textureCompression; 713 | bool readable = importer.isReadable; 714 | 715 | importer.isReadable = true; 716 | importer.textureCompression = TextureImporterCompression.Uncompressed; 717 | importer.spriteImportMode = SpriteImportMode.Multiple; 718 | 719 | importer.SaveAndReimport(); 720 | AssetDatabase.Refresh(); 721 | 722 | int minimumSpriteSize = 16; 723 | int extrudeSize = 0; 724 | Rect[] rects = InternalSpriteUtility.GenerateAutomaticSpriteRectangles(tex, minimumSpriteSize, extrudeSize); 725 | 726 | List metas = new List(); 727 | int rectNum = 0; 728 | 729 | foreach (Rect r in rects) 730 | { 731 | SpriteMetaData meta = new SpriteMetaData(); 732 | meta.rect = r; 733 | meta.name = tex.name + "_" + rectNum++; 734 | Debug.Log(meta.name); 735 | metas.Add(meta); 736 | } 737 | 738 | importer.spritesheet = metas.ToArray(); 739 | //importer.SaveAndReimport(); 740 | //AssetDatabase.Refresh(); 741 | 742 | importer.textureCompression = compression; 743 | importer.isReadable = readable; 744 | importer.SaveAndReimport(); 745 | AssetDatabase.Refresh(); 746 | } 747 | 748 | private void UpdateSettings(Texture2D tex) 749 | { 750 | string texPath = AssetDatabase.GetAssetPath(tex); 751 | TextureImporter importer = (TextureImporter)AssetImporter.GetAtPath(texPath); 752 | 753 | if (updateMode) 754 | importer.spriteImportMode = mode; 755 | 756 | importer.maxTextureSize = int.Parse(convertMaxSize[size]); 757 | importer.textureCompression = compressionQuality; 758 | importer.crunchedCompression = useCrunch; 759 | importer.compressionQuality = quality; 760 | importer.SaveAndReimport(); 761 | } 762 | 763 | private void UpdateSettings(string path) 764 | { 765 | string texPath = path; 766 | TextureImporter importer = (TextureImporter)AssetImporter.GetAtPath(texPath); 767 | 768 | if (updateMode) 769 | importer.spriteImportMode = mode; 770 | 771 | importer.maxTextureSize = int.Parse(convertMaxSize[size]); 772 | importer.textureCompression = compressionQuality; 773 | importer.crunchedCompression = useCrunch; 774 | importer.compressionQuality = quality; 775 | importer.SaveAndReimport(); 776 | } 777 | 778 | private void SplitSprite(Texture2D tex) 779 | { 780 | string savePath = EditorUtility.OpenFolderPanel("Save Split Folder", "Assets", ""); 781 | Debug.Log(savePath); 782 | 783 | if (createSplitFolder) 784 | { 785 | savePath = savePath + "/" + sprites[0].name; 786 | Directory.CreateDirectory(savePath); 787 | } 788 | 789 | string texPath = AssetDatabase.GetAssetPath(tex); 790 | TextureImporter importer = (TextureImporter)AssetImporter.GetAtPath(texPath); 791 | importer.isReadable = true; 792 | importer.maxTextureSize = 8192; 793 | importer.textureCompression = TextureImporterCompression.Uncompressed; 794 | 795 | importer.SaveAndReimport(); 796 | 797 | int width = tex.width; 798 | int height = tex.height; 799 | 800 | int _size = int.Parse(convertMaxSize[splitSize]); 801 | 802 | int amountWidth = Mathf.CeilToInt((float)width / (float)_size); 803 | int amountHeight = Mathf.CeilToInt((float)height / (float)_size); 804 | 805 | Debug.Log(amountWidth + " / " + amountHeight); 806 | 807 | int x = 0; 808 | List rects = new List(); 809 | List pivots = new List(); 810 | for (int i = 0; i < amountWidth; i++) 811 | { 812 | int y = 0; 813 | for (int j = 0; j < amountHeight; j++) 814 | { 815 | float rectWidth = width - x >= _size ? _size : width - x; 816 | float rectHeight = height - y >= _size ? _size : height - y; 817 | Rect rect = new Rect(x, y, rectWidth, rectHeight); 818 | rects.Add(rect); 819 | y += _size; 820 | } 821 | x += _size; 822 | } 823 | 824 | Debug.Log(Application.dataPath); 825 | 826 | 827 | for (int i = 0; i < rects.Count; i++) 828 | { 829 | int w = (int)rects[i].width; 830 | int h = (int)rects[i].height; 831 | 832 | while (w % 4 != 0) 833 | w++; 834 | while (h % 4 != 0) 835 | h++; 836 | 837 | Vector2 pivot = new Vector2(); 838 | pivot.x -= rects[i].x / w; 839 | pivot.y -= rects[i].y / h; 840 | 841 | Texture2D newTex = new Texture2D(w, h); 842 | 843 | for (int j = 0; j < w; j++) 844 | { 845 | for (int k = 0; k < h; k++) 846 | { 847 | newTex.SetPixel(j, k, Color.clear); 848 | } 849 | } 850 | 851 | newTex.SetPixels(0, 0, (int)rects[i].width, (int)rects[i].height, tex.GetPixels((int)rects[i].x, (int)rects[i].y, (int)rects[i].width, (int)rects[i].height)); 852 | newTex.Apply(); 853 | string path = savePath + "/" + "texture" + i + ".png"; 854 | File.WriteAllBytes(path, newTex.EncodeToPNG()); 855 | string localPath = path.Replace(Application.dataPath, "Assets"); 856 | 857 | AssetDatabase.SaveAssets(); 858 | AssetDatabase.Refresh(); 859 | 860 | TextureImporter _importer = (TextureImporter)AssetImporter.GetAtPath(localPath); 861 | _importer.isReadable = true; 862 | //_importer.spriteImportMode = SpriteImportMode.Single; 863 | TextureImporterSettings settings = new TextureImporterSettings(); 864 | _importer.ReadTextureSettings(settings); 865 | settings.textureType = TextureImporterType.Default; 866 | settings.spriteMode = 1; 867 | settings.spriteAlignment = 9; 868 | settings.spritePivot = pivot; 869 | _importer.SetTextureSettings(settings); 870 | _importer.textureType = splitImporterType; 871 | _importer.spriteImportMode = SpriteImportMode.Single; 872 | _importer.SaveAndReimport(); 873 | 874 | if(useImportSettings) 875 | UpdateSettings(localPath); 876 | } 877 | 878 | AssetDatabase.SaveAssets(); 879 | AssetDatabase.Refresh(); 880 | 881 | } 882 | } --------------------------------------------------------------------------------