├── .gitignore ├── Assets ├── Scenes.meta ├── Scenes │ ├── Test.unity │ ├── Test.unity.meta │ ├── ui animation Sample Scene.unity │ └── ui animation Sample Scene.unity.meta ├── Scripts.meta ├── Scripts │ ├── 2D.meta │ ├── 2D │ │ ├── Camera.meta │ │ ├── Camera │ │ │ ├── PixelPerfectCamera.cs │ │ │ ├── PixelPerfectCamera.cs.meta │ │ │ ├── ScaleCamera.cs │ │ │ └── ScaleCamera.cs.meta │ │ ├── Colliders.meta │ │ ├── Colliders │ │ │ ├── ScreenEdgeColliders.cs │ │ │ └── ScreenEdgeColliders.cs.meta │ │ ├── Drawing.meta │ │ ├── Drawing │ │ │ ├── DrawLine2D.cs │ │ │ └── DrawLine2D.cs.meta │ │ ├── Follow2D.cs │ │ ├── Follow2D.cs.meta │ │ ├── Follow2DRigidbody.cs │ │ ├── Follow2DRigidbody.cs.meta │ │ ├── Geometry │ │ │ ├── Triangle2D.cs │ │ │ └── Triangle2D.cs.meta │ │ ├── Tilemaps.meta │ │ └── Tilemaps │ │ │ ├── Editor.meta │ │ │ ├── Editor │ │ │ ├── TilemapLayerHelper.cs │ │ │ └── TilemapLayerHelper.cs.meta │ │ │ ├── Icons.meta │ │ │ ├── Icons │ │ │ ├── .gitkeep │ │ │ ├── icon_DownArrow2.png │ │ │ ├── icon_UpArrow2.png │ │ │ ├── icon_tilemap.png │ │ │ └── icon_tilemap_disabled.png │ │ │ ├── RandomTiles.cs │ │ │ ├── RandomTiles.cs.meta │ │ │ ├── TileMapHierarchyHelper.cs │ │ │ └── TileMapHierarchyHelper.cs.meta │ ├── AssetBundles.meta │ ├── AssetBundles │ │ ├── AssetBundleLoader.cs │ │ └── AssetBundleLoader.cs.meta │ ├── Camera.meta │ ├── Camera │ │ ├── AutoResolution.cs │ │ ├── CameraShake.cs │ │ ├── CameraShake.cs.meta │ │ ├── CameraSwitcher.cs │ │ ├── CameraSwitcher.cs.meta │ │ ├── EditorCardboardCamera.cs │ │ ├── MarrtsSmoothedMouseLook.cs │ │ ├── MarrtsSmoothedMouseLook.cs.meta │ │ ├── MobileCamera.cs │ │ ├── PlayerMovement.cs │ │ ├── PlayerMovement.cs.meta │ │ ├── SimpleSmoothMouseLookNewInput.cs │ │ ├── SmoothMouseLook.cs │ │ ├── SmoothMouseLook.cs.meta │ │ ├── SmoothMouseLookAveraged.cs │ │ ├── SmoothMouseLookAveraged.cs.meta │ │ ├── WowCamera.cs │ │ ├── WowCamera.cs.meta │ │ ├── ZoomWithMouse.cs │ │ └── ZoomWithMouse.cs.meta │ ├── Docs.meta │ ├── Docs │ │ ├── Camera.meta │ │ ├── Camera │ │ │ ├── Camera_depthTextureMode.cs │ │ │ └── Camera_depthTextureMode.cs.meta │ │ ├── Graphics.meta │ │ ├── Graphics │ │ │ ├── Graphics_Blit.cs │ │ │ └── Graphics_Blit.cs.meta │ │ ├── Mesh.meta │ │ ├── Mesh │ │ │ ├── MeshExample.cs │ │ │ └── MeshExample.cs.meta │ │ ├── MonoBehaviour.meta │ │ ├── MonoBehaviour │ │ │ ├── MonoBehaviour_OnValidate.cs │ │ │ └── MonoBehaviour_OnValidate.cs.meta │ │ ├── README.md │ │ ├── README.md.meta │ │ ├── UnityEngine.meta │ │ └── UnityEngine │ │ │ ├── CanvasRenderMode.cs │ │ │ ├── CanvasRenderMode.cs.meta │ │ │ ├── CullingGroupExample.cs │ │ │ ├── CullingGroupExample.cs.meta │ │ │ └── NavMeshAgentExample.cs │ ├── Drawing.meta │ ├── Drawing │ │ ├── DrawLine.cs │ │ └── DrawLine.cs.meta │ ├── Editor.meta │ ├── Editor │ │ ├── AddDefineSymbols.cs │ │ ├── AddDefineSymbols.cs.meta │ │ ├── Animation.meta │ │ ├── Animation │ │ │ ├── LegacyAnimationCreator.meta │ │ │ └── LegacyAnimationCreator │ │ │ │ ├── LegacyAnimationCreator.cs │ │ │ │ └── LegacyAnimationCreator.cs.meta │ │ ├── BatchTools.meta │ │ ├── BatchTools │ │ │ ├── CopyGameObjectNames.cs │ │ │ ├── MassRenameChildren.cs │ │ │ ├── MassRenameChildren.cs.meta │ │ │ └── ReplaceCharacterInGameObjectNames.cs │ │ ├── BuildProcess.meta │ │ ├── BuildProcess │ │ │ ├── PostBuildCopyEmptyFolders.cs │ │ │ ├── PostProcessBuild.cs │ │ │ └── PostProcessBuild.cs.meta │ │ ├── ContextMenu.meta │ │ ├── ContextMenu │ │ │ ├── BoxColliderFitChildren.cs │ │ │ ├── BoxColliderFitChildren.cs.meta │ │ │ ├── CreateOutlineForPanelEditor.cs │ │ │ ├── CreateOutlineForPanelEditor.cs.meta │ │ │ ├── GetVideoAspectRatioEditor.cs │ │ │ ├── GetVideoAspectRatioEditor.cs.meta │ │ │ ├── SetBoxColliderToUI.cs │ │ │ └── SetBoxColliderToUI.cs.meta │ │ ├── CustomInspector │ │ │ ├── CustomRectTransformCopyInspector.cs │ │ │ ├── CustomRectTransformInspector.cs │ │ │ └── TransformEditor.cs │ │ ├── EditorShortCutKeys.cs │ │ ├── EditorShortCutKeys.cs.meta │ │ ├── GameObject.meta │ │ ├── GameObject │ │ │ ├── ResetTransform.cs │ │ │ └── ResetTransform.cs.meta │ │ ├── Gizmos.meta │ │ ├── Gizmos │ │ │ ├── DrawCameraFrustumGizmos.cs │ │ │ ├── DrawCameraFrustumGizmos.cs.meta │ │ │ ├── RendererBoundsGizmo.cs │ │ │ └── RendererBoundsGizmo.cs.meta │ │ ├── GridGenerator.meta │ │ ├── GridGenerator │ │ │ ├── Editor.meta │ │ │ ├── Editor │ │ │ │ ├── GridGeneratorEditor.cs │ │ │ │ └── GridGeneratorEditor.cs.meta │ │ │ ├── GridGenerator.cs │ │ │ └── GridGenerator.cs.meta │ │ ├── HelpLastRelease.cs │ │ ├── HelpLastRelease.cs.meta │ │ ├── Hierarchy.meta │ │ ├── Hierarchy │ │ │ ├── MoveAround.cs │ │ │ ├── MoveAround.cs.meta │ │ │ ├── UnparentMe.cs │ │ │ └── UnparentMe.cs.meta │ │ ├── ImageEffects.meta │ │ ├── ImageEffects │ │ │ ├── ColorCorrectionCurvesEditorLayers │ │ │ └── ColorCorrectionCurvesEditorLayers.meta │ │ ├── Importers │ │ │ └── AnimationClipListImporter.cs │ │ ├── Mesh.meta │ │ ├── Mesh │ │ │ ├── CreatePlane.cs │ │ │ ├── CreatePlane.cs.meta │ │ │ ├── MeshCombineWizard.cs │ │ │ └── MeshCombineWizard.cs.meta │ │ ├── README.md │ │ ├── README.md.meta │ │ ├── SetPivot.cs │ │ ├── SetPivot.cs.meta │ │ ├── SpriteBackgroundRemover.cs │ │ ├── SpriteBackgroundRemover.cs.meta │ │ ├── Tools.meta │ │ ├── Tools │ │ │ ├── ColorPickerWindow.cs │ │ │ ├── ColorPickerWindow.cs.meta │ │ │ ├── CompileTime.cs │ │ │ ├── CompileTime.cs.meta │ │ │ ├── CopyPasteHelper.cs │ │ │ ├── CopyPasteHelper.cs.meta │ │ │ ├── FindWhatButtonCallsMyMethod.cs │ │ │ ├── FindWhoReferencesThisGameObject.cs │ │ │ ├── GameViewGridOverlay.cs │ │ │ ├── GetSelectedMeshInfo.cs │ │ │ ├── GetSelectedMeshInfo.cs.meta │ │ │ ├── PasteScript.cs │ │ │ ├── PreciseOffsetEditor.cs │ │ │ ├── README.md │ │ │ ├── RectTransformCloner.cs │ │ │ ├── ReferenceImageViewer.cs │ │ │ ├── ReferenceImageViewer.cs.meta │ │ │ ├── ReferenceImageViewer2.cs │ │ │ ├── RendererTypeCounter.cs │ │ │ ├── SceneManagerWindow.cs │ │ │ ├── SceneManagerWindow.cs.meta │ │ │ ├── SceneSwitcherWindow.cs │ │ │ ├── SceneSwitcherWindow.cs.meta │ │ │ └── SelectAssetsByType.cs │ │ ├── UI.meta │ │ └── UI │ │ │ ├── CanvasScalerUtil.meta │ │ │ └── CanvasScalerUtil │ │ │ ├── CanvasScalerUtil.cs │ │ │ ├── CanvasScalerUtil.cs.meta │ │ │ ├── Editor.meta │ │ │ └── Editor │ │ │ ├── CanvasScalerUtilEditor.cs │ │ │ └── CanvasScalerUtilEditor.cs.meta │ ├── Extensions.meta │ ├── Extensions │ │ ├── MonoBehaviourExtensions.meta │ │ ├── MonoBehaviourExtensions │ │ │ ├── Example.meta │ │ │ ├── Example │ │ │ │ ├── MonoBehaviorExtensionsExample.cs │ │ │ │ └── MonoBehaviorExtensionsExample.cs.meta │ │ │ ├── MonoBehaviourExtensions.cs │ │ │ └── MonoBehaviourExtensions.cs.meta │ │ ├── StringExtensions.cs │ │ ├── TransformExtensions.cs │ │ ├── TransformExtensions.cs.meta │ │ ├── Vector2Extensions.cs │ │ └── Vector2Extensions.cs.meta │ ├── Helpers.meta │ ├── Helpers │ │ ├── Debug.meta │ │ ├── Debug │ │ │ ├── Timer.cs │ │ │ ├── Timer.cs.meta │ │ │ ├── WhoDisabledOrEnabled.cs │ │ │ └── WhoDisabledOrEnabled.cs.meta │ │ ├── DrawGLLine.cs │ │ ├── DrawGLLine.cs.meta │ │ ├── DrawRendererBounds.cs │ │ ├── DrawRendererBounds.cs.meta │ │ ├── Drawing.meta │ │ ├── Drawing │ │ │ ├── DrawCrossHair.cs │ │ │ └── DrawCrossHair.cs.meta │ │ ├── FPSCounter.cs │ │ ├── FPSCounter.cs.meta │ │ ├── FileSystem.meta │ │ ├── FileSystem │ │ │ ├── FileSystemWatch.cs │ │ │ ├── FileSystemWatch.cs.meta │ │ │ ├── OpenExternalFile.cs │ │ │ └── OpenExternalFile.cs.meta │ │ ├── Screenshot.meta │ │ ├── Screenshot │ │ │ ├── GrabDesktop.cs │ │ │ └── GrabDesktop.cs.meta │ │ ├── String.meta │ │ ├── String │ │ │ ├── StringOperationUtil.cs │ │ │ └── StringOperationUtil.cs.meta │ │ ├── Version.meta │ │ ├── Version │ │ │ ├── GetVersion.cs │ │ │ └── GetVersion.cs.meta │ │ └── Windows │ │ │ └── WindowAlwaysOnTop.cs │ ├── ImageEffects.meta │ ├── ImageEffects │ │ ├── GrayscaleLayers.cs │ │ ├── GrayscaleLayers.cs.meta │ │ └── SpriteColor.cs │ ├── Mesh.meta │ ├── Mesh │ │ ├── Metaball.cs │ │ └── Metaball.cs.meta │ ├── Misc.meta │ ├── Misc │ │ ├── Messaging.meta │ │ ├── Messaging │ │ │ ├── Callback.cs │ │ │ ├── Callback.cs.meta │ │ │ ├── Messenger.cs │ │ │ ├── Messenger.cs.meta │ │ │ ├── MessengerUnitTest.cs │ │ │ ├── MessengerUnitTest.cs.meta │ │ │ ├── README.md │ │ │ └── README.md.meta │ │ ├── MeteorRing.cs │ │ ├── MeteorRing.cs.meta │ │ ├── TexturePixels2Quads.cs │ │ └── TexturePixels2Quads.cs.meta │ ├── ObjectPooling │ │ ├── IPoolActions.cs │ │ ├── IPoolActions.cs.meta │ │ ├── Images │ │ │ ├── Initialization.PNG │ │ │ ├── PoolObject.PNG │ │ │ ├── PoolObjectLook.PNG │ │ │ └── SpawnObject.PNG │ │ ├── Pool.cs │ │ ├── Pool.cs.meta │ │ ├── PoolObject.cs │ │ ├── PoolObject.cs.meta │ │ ├── README.md │ │ └── README.md.meta │ ├── README.md │ ├── README.md.meta │ ├── Serialization.meta │ ├── Serialization │ │ ├── Color32Serializable.cs │ │ ├── Color32Serializable.cs.meta │ │ ├── ColorSerializable.cs │ │ ├── ColorSerializable.cs.meta │ │ ├── MeshSerializable.cs │ │ ├── MeshSerializable.cs.meta │ │ ├── QuaternionSerializable.cs │ │ ├── QuaternionSerializable.cs.meta │ │ ├── Vector2Serializable.cs │ │ ├── Vector2Serializable.cs.meta │ │ ├── Vector3Serializable.cs │ │ ├── Vector3Serializable.cs.meta │ │ ├── Vector4Serializable.cs │ │ └── Vector4Serializable.cs.meta │ ├── StandardAssets.meta │ ├── StandardAssets │ │ ├── Effects.meta │ │ └── Effects │ │ │ ├── ImageEffects.meta │ │ │ └── ImageEffects │ │ │ ├── Scripts.meta │ │ │ └── Scripts │ │ │ ├── ColorCorrectionCurvesLayers.cs │ │ │ └── ColorCorrectionCurvesLayers.cs.meta │ ├── Texture.meta │ ├── Texture │ │ ├── GradientTextureMaker.cs │ │ ├── GradientTextureMaker.cs.meta │ │ ├── WebCamDisplay.cs │ │ └── WebCamDisplay.cs.meta │ ├── Threading.meta │ ├── Threading │ │ ├── ThreadPoolTest.cs │ │ └── ThreadPoolTest.cs.meta │ ├── Tools.meta │ ├── Tools │ │ ├── TerrainTreeReplacer.cs │ │ └── TerrainTreeReplacer.cs.meta │ ├── UI.meta │ ├── UI │ │ ├── Animation.meta │ │ ├── Animation │ │ │ ├── GrowEffect.cs │ │ │ ├── GrowEffect.cs.meta │ │ │ ├── HelicopterGrowEffect.cs │ │ │ ├── HelicopterGrowEffect.cs.meta │ │ │ ├── ImageFade.cs │ │ │ ├── ImageFade.cs.meta │ │ │ ├── LerpFromOffset.cs │ │ │ ├── LerpFromOffset.cs.meta │ │ │ ├── Shared.meta │ │ │ └── Shared │ │ │ │ ├── Interpolation.cs │ │ │ │ └── Interpolation.cs.meta │ │ ├── SetSelected.cs │ │ └── SetSelected.cs.meta │ ├── Utilities.meta │ └── Utilities │ │ ├── GlobalVariables.cs │ │ ├── SaveUtility.cs │ │ ├── SaveUtility.cs.meta │ │ ├── Singleton.cs │ │ └── Singleton.cs.meta ├── Shaders.meta └── Shaders │ ├── 2D.meta │ ├── 2D │ ├── Debug.meta │ ├── Debug │ │ ├── HSVDebugger.shader │ │ └── HSVDebugger.shader.meta │ ├── Effects.meta │ ├── Effects │ │ ├── ColorCycle.shader │ │ ├── ColorCycle.shader.meta │ │ ├── Glow.shader │ │ ├── Glow.shader.meta │ │ ├── Highlight.shader │ │ ├── Highlight.shader.meta │ │ ├── ToonIce.shader │ │ ├── ToonIce.shader.meta │ │ ├── WireFrame.shader │ │ └── WireFrame.shader.meta │ ├── LineRenderer.meta │ ├── LineRenderer │ │ ├── Additive-ScrollingUV.shader │ │ ├── Additive-ScrollingUV.shader.meta │ │ └── LineRenderer_ClipStartEnd.shader │ ├── Patterns.meta │ ├── Patterns │ │ ├── CirclesPattern.shader │ │ ├── CirclesPattern.shader.meta │ │ ├── ScrollingFill.shader │ │ └── ScrollingFill.shader.meta │ ├── Special.meta │ ├── Special │ │ ├── RayMarching.shader │ │ └── RayMarching.shader.meta │ ├── Sprites.meta │ ├── Sprites │ │ ├── Chromakey.shader │ │ ├── Chromakey.shader.meta │ │ ├── Diffuse (2 Sided Light).shader │ │ ├── FlipBook.shader │ │ ├── FlipBook.shader.meta │ │ ├── HSBC.shader │ │ ├── HSBC.shader.meta │ │ ├── Outline2D.shader │ │ ├── Outline2D.shader.meta │ │ ├── Photoshop Blends.meta │ │ ├── Photoshop Blends │ │ │ ├── Photoshop_Blends.cs │ │ │ ├── Photoshop_Blends.cs.meta │ │ │ ├── photoshop_blends.shader │ │ │ └── photoshop_blends.shader.meta │ │ ├── Pixelation.shader │ │ ├── Pixelation.shader.meta │ │ ├── SpriteDropShadow.shader │ │ ├── SpriteDropShadow.shader.meta │ │ ├── SpriteHDRBloom.shader │ │ └── SpriteHDRBloom.shader.meta │ ├── UI.meta │ └── UI │ │ ├── UI_Always_On_Top.shader │ │ └── UI_Always_On_Top.shader.meta │ ├── 3D.meta │ ├── 3D │ ├── Debug.meta │ ├── Debug │ │ ├── DebugNormalsTangents.shader │ │ ├── DebugNormalsTangents.shader.meta │ │ ├── LerpColorNearToFarPlane.shader │ │ └── LerpColorNearToFarPlane.shader.meta │ ├── Effects.meta │ ├── Effects │ │ ├── Diffuse Stipple Transparency.shader │ │ ├── Standard Stipple Transparency.shader │ │ ├── Standard-SeeThroughWalls.shader │ │ ├── Standard-SeeThroughWalls.shader.meta │ │ ├── VerticalCameraDistanceFade.shader │ │ └── VerticalCameraDistanceFade.shader.meta │ ├── Reflection.meta │ ├── Reflection │ │ ├── Reflective.meta │ │ ├── Reflective │ │ │ ├── BumpedSpecularFresnel.shader │ │ │ └── BumpedSpecularFresnel.shader.meta │ │ ├── ReliefMapping.meta │ │ └── ReliefMapping │ │ │ ├── ReliefMapping.shader │ │ │ └── ReliefMapping.shader.meta │ ├── SkyBox.meta │ ├── SkyBox │ │ ├── Cubemap-Simple.shader │ │ └── Cubemap-Simple.shader.meta │ ├── Standard.meta │ ├── Standard │ │ ├── HueContrastSaturation.shader │ │ └── HueContrastSaturation.shader.meta │ ├── Terrain.meta │ ├── Terrain │ │ ├── Splatmask4Textures.shader │ │ ├── Splatmask4Textures.shader.meta │ │ ├── Trees.meta │ │ └── Trees │ │ │ ├── Unity-BillboardTree.shader │ │ │ └── Unity-BillboardTree.shader.meta │ ├── TextureMapping.meta │ ├── TextureMapping │ │ ├── Equirectangular.shader │ │ └── Equirectangular.shader.meta │ ├── Unlit.meta │ ├── Unlit │ │ ├── Reverse-DisIntegrate-Shader │ │ ├── Reverse-DisIntegrate-Shader.meta │ │ ├── UnlitDoubleSided.shader │ │ ├── UnlitDoubleSided.shader.meta │ │ ├── UnlitTransparentColor.shader │ │ ├── UnlitTransparentColor.shader.meta │ │ ├── UnlitTransparentColorGradient.shader │ │ └── UnlitTransparentColorGradient.shader.meta │ ├── Vertex.meta │ ├── Vertex │ │ ├── VertexColorMesh.shader │ │ └── VertexColorMesh.shader.meta │ ├── Water.meta │ └── Water │ │ ├── WaterBox.shader │ │ └── WaterBox.shader.meta │ ├── README.md │ └── README.md.meta ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── External ├── Logging │ └── LogcatNoActivity.bat └── README.md ├── LICENSE.md ├── Logos ├── Unity_Library_Black.png └── Unity_Library_White.png ├── Logs └── Packages-Update.log ├── README.md └── ScriptTemplates ├── 81a-C# Editor Script-NewEditorScript.cs.txt ├── 81b-C# Custom Editor Script-NewCustomEditorScript.cs.txt ├── 81c-C# Interface Script-NewInterfaceScript.cs.txt ├── 81d-C# Property Drawer Script-NewPropertyDrawerScript.cs.txt └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | ### Unity ### 2 | /[Ll]ibrary/ 3 | /[Tt]emp/ 4 | /[Oo]bj/ 5 | /[Bb]uild/ 6 | /[Bb]uilds/ 7 | /Assets/AssetStoreTools* 8 | 9 | # Visual Studio 2015 cache directory 10 | /.vs/ 11 | /.vscode/ 12 | 13 | # Autogenerated VS/MD/Consulo solution and project files 14 | ExportedObj/ 15 | .consulo/ 16 | *.csproj 17 | *.unityproj 18 | *.sln 19 | *.suo 20 | *.tmp 21 | *.user 22 | *.userprefs 23 | *.pidb 24 | *.booproj 25 | *.svd 26 | *.pdb 27 | 28 | # Unity3D generated meta files 29 | *.pidb.meta 30 | 31 | # Unity3D Generated File On Crash Reports 32 | sysinfo.txt 33 | 34 | # Builds 35 | *.apk 36 | *.unitypackage 37 | 38 | # OS Specific 39 | .DS_Store 40 | .DS_Store? 41 | ._* 42 | .Spotlight-V100 43 | .Trashes 44 | Icon? 45 | ehthumbs.db 46 | Thumbs.db -------------------------------------------------------------------------------- /Assets/Scenes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e902c8c0b4e7a0d4d8453c55863a7532 3 | folderAsset: yes 4 | timeCreated: 1501219179 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scenes/Test.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 448f40325f90d0840b15d33f2c2d8da5 3 | timeCreated: 1501219189 4 | licenseType: Free 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Scenes/ui animation Sample Scene.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2145e601083d97c4ba64d70455d21a11 3 | timeCreated: 1594958189 4 | licenseType: Free 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e402e02f02482eb4a8a4a1c3ad2f3565 3 | folderAsset: yes 4 | timeCreated: 1500793393 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scripts/2D.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a566d1d4c62efcb43b5fb1005352c895 3 | folderAsset: yes 4 | timeCreated: 1500793395 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scripts/2D/Camera.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f5f321f774e078d4c8d3de6e73e8d3ea 3 | folderAsset: yes 4 | timeCreated: 1500793397 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scripts/2D/Camera/PixelPerfectCamera.cs: -------------------------------------------------------------------------------- 1 | // pixel perfect camera helpers, from old unity 2D tutorial videos 2 | // source: https://www.youtube.com/watch?v=rMCLWt1DuqI 3 | 4 | using UnityEngine; 5 | 6 | namespace UnityLibrary 7 | { 8 | [ExecuteInEditMode] 9 | public class PixelPerfectCamera : MonoBehaviour 10 | { 11 | public float pixelsToUnits = 100; 12 | Camera cam; 13 | 14 | void Start() 15 | { 16 | cam = GetComponent(); 17 | if (cam == null) 18 | { 19 | Debug.LogError("Camera not found..", gameObject); 20 | this.enabled = false; 21 | return; 22 | } 23 | SetScale(); 24 | } 25 | 26 | // in editor need to update in a loop, in case of game window resizes 27 | #if UNITY_EDITOR 28 | void Update() 29 | { 30 | SetScale(); 31 | } 32 | #endif 33 | 34 | void SetScale() 35 | { 36 | cam.orthographicSize = Screen.height / pixelsToUnits / 2; 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Assets/Scripts/2D/Camera/PixelPerfectCamera.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 230ad41a455ffc84982860a8ce356020 3 | timeCreated: 1500793401 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/2D/Camera/ScaleCamera.cs: -------------------------------------------------------------------------------- 1 | // pixel perfect camera helpers, from old unity 2D tutorial videos 2 | // source: https://www.youtube.com/watch?v=rMCLWt1DuqI 3 | 4 | using UnityEngine; 5 | 6 | namespace UnityLibrary 7 | { 8 | [ExecuteInEditMode] 9 | public class ScaleCamera : MonoBehaviour 10 | { 11 | public int targetWidth = 640; 12 | public float pixelsToUnits = 100; 13 | 14 | Camera cam; 15 | 16 | void Start() 17 | { 18 | cam = GetComponent(); 19 | if (cam == null) 20 | { 21 | Debug.LogError("Camera not found..", gameObject); 22 | this.enabled = false; 23 | return; 24 | } 25 | 26 | SetScale(); 27 | } 28 | 29 | // in editor need to update in a loop, in case of game window resizes 30 | #if UNITY_EDITOR 31 | void Update() 32 | { 33 | SetScale(); 34 | } 35 | #endif 36 | 37 | void SetScale() 38 | { 39 | int height = Mathf.RoundToInt(targetWidth / (float)Screen.width * Screen.height); 40 | cam.orthographicSize = height / pixelsToUnits / 2; 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Assets/Scripts/2D/Camera/ScaleCamera.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: eb79c0c2e7e8b814497e3fed8bad9dbd 3 | timeCreated: 1500793404 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/2D/Colliders.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: aabfa300fc2aee04ab2c0f4e1d33d8f8 3 | folderAsset: yes 4 | timeCreated: 1500793397 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scripts/2D/Colliders/ScreenEdgeColliders.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 13a829f568060b1429e093c51a02d8d1 3 | timeCreated: 1500793400 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/2D/Drawing.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9acbf89372e16b448a5fbda547b9e83d 3 | folderAsset: yes 4 | timeCreated: 1501390147 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scripts/2D/Drawing/DrawLine2D.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ac0fbbea8fa72e74e9a6e8fcb8d1c6ae 3 | timeCreated: 1501390147 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/2D/Follow2D.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5c3e4ae285230a7448969a1b437a0b03 3 | timeCreated: 1500793402 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/2D/Follow2DRigidbody.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a7e1aa39bc8f2a147a374cdb56ddfb24 3 | timeCreated: 1511611021 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/2D/Geometry/Triangle2D.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5b3d23802c4b0df4db68d12d425fb251 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Scripts/2D/Tilemaps.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 05fee6bf94c73074eba0af2df86b04c6 3 | folderAsset: yes 4 | timeCreated: 1500793396 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scripts/2D/Tilemaps/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 59362721e8fa09e40934df875ea5459a 3 | folderAsset: yes 4 | timeCreated: 1500793398 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scripts/2D/Tilemaps/Editor/TilemapLayerHelper.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b7620f39da11c9f44a1b32c056766a4c 3 | timeCreated: 1500793403 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/2D/Tilemaps/Icons.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fe1a6407b41666346a76d2fc33ca904a 3 | folderAsset: yes 4 | timeCreated: 1500793398 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scripts/2D/Tilemaps/Icons/.gitkeep: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Assets/Scripts/2D/Tilemaps/Icons/icon_DownArrow2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UnityCommunity/UnityLibrary/540d629be475e7e984b893013a5634c725c3ad74/Assets/Scripts/2D/Tilemaps/Icons/icon_DownArrow2.png -------------------------------------------------------------------------------- /Assets/Scripts/2D/Tilemaps/Icons/icon_UpArrow2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UnityCommunity/UnityLibrary/540d629be475e7e984b893013a5634c725c3ad74/Assets/Scripts/2D/Tilemaps/Icons/icon_UpArrow2.png -------------------------------------------------------------------------------- /Assets/Scripts/2D/Tilemaps/Icons/icon_tilemap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UnityCommunity/UnityLibrary/540d629be475e7e984b893013a5634c725c3ad74/Assets/Scripts/2D/Tilemaps/Icons/icon_tilemap.png -------------------------------------------------------------------------------- /Assets/Scripts/2D/Tilemaps/Icons/icon_tilemap_disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UnityCommunity/UnityLibrary/540d629be475e7e984b893013a5634c725c3ad74/Assets/Scripts/2D/Tilemaps/Icons/icon_tilemap_disabled.png -------------------------------------------------------------------------------- /Assets/Scripts/2D/Tilemaps/RandomTiles.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2aec585d61714a14cad8db4ae90ae900 3 | timeCreated: 1500793401 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/2D/Tilemaps/TileMapHierarchyHelper.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 992bbcd9a2e351040883f3ed6ffe7115 3 | timeCreated: 1500793403 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/AssetBundles.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 21d456c6e751b564e80f9cf743f1a72f 3 | folderAsset: yes 4 | timeCreated: 1500793394 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scripts/AssetBundles/AssetBundleLoader.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 03cf67e7ff38596418c74e18a882150f 3 | timeCreated: 1500793399 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Camera.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f6741ca26024b1140a6866a3952649b0 3 | folderAsset: yes 4 | timeCreated: 1500793396 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scripts/Camera/CameraShake.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c03cc4ef2cf2cb54c82653f431e22d78 3 | timeCreated: 1500793403 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Camera/CameraSwitcher.cs: -------------------------------------------------------------------------------- 1 | // Camera switcher, https://forum.unity3d.com/threads/how-can-i-switch-between-multiple-cameras-using-one-key-click.472009/ 2 | // usage: Assign cameras into the array, press C to switch into next camera 3 | 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using UnityEngine; 7 | 8 | namespace UnityLibrary 9 | { 10 | public class CameraSwitcher : MonoBehaviour 11 | { 12 | public Camera[] cameras; 13 | int currentCamera = 0; 14 | 15 | void Awake() 16 | { 17 | if (cameras == null || cameras.Length == 0) 18 | { 19 | Debug.LogError("No cameras assigned..", gameObject); 20 | this.enabled = false; 21 | } 22 | 23 | EnableOnlyFirstCamera(); 24 | } 25 | 26 | void Update() 27 | { 28 | if (Input.GetKeyDown(KeyCode.C)) 29 | { 30 | // disable current 31 | cameras[currentCamera].enabled = false; 32 | 33 | // increment index and wrap after finished array 34 | currentCamera = (currentCamera + 1) % cameras.Length; 35 | 36 | // enable next 37 | cameras[currentCamera].enabled = true; 38 | } 39 | } 40 | 41 | void EnableOnlyFirstCamera() 42 | { 43 | for (int i = 0; i < cameras.Length; i++) 44 | { 45 | // only returns true when i is 0 46 | cameras[i].enabled = (i == 0); 47 | } 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /Assets/Scripts/Camera/CameraSwitcher.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 06e035d5b04a4994285b8436101a9f82 3 | timeCreated: 1500793399 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Camera/EditorCardboardCamera.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | // editor only Google Carboard VR cam simulation with left alt + mouse 6 | 7 | public class EditorCardboardCamera : MonoBehaviour 8 | { 9 | #if UNITY_EDITOR 10 | Vector2 rotation = Vector2.zero; 11 | public float speed = 3; 12 | 13 | void Update() 14 | { 15 | if (Input.GetKey(KeyCode.LeftAlt)) 16 | { 17 | rotation.y += Input.GetAxis("Mouse X"); 18 | rotation.x += -Input.GetAxis("Mouse Y"); 19 | transform.eulerAngles = (Vector2)rotation * speed; 20 | } 21 | } 22 | #endif 23 | } 24 | -------------------------------------------------------------------------------- /Assets/Scripts/Camera/MarrtsSmoothedMouseLook.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 10e595b96bab7724a99b2b273e92011e 3 | timeCreated: 1594958193 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Camera/PlayerMovement.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections.Generic; 3 | using System.Collections; 4 | 5 | //Script for moving a gameObject smoothly 6 | //Usage: Attach the character controller component to the gameobject that you want to move 7 | 8 | namespace UnityLibary 9 | { 10 | public class PlayerMovement : MonoBehaviour 11 | { 12 | // place the gameobject that you want to move to the controller placeholder 13 | public CharacterController controller; 14 | 15 | public float speed = 5f; 16 | 17 | void Update() 18 | { 19 | float x = Input.GetAxis("Horizontal"); 20 | float z = Input.GetAxis("Vertical"); 21 | 22 | Vector3 move = transform.right * x + transform.forward * z; 23 | 24 | controller.Move(move * speed * Time.deltaTime); 25 | 26 | //Rotate clockwise 27 | if (Input.GetKey(KeyCode.E)) 28 | { 29 | transform.RotateAround(transform.position, Vector3.up, 100 * Time.deltaTime); 30 | } 31 | 32 | // Rotate anticlockwise 33 | if (Input.GetKey(KeyCode.Q)) 34 | { 35 | transform.RotateAround(transform.position, -Vector3.up, 100 * Time.deltaTime); 36 | } 37 | 38 | } 39 | 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Assets/Scripts/Camera/PlayerMovement.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c1dd692b70ceca4439544f5a72fa7f70 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Scripts/Camera/SmoothMouseLook.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 44c00afd5e9966b49a5ba1bfd4ce4ba5 3 | timeCreated: 1500793401 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Camera/SmoothMouseLookAveraged.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: be1c222ad88e6b04e945a890fd33e125 3 | timeCreated: 1500793403 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Camera/WowCamera.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3d99a01c1a910df45bea4973b72ad60b 3 | timeCreated: 1500793401 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Camera/ZoomWithMouse.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | // Zoom forward and backward with mousewheel, Attach this script to camera 4 | 5 | namespace UnityLibrary 6 | { 7 | public class ZoomWithMouse : MonoBehaviour 8 | { 9 | public float zoomSpeed = 20; 10 | 11 | void Update() 12 | { 13 | var mouseScroll = Input.GetAxis("Mouse ScrollWheel"); 14 | 15 | if (mouseScroll != 0) 16 | { 17 | transform.Translate(transform.forward * mouseScroll * zoomSpeed * Time.deltaTime, Space.Self); 18 | } 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Assets/Scripts/Camera/ZoomWithMouse.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f63c7db2f4eaccb4a8c82158ed83fc72 3 | timeCreated: 1500793404 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Docs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a5f32495e2dec8f4f9793a3b0c2c16cc 3 | folderAsset: yes 4 | timeCreated: 1502256483 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scripts/Docs/Camera.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f156ebd0553293648ad08d0bb96d6a17 3 | folderAsset: yes 4 | timeCreated: 1502256483 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scripts/Docs/Camera/Camera_depthTextureMode.cs: -------------------------------------------------------------------------------- 1 | // page https://docs.unity3d.com/ScriptReference/Camera-depthTextureMode.html 2 | // usage: attach this script to Camera 3 | 4 | using UnityEngine; 5 | 6 | namespace UnityLibrary 7 | { 8 | public class Camera_depthTextureMode : MonoBehaviour 9 | { 10 | void OnEnable() 11 | { 12 | var cam = GetComponent(); 13 | if (cam!=null) 14 | { 15 | // enable camera depth texture 16 | cam.depthTextureMode = DepthTextureMode.Depth; 17 | } 18 | // Debug.Log(Camera.main.depthTextureMode); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Assets/Scripts/Docs/Camera/Camera_depthTextureMode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 952055200907e8b4f95a7539f6d5607f 3 | timeCreated: 1502256483 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Docs/Graphics.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8f51a49ed57226740a48b0c16003d736 3 | folderAsset: yes 4 | timeCreated: 1502256483 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scripts/Docs/Graphics/Graphics_Blit.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | // Example: Using Graphics.Blit to draw a full screen texture, with particle shader 5 | // Usage: Attach to Main Camera 6 | // Optional: Assign some texture into the displayTexture field in inspector 7 | 8 | namespace UnityLibrary 9 | { 10 | public class Graphics_Blit : MonoBehaviour 11 | { 12 | public Texture displayTexture; // assign texture you want to blit fullscreen 13 | Material mat; // material(shader) to use for blitting 14 | 15 | void Awake() 16 | { 17 | if (displayTexture == null) displayTexture = Texture2D.whiteTexture; // use white texture, if nothing is set 18 | 19 | // use particle shader for the Blit material 20 | var shader = Shader.Find("Particles/Multiply (Double)"); 21 | mat = new Material(shader); 22 | } 23 | 24 | // This function is called only if the script is attached to the camera and is enabled 25 | void OnPostRender() 26 | { 27 | // Copies source texture into destination render texture with a shader 28 | // Destination RenderTexture is null to blit directly to screen 29 | Graphics.Blit(displayTexture, null, mat); 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /Assets/Scripts/Docs/Graphics/Graphics_Blit.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 57240369e62ddfe4f89dbf0b4462a1ea 3 | timeCreated: 1502256483 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Docs/Mesh.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dfe48b7debc5f9c4a9ab9b77ddb37e1a 3 | folderAsset: yes 4 | timeCreated: 1594958191 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scripts/Docs/Mesh/MeshExample.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | /// 4 | /// Build single triangle mesh from script, with vertex colors, normals, uvs. 5 | /// Usage: Assign this script into empty gameobject in the scene, press play. Optional: Add point light to scene for testing lights 6 | /// 7 | 8 | namespace UnityLibrary 9 | { 10 | public class MeshExample : MonoBehaviour 11 | { 12 | 13 | void Start() 14 | { 15 | // create empty gameobject with meshrenderer and meshfilter 16 | var mr = gameObject.AddComponent(); 17 | var mf = gameObject.AddComponent(); 18 | 19 | // build new mesh 20 | Mesh mesh = new Mesh(); 21 | // assign to meshfilter 22 | mf.mesh = mesh; 23 | 24 | // create one triangle face 25 | // 3 vertices 26 | var vertices = new Vector3[] { new Vector3(0, 0, 0), new Vector3(0, 0, 1), new Vector3(1, 0, 1) }; 27 | // connect vertices to build triangle face 28 | var triangles = new int[] { 0, 1, 2 }; 29 | // assign UV per vertex 30 | var uvs = new Vector2[] { new Vector2(0, 0), new Vector2(0, 1), new Vector2(1, 1) }; 31 | // assign normal direction per vertex 32 | var normals = new Vector3[] { Vector3.up, Vector3.up, Vector3.up }; 33 | // assign color per vertex 34 | var colors = new Color[] { Color.red, Color.green, Color.blue }; 35 | 36 | // assign values to mesh 37 | mesh.vertices = vertices; 38 | mesh.uv = uvs; 39 | mesh.triangles = triangles; 40 | mesh.normals = normals; 41 | mesh.colors = colors; 42 | 43 | // if have issues of disappearing mesh, uncomment next line 44 | //mesh.RecalculateBounds(); 45 | 46 | // assign sprite diffuce shader material to see vertex colors and lights 47 | var shader = Shader.Find("Sprites/Diffuse"); 48 | var material = new Material(shader); 49 | mr.material = material; 50 | } 51 | 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /Assets/Scripts/Docs/Mesh/MeshExample.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3292a9e48eeb600418703ec125a8ef82 3 | timeCreated: 1594958193 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Docs/MonoBehaviour.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9855b6fa6f6a43b468a2c8bb672a64a6 3 | folderAsset: yes 4 | timeCreated: 1502256483 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scripts/Docs/MonoBehaviour/MonoBehaviour_OnValidate.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | // Example: Using OnValidate() to validate inspector fields in editor 5 | // https://docs.unity3d.com/ScriptReference/MonoBehaviour.OnValidate.html 6 | 7 | namespace UnityLibrary 8 | { 9 | public class MonoBehaviour_OnValidate : MonoBehaviour 10 | { 11 | // try setting this number larger than 100 in inspector 12 | public float number = 0; 13 | 14 | // this gets called only in editor, when inspector field is modified 15 | void OnValidate() 16 | { 17 | // you can print warnings also 18 | // if (number < 0 || number > 100) Debug.LogWarning("OnValidate: number value is invalid.."); 19 | 20 | // clamp number to 0-100 21 | number = Mathf.Clamp(number, 0, 100); 22 | } 23 | } 24 | } 25 | 26 | -------------------------------------------------------------------------------- /Assets/Scripts/Docs/MonoBehaviour/MonoBehaviour_OnValidate.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a69f3fc609439c64381e334c508b0b82 3 | timeCreated: 1502256483 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Docs/README.md: -------------------------------------------------------------------------------- 1 | # Docs 2 | Sometimes we see some missing, outdated or broken documentations and examples at Unity official documentation Manual or Scripting API, so we have collected some of them and made a good examples and documentations about them. 3 | 4 | Do you found a missing documentation or example? [File it here and let us add it](https://github.com/UnityCommunity/UnityLibrary/issues) 5 | 6 | ## License 7 | [MIT](https://github.com/UnityCommunity/UnityLibrary/blob/master/LICENSE.md) @ [Unity Community](https://github.com/UnityCommunity/) 8 | 9 | Made with :heart: by [Unity Community](https://github.com/UnityCommunity/) 10 | -------------------------------------------------------------------------------- /Assets/Scripts/Docs/README.md.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2d99c632bd78fa748850ab71f0eed232 3 | timeCreated: 1502256483 4 | licenseType: Pro 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Scripts/Docs/UnityEngine.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bb36932ec6987c54189247496091d7f6 3 | folderAsset: yes 4 | timeCreated: 1511611015 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scripts/Docs/UnityEngine/CanvasRenderMode.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | // usage: Attach this script to gameobject with Canvas component 6 | // click mouse button to switch modes *note: worldspace will not be visible without scaling it 7 | // https://docs.unity3d.com/ScriptReference/Canvas-renderMode.html 8 | 9 | namespace UnityLibrary 10 | { 11 | public class CanvasRenderMode : MonoBehaviour 12 | { 13 | Canvas canvas; 14 | 15 | void Start() 16 | { 17 | canvas = GetComponent(); 18 | if (canvas == null) 19 | { 20 | Debug.LogError("Canvas not found..", gameObject); 21 | this.enabled = false; 22 | } 23 | } 24 | 25 | void Update() 26 | { 27 | // switch modes on left mouse click 28 | if (Input.GetMouseButtonDown(0)) 29 | { 30 | if (canvas.renderMode != RenderMode.WorldSpace) 31 | { 32 | canvas.renderMode = RenderMode.WorldSpace; 33 | } else 34 | { 35 | canvas.renderMode = RenderMode.ScreenSpaceOverlay; 36 | } 37 | } 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Assets/Scripts/Docs/UnityEngine/CanvasRenderMode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 37aa85463a82a3448886076125e86145 3 | timeCreated: 1511611020 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Docs/UnityEngine/CullingGroupExample.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a0f7bca99a1816244927583c60c3e022 3 | timeCreated: 1594958194 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Docs/UnityEngine/NavMeshAgentExample.cs: -------------------------------------------------------------------------------- 1 | // made with chatGPT 2 | 3 | using UnityEngine; 4 | using UnityEngine.AI; 5 | 6 | namespace UnityLibrary 7 | { 8 | public class NavMeshAgentExample : MonoBehaviour 9 | { 10 | public Transform target; 11 | 12 | private NavMeshAgent agent; 13 | 14 | void Start() 15 | { 16 | // Get the NavMeshAgent component on this game object 17 | agent = GetComponent(); 18 | 19 | // Set the destination of the NavMeshAgent to the target Transform 20 | agent.destination = target.position; 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Assets/Scripts/Drawing.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e1c3dce8b3aafb34786d2bb6fa8a24df 3 | folderAsset: yes 4 | timeCreated: 1501390147 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scripts/Drawing/DrawLine.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a98122fb61ecbdc42be2a513a469f129 3 | timeCreated: 1501390147 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 13ed0fd2b41b56e4eae1ca4cda5ec8c7 3 | folderAsset: yes 4 | timeCreated: 1500793394 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scripts/Editor/AddDefineSymbols.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using UnityEngine; 5 | using UnityEditor; 6 | 7 | /// 8 | /// Adds the given define symbols to PlayerSettings define symbols. 9 | /// Just add your own define symbols to the Symbols property at the below. 10 | /// 11 | [InitializeOnLoad] 12 | public class AddDefineSymbols : Editor 13 | { 14 | 15 | /// 16 | /// Symbols that will be added to the editor 17 | /// 18 | public static readonly string [] Symbols = new string[] { 19 | "MYCOMPANY", 20 | "MYCOMPANY_MYPACKAGE" 21 | }; 22 | 23 | /// 24 | /// Add define symbols as soon as Unity gets done compiling. 25 | /// 26 | static AddDefineSymbols () 27 | { 28 | string definesString = PlayerSettings.GetScriptingDefineSymbolsForGroup ( EditorUserBuildSettings.selectedBuildTargetGroup ); 29 | List allDefines = definesString.Split ( ';' ).ToList (); 30 | allDefines.AddRange ( Symbols.Except ( allDefines ) ); 31 | PlayerSettings.SetScriptingDefineSymbolsForGroup ( 32 | EditorUserBuildSettings.selectedBuildTargetGroup, 33 | string.Join ( ";", allDefines.ToArray () ) ); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /Assets/Scripts/Editor/AddDefineSymbols.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7fe019cd59a9a6c469975bb98490ba24 3 | timeCreated: 1511611020 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Editor/Animation.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 344c9e72d34584041b61214522912d71 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Scripts/Editor/Animation/LegacyAnimationCreator.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e78d070eb9ba01749a33425b62b0fe5c 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Scripts/Editor/Animation/LegacyAnimationCreator/LegacyAnimationCreator.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using UnityEditor; 3 | using UnityEngine; 4 | 5 | public class LegacyAnimationCreator 6 | { 7 | [MenuItem("Assets/Create/Legacy Animation", priority = 402)] 8 | public static void CompressSelectedAnimationClips() 9 | { 10 | var clip = new AnimationClip(); 11 | clip.legacy = true; 12 | clip.name = "New Legacy Animation"; 13 | 14 | string path; 15 | var selection = Selection.activeObject; 16 | if (selection == null) 17 | path = "Assets"; 18 | else 19 | path = AssetDatabase.GetAssetPath(selection.GetInstanceID()); 20 | 21 | path = Path.GetDirectoryName(path); 22 | path += $"/{clip.name}.anim"; 23 | 24 | ProjectWindowUtil.CreateAsset(clip, path); 25 | Selection.activeObject = clip; 26 | EditorUtility.SetDirty(clip); 27 | } 28 | } -------------------------------------------------------------------------------- /Assets/Scripts/Editor/Animation/LegacyAnimationCreator/LegacyAnimationCreator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d536889e20faa9d47b7def4f46203b81 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Scripts/Editor/BatchTools.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5b412ecce3fdda84085c2963eba28095 3 | folderAsset: yes 4 | timeCreated: 1511611015 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scripts/Editor/BatchTools/CopyGameObjectNames.cs: -------------------------------------------------------------------------------- 1 | // editor tool to copy names of selected GameObjects to clipboard as a list (so you can paste them in Excel or others..) 2 | 3 | using UnityEngine; 4 | using UnityEditor; 5 | using System.Text; 6 | using System.Linq; 7 | namespace UnityLibrary.Tools 8 | { 9 | public class CopyGameObjectNames : EditorWindow 10 | { 11 | private string gameObjectNames = string.Empty; 12 | 13 | [MenuItem("Tools/Copy GameObject Names")] 14 | public static void ShowWindow() 15 | { 16 | GetWindow("Copy GameObject Names"); 17 | } 18 | 19 | private void OnGUI() 20 | { 21 | GUILayout.Label("Copy Names of Selected GameObjects", EditorStyles.boldLabel); 22 | 23 | if (GUILayout.Button("Fetch Names")) 24 | { 25 | FetchNames(); 26 | } 27 | 28 | GUILayout.Label("GameObject Names:", EditorStyles.label); 29 | gameObjectNames = EditorGUILayout.TextArea(gameObjectNames, GUILayout.Height(200)); 30 | 31 | if (GUILayout.Button("Copy to Clipboard")) 32 | { 33 | CopyToClipboard(); 34 | } 35 | } 36 | 37 | private void FetchNames() 38 | { 39 | StringBuilder sb = new StringBuilder(); 40 | GameObject[] selectedObjects = Selection.gameObjects; 41 | 42 | // Sort the selected objects by their sibling index 43 | var sortedObjects = selectedObjects.OrderBy(go => go.transform.GetSiblingIndex()).ToArray(); 44 | 45 | foreach (GameObject obj in sortedObjects) 46 | { 47 | sb.AppendLine(obj.name); 48 | } 49 | 50 | gameObjectNames = sb.ToString(); 51 | } 52 | 53 | private void CopyToClipboard() 54 | { 55 | EditorGUIUtility.systemCopyBuffer = gameObjectNames; 56 | Debug.Log("GameObject names copied to clipboard."); 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /Assets/Scripts/Editor/BatchTools/MassRenameChildren.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c9ef2083b7d1fba4aa65c75605fbf37c 3 | timeCreated: 1511611021 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Editor/BuildProcess.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d115dabccac4e7341a0f797c709e9ee7 3 | folderAsset: yes 4 | timeCreated: 1500793397 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scripts/Editor/BuildProcess/PostBuildCopyEmptyFolders.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using UnityEditor; 3 | using UnityEditor.Callbacks; 4 | using UnityEngine; 5 | 6 | // copies empty StreamingAssets/ folders into build, as they are not automatically included 7 | 8 | namespace UnityLibrary 9 | { 10 | public class PostBuildCopyEmptyFolders : MonoBehaviour 11 | { 12 | [PostProcessBuildAttribute(1)] 13 | public static void OnPostprocessBuild(BuildTarget target, string pathToBuiltProject) 14 | { 15 | // only for windows 16 | if (target != BuildTarget.StandaloneWindows) return; 17 | 18 | Debug.Log("### POSTBUILD : COPY EMPTY STREAMINGASSETS-FOLDERS ###"); 19 | Debug.Log("Build done: " + pathToBuiltProject); 20 | 21 | // get output root 22 | var root = Path.GetDirectoryName(pathToBuiltProject); 23 | var appName = Path.GetFileNameWithoutExtension(pathToBuiltProject); 24 | 25 | // copy empty streaming asset folders to build 26 | var sourcePath = Application.streamingAssetsPath; 27 | var targetPath = Path.Combine(root, appName + "_Data", "StreamingAssets"); 28 | //Debug.Log("sourcePath= "+ sourcePath); 29 | //Debug.Log("targetPath= " + targetPath); 30 | CopyFolderStructure(sourcePath, targetPath); 31 | } 32 | 33 | // recursive folder copier 34 | static public void CopyFolderStructure(string sourceFolder, string destFolder) 35 | { 36 | if (Directory.Exists(destFolder)) 37 | { 38 | 39 | } 40 | else 41 | { 42 | Directory.CreateDirectory(destFolder); 43 | } 44 | 45 | string[] folders = Directory.GetDirectories(sourceFolder); 46 | foreach (string folder in folders) 47 | { 48 | string name = Path.GetFileName(folder); 49 | string dest = Path.Combine(destFolder, name); 50 | CopyFolderStructure(folder, dest); 51 | } 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /Assets/Scripts/Editor/BuildProcess/PostProcessBuild.cs: -------------------------------------------------------------------------------- 1 | // OnPostprocessBuild() gets called after build has completed 2 | // usage: copy to Editor/ folder in your project 3 | 4 | using UnityEditor; 5 | using UnityEditor.Build; 6 | using System.Diagnostics; 7 | using Debug = UnityEngine.Debug; 8 | 9 | namespace UnityLibrary 10 | { 11 | public class PostProcessBuild : IPostprocessBuild 12 | { 13 | public int callbackOrder { get { return 0; } } 14 | 15 | public void OnPostprocessBuild(BuildTarget target, string path) 16 | { 17 | Debug.Log("OnPostprocessBuild for target " + target + " at path " + path); 18 | 19 | // Run some process after successful build 20 | Process proc = new Process(); 21 | proc.StartInfo.FileName = "C:/WINDOWS/system32/notepad.exe"; 22 | proc.Start(); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Assets/Scripts/Editor/BuildProcess/PostProcessBuild.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 650b440cfd97b6c43af9eba650d33741 3 | timeCreated: 1500793402 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Editor/ContextMenu.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 07f01cf58a1140349bfac4f393266db1 3 | folderAsset: yes 4 | timeCreated: 1594958190 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scripts/Editor/ContextMenu/BoxColliderFitChildren.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 687fde9d16dc6b04e934c421806d4abb 3 | timeCreated: 1594958194 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Editor/ContextMenu/CreateOutlineForPanelEditor.cs: -------------------------------------------------------------------------------- 1 | // Custom Contect menu for UI Image component (in WorldSpace UI canvas) 2 | // used for creating outline for panel (image) using LineRenderer 3 | 4 | using UnityEngine; 5 | using UnityEditor; 6 | using UnityEngine.UI; 7 | 8 | namespace UnityLibrary 9 | { 10 | public class CreateOutlineForPanelEditor : MonoBehaviour 11 | { 12 | [MenuItem("CONTEXT/Image/Create Outline For Panel")] 13 | static void DoubleMass(MenuCommand command) 14 | { 15 | // get reference 16 | Image comp = (Image)command.context; 17 | if (comp == null) 18 | { 19 | Debug.LogError("No Image component found.."); 20 | return; 21 | } 22 | 23 | // TODO check that its worlspace canvas 24 | 25 | // get worldspace borders, FIXME get root canvas, instead of parent 26 | var canvasRect = comp.transform.parent.GetComponent().GetComponent(); 27 | Vector3[] corners = new Vector3[4]; 28 | canvasRect.GetWorldCorners(corners); 29 | 30 | var line = comp.transform.GetComponent(); 31 | if (line == null) 32 | { 33 | Debug.LogError("Missing LineRenderer component"); 34 | return; 35 | } 36 | 37 | if (line.useWorldSpace == true) 38 | { 39 | Debug.LogWarning("LineRenderer has worlspace enabled, disabling it"); 40 | line.useWorldSpace = false; 41 | } 42 | 43 | // set line points 44 | line.positionCount = corners.Length + 1; 45 | line.SetPositions(corners); 46 | // connect last and first 47 | line.SetPosition(line.positionCount - 1, corners[0]); 48 | 49 | // convert worldspace to localspace 50 | for (int i = 0, len = line.positionCount; i < len; i++) 51 | { 52 | var worldPos = line.GetPosition(i); 53 | var localPos = canvasRect.transform.InverseTransformPoint(worldPos); 54 | line.SetPosition(i, localPos); 55 | } 56 | 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /Assets/Scripts/Editor/ContextMenu/CreateOutlineForPanelEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ea3d3337d55b5bc42a40dff5480adca0 3 | timeCreated: 1594958194 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Editor/ContextMenu/GetVideoAspectRatioEditor.cs: -------------------------------------------------------------------------------- 1 | // Custom Contect menu for VideoPlayer component 2 | // used for scaling quad mesh transform localscale.y to match videoplayer aspect ratio 3 | 4 | using UnityEngine; 5 | using UnityEditor; 6 | using UnityEngine.Video; 7 | 8 | namespace UnityLibrary 9 | { 10 | public class GetVideoAspectRatioEditor : MonoBehaviour 11 | { 12 | [MenuItem("CONTEXT/VideoPlayer/Get Aspect Ratio for Mesh")] 13 | static void DoubleMass(MenuCommand command) 14 | { 15 | // get aspect ratio 16 | VideoPlayer v = (VideoPlayer)command.context; 17 | if (v.clip == null) 18 | { 19 | Debug.LogError("No videoclip assigned.."); 20 | return; 21 | } 22 | #if UNITY_2017 23 | float aspectRatioY = v.texture.height / (float)v.texture.width; 24 | #else 25 | float aspectRatioY = v.height / (float)v.width; 26 | #endif 27 | 28 | 29 | // record undo 30 | Undo.RecordObject(v.transform, "Set scale"); 31 | 32 | // scale mesh 33 | Vector3 scale = v.transform.localScale; 34 | // fix only height 35 | scale.y *= aspectRatioY; 36 | v.transform.localScale = scale; 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Assets/Scripts/Editor/ContextMenu/GetVideoAspectRatioEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: acde12b67d212ae42ab65f73b96ffd59 3 | timeCreated: 1594958194 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Editor/ContextMenu/SetBoxColliderToUI.cs: -------------------------------------------------------------------------------- 1 | // Tries to move BoxCollider(3D)-component to match UI panel/image position, by adjusting collider pivot value 2 | 3 | using UnityEngine; 4 | using UnityEditor; 5 | 6 | namespace UnityLibrary 7 | { 8 | public class SetBoxColliderToUI : MonoBehaviour 9 | { 10 | [MenuItem("CONTEXT/BoxCollider/Match Position to UI")] 11 | static void FixPosition(MenuCommand command) 12 | { 13 | BoxCollider b = (BoxCollider)command.context; 14 | 15 | // record undo 16 | Undo.RecordObject(b.transform, "Set Box Collider To UI"); 17 | 18 | // fix pos from Pivot 19 | var r = b.gameObject.GetComponent(); 20 | if (r == null) return; 21 | 22 | //Debug.Log("pivot "+r.pivot); 23 | 24 | var center = b.center; 25 | 26 | center.x = 0.5f - r.pivot.x; 27 | center.y = 0.5f - r.pivot.y; 28 | 29 | b.center = center; 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Assets/Scripts/Editor/ContextMenu/SetBoxColliderToUI.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9581bb1267ccd9e48b11127704331d49 3 | timeCreated: 1594958194 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Editor/EditorShortCutKeys.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditor; 3 | using UnityEditor.SceneManagement; 4 | using UnityEngine.SceneManagement; 5 | 6 | // original source by "Mavina" http://answers.unity3d.com/answers/1204307/view.html 7 | // usage: Place this script into Editor/ folder, then you can press F5 to enter/exit Play Mode 8 | namespace UnityLibrary 9 | { 10 | public class EditorShortCutKeys : ScriptableObject 11 | { 12 | [MenuItem("Edit/Run _F5")] // shortcut key F5 to Play (and exit playmode also) 13 | static void PlayGame() 14 | { 15 | if (!Application.isPlaying) 16 | { 17 | EditorSceneManager.SaveScene(SceneManager.GetActiveScene(), "", false); // optional: save before run 18 | } 19 | EditorApplication.ExecuteMenuItem("Edit/Play"); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Assets/Scripts/Editor/EditorShortCutKeys.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f55ab5721c1f1714e8ff849ddb613432 3 | timeCreated: 1500793404 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Editor/GameObject.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dda0f0ad5057e2244b9a17ccd5031e99 3 | folderAsset: yes 4 | timeCreated: 1594958191 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scripts/Editor/GameObject/ResetTransform.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditor; 3 | 4 | // reset transform position, rotation and scale 5 | 6 | namespace UnityLibrary 7 | { 8 | public class ResetTransform : ScriptableObject 9 | { 10 | [MenuItem("GameObject/Reset Transform #r")] 11 | static public void MoveSceneViewCamera() 12 | { 13 | // TODO add multiple object support 14 | var go = Selection.activeGameObject; 15 | if (go != null) 16 | { 17 | // TODO: add undo 18 | go.transform.position = Vector3.zero; 19 | go.transform.rotation = Quaternion.identity; 20 | go.transform.localScale = Vector3.one; 21 | } 22 | } 23 | 24 | } // class 25 | } // namespace 26 | -------------------------------------------------------------------------------- /Assets/Scripts/Editor/GameObject/ResetTransform.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 51c038ebd5a3e0d4b92a12f03a73b6ea 3 | timeCreated: 1594958193 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Editor/Gizmos.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1a9b3e3cace9b2a45a7ef8a517017aa2 3 | folderAsset: yes 4 | timeCreated: 1500793396 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scripts/Editor/Gizmos/DrawCameraFrustumGizmos.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditor; 3 | 4 | // draws camera frustum lines with Gizmo lines (when camera is not selected) 5 | // Usage: add this script into Editor/ folder on your project 6 | // WARNING: cam.transform.position does not work, DrawFrustum ignores the value, unity bug? 7 | namespace UnityLibrary 8 | { 9 | static class DrawCameraFrustumGizmos 10 | { 11 | [DrawGizmo(GizmoType.NotInSelectionHierarchy)]// | GizmoType.Active)] 12 | static void DrawGizmoForMyScript(Camera cam, GizmoType gizmoType) 13 | { 14 | Gizmos.color = Color.red; 15 | Gizmos.DrawFrustum(cam.transform.position, cam.fieldOfView, cam.farClipPlane, cam.nearClipPlane, cam.aspect); 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /Assets/Scripts/Editor/Gizmos/DrawCameraFrustumGizmos.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 45f18a6639b731f4caa6b5b1a01429b7 3 | timeCreated: 1500793401 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Editor/Gizmos/RendererBoundsGizmo.cs: -------------------------------------------------------------------------------- 1 | // attach this to mesh, draws renderer bounds when gameobject is selected 2 | // original source: http://answers.unity.com/answers/137475/view.html 3 | 4 | using UnityEngine; 5 | 6 | namespace UnityLibrary 7 | { 8 | public class RendererBoundsGizmo : MonoBehaviour 9 | { 10 | void OnDrawGizmosSelected() 11 | { 12 | Gizmos.color = Color.yellow; 13 | //center sphere 14 | //Gizmos.DrawSphere(transform.position, 0.1f); 15 | var r = transform.GetComponent(); 16 | if (r != null) Gizmos.DrawWireCube(transform.position, r.bounds.size); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Assets/Scripts/Editor/Gizmos/RendererBoundsGizmo.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f1bf2afb27df5364dab899f318af7f69 3 | timeCreated: 1594958195 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Editor/GridGenerator.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a6d652b3b2e09c341916f676f9620af4 3 | folderAsset: yes 4 | timeCreated: 1500793397 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scripts/Editor/GridGenerator/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bfd74206b49d0814fba364735df6024b 3 | folderAsset: yes 4 | timeCreated: 1500793398 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scripts/Editor/GridGenerator/Editor/GridGeneratorEditor.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEditor; 4 | using UnityEngine; 5 | using UnityEditor.SceneManagement; 6 | using System.Linq; 7 | namespace UnityLibrary 8 | { 9 | [CustomEditor(typeof(GridGenerator))] 10 | public class GridGeneratorEditor : Editor 11 | { 12 | GridGenerator t; 13 | 14 | private void OnEnable() 15 | { 16 | t = (GridGenerator)target; 17 | } 18 | 19 | public override void OnInspectorGUI() 20 | { 21 | base.OnInspectorGUI(); 22 | 23 | if (GUILayout.Button("Cleanup")) 24 | { 25 | CleanUp(); 26 | } 27 | 28 | if (GUILayout.Button("Generate Grid")) 29 | { 30 | CleanUp(); 31 | GenerateGrid(); 32 | } 33 | } 34 | 35 | private void CleanUp() 36 | { 37 | List tempList = t.transform.Cast().ToList(); 38 | tempList.ForEach(x => DestroyImmediate(x.gameObject)); 39 | } 40 | 41 | private void GenerateGrid() 42 | { 43 | for (int x = 0; x < t.SizeX; x++) 44 | { 45 | for (int y = 0; y < t.SizeY; y++) 46 | { 47 | Vector3 localOffset = new Vector3( 48 | t.Offset.x * x, 49 | 0, 50 | t.Offset.y * y 51 | ); 52 | 53 | GameObject spawnedObject = Instantiate(t.PrefabToPlace); 54 | 55 | spawnedObject.transform.SetParent(t.transform); 56 | spawnedObject.transform.localPosition = localOffset; 57 | 58 | spawnedObject.name = string.Format("{0} ({1},{2})", t.PrefabToPlace.name, x, y); 59 | } 60 | } 61 | 62 | EditorSceneManager.MarkSceneDirty(EditorSceneManager.GetActiveScene()); 63 | } 64 | 65 | } 66 | } -------------------------------------------------------------------------------- /Assets/Scripts/Editor/GridGenerator/Editor/GridGeneratorEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 62a17510090efae4591eaa951197003d 3 | timeCreated: 1500793402 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Editor/GridGenerator/GridGenerator.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | namespace UnityLibrary 3 | { 4 | public class GridGenerator : MonoBehaviour 5 | { 6 | [SerializeField] 7 | private GameObject prefabToPlace; 8 | 9 | [SerializeField] 10 | private uint sizeX = 2; 11 | 12 | [SerializeField] 13 | private uint sizeY = 2; 14 | 15 | [SerializeField] 16 | private Vector2 offset = Vector2.one; 17 | 18 | public GameObject PrefabToPlace { get { return prefabToPlace; } } 19 | public Vector2 Offset { get { return offset; } } 20 | 21 | public uint SizeX { get { return sizeX; } } 22 | public uint SizeY { get { return sizeY; } } 23 | } 24 | } -------------------------------------------------------------------------------- /Assets/Scripts/Editor/GridGenerator/GridGenerator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 50d99d82db098f143b97912777f8c022 3 | timeCreated: 1500793401 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Editor/HelpLastRelease.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e709b023ac010b643ad268fc30d93568 3 | timeCreated: 1511611021 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Editor/Hierarchy.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4ad868ac71006a0418c8df13616a4c3e 3 | folderAsset: yes 4 | timeCreated: 1594958190 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scripts/Editor/Hierarchy/MoveAround.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 18fe530f4fbd8b74096f07f377a4b9ff 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Scripts/Editor/Hierarchy/UnparentMe.cs: -------------------------------------------------------------------------------- 1 | // unparents selected gameobject in hierarchy (by moving to grandparents if available) 2 | 3 | using UnityEditor; 4 | 5 | namespace UnityLibrary 6 | { 7 | public class UnparentMe 8 | { 9 | // https://docs.unity3d.com/ScriptReference/MenuItem.html 10 | // shift U shortcut key 11 | [MenuItem("GameObject/Unparent #u")] 12 | static void UnParent() 13 | { 14 | // TODO: add undo 15 | if (Selection.activeGameObject != null && Selection.activeGameObject.transform.parent != null) 16 | { 17 | Selection.activeGameObject.transform.parent = Selection.activeGameObject.transform.parent.parent; 18 | } 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Assets/Scripts/Editor/Hierarchy/UnparentMe.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 859aeadcffa51fe4f9cc875774621ef9 3 | timeCreated: 1594958194 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Editor/ImageEffects.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8a3e1002f6a65554fb21b5baea37a33b 3 | folderAsset: yes 4 | timeCreated: 1500793397 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scripts/Editor/ImageEffects/ColorCorrectionCurvesEditorLayers.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 71cb5aca4636e344db9f91f7236a532e 3 | timeCreated: 1500793398 4 | licenseType: Free 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Scripts/Editor/Mesh.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f45eaf3f880e5c04785b1cdca6b98021 3 | folderAsset: yes 4 | timeCreated: 1594958191 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scripts/Editor/Mesh/CreatePlane.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d1cea26cb1deacf48b0dd190be08a597 3 | timeCreated: 1594958194 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Editor/Mesh/MeshCombineWizard.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 72fbe9dd2dbf0f845ab4d30da0d8b27c 3 | timeCreated: 1594958194 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Editor/README.md: -------------------------------------------------------------------------------- 1 | # Editor Scripts 2 | Extend the Unity Editor with the power of Community. 3 | 4 | Experiencing errors and problems, no worry, [File them, and let us fix them](https://github.com/UnityCommunity/UnityLibrary/issues) 5 | 6 | ## License 7 | [MIT](https://github.com/UnityCommunity/UnityLibrary/blob/master/LICENSE.md) @ [Unity Community](https://github.com/UnityCommunity/) 8 | 9 | Made with :heart: by [Unity Community](https://github.com/UnityCommunity/) 10 | -------------------------------------------------------------------------------- /Assets/Scripts/Editor/README.md.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d99cb649a69348c42b9a6e8d62766538 3 | timeCreated: 1500793397 4 | licenseType: Free 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Scripts/Editor/SetPivot.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a41d285eb1e4e5148a8eb9faf1d929ec 3 | timeCreated: 1500793403 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Editor/SpriteBackgroundRemover.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2737bc699c1d92f4ca840a5dc0992efa 3 | timeCreated: 1500793401 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Editor/Tools.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2a517a11ecc7f514381fcf9318d8fbfa 3 | folderAsset: yes 4 | timeCreated: 1500793396 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scripts/Editor/Tools/ColorPickerWindow.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEditor; 5 | 6 | public class ColorPickerWindow : EditorWindow 7 | { 8 | 9 | protected Color color = Color.white; 10 | protected Color32 color32 = new Color32 ( 255, 255, 255, 255 ); 11 | protected string hexCode = "FFFFFF"; 12 | 13 | [MenuItem ( "Tools/Color Picker" )] 14 | public static void Init () 15 | { 16 | var window = EditorWindow.GetWindow ( "Color Picker" ); 17 | window.Show (); 18 | } 19 | 20 | protected virtual void OnGUI () 21 | { 22 | this.color = EditorGUILayout.ColorField ( "Color", this.color ); 23 | if ( GUI.changed ) 24 | { 25 | this.color32 = this.color; 26 | this.hexCode = ColorUtility.ToHtmlStringRGB ( this.color ); 27 | } 28 | this.hexCode = EditorGUILayout.TextField ( "Hex Code", this.hexCode ); 29 | if ( GUI.changed ) 30 | { 31 | ColorUtility.TryParseHtmlString ( this.hexCode, out this.color ); 32 | } 33 | this.color32.r = ( byte )EditorGUILayout.IntSlider ( "Red", this.color32.r, 0, 255 ); 34 | this.color32.g = ( byte )EditorGUILayout.IntSlider ( "Green", this.color32.g, 0, 255 ); 35 | this.color32.b = ( byte )EditorGUILayout.IntSlider ( "Blue", this.color32.b, 0, 255 ); 36 | this.color32.a = ( byte )EditorGUILayout.IntSlider ( "Alpha", this.color32.a, 0, 255 ); 37 | if ( GUI.changed ) 38 | { 39 | this.color = this.color32; 40 | this.hexCode = ColorUtility.ToHtmlStringRGB ( this.color ); 41 | } 42 | EditorGUILayout.TextField ( 43 | "Color Code", 44 | string.Format ( 45 | "new Color ( {0}f, {1}f, {2}f, {3}f )", 46 | this.color.r, 47 | this.color.g, 48 | this.color.b, 49 | this.color.a ) ); 50 | EditorGUILayout.TextField ( 51 | "Color32 Code", 52 | string.Format ( 53 | "new Color32 ( {0}, {1}, {2}, {3} )", 54 | this.color32.r, 55 | this.color32.g, 56 | this.color32.b, 57 | this.color32.a ) ); 58 | } 59 | 60 | } 61 | -------------------------------------------------------------------------------- /Assets/Scripts/Editor/Tools/ColorPickerWindow.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 333163797deb57f4a8d7373ac970d9bf 3 | timeCreated: 1594958193 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Editor/Tools/CompileTime.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a15be7d1f359a614fb4f298da7a5fa9e 3 | timeCreated: 1594958194 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Editor/Tools/CopyPasteHelper.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a02af6a99d72383438d6fdca2684b2cf 3 | timeCreated: 1500793403 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Editor/Tools/GameViewGridOverlay.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace UnityLibrary.EditorTools 4 | { 5 | [ExecuteAlways] 6 | public class GameViewGridOverlay : MonoBehaviour 7 | { 8 | #if UNITY_EDITOR 9 | public bool drawGrid = true; 10 | 11 | [Header("Grid Cell Size (visible area)")] 12 | public int gridSizeX = 64; 13 | public int gridSizeY = 64; 14 | 15 | [Header("Spacing Between Cells (invisible gap)")] 16 | public int spacingX = 16; 17 | public int spacingY = 16; 18 | 19 | [Header("Start Offsets")] 20 | public int startOffsetX = 0; 21 | public int startOffsetY = 0; 22 | 23 | public Color gridColor = new Color(1f, 1f, 1f, 0.5f); 24 | 25 | private void OnGUI() 26 | { 27 | if (!drawGrid || Application.isPlaying) return; 28 | 29 | Color oldColor = GUI.color; 30 | GUI.color = gridColor; 31 | 32 | int cellStrideX = gridSizeX + spacingX; 33 | int cellStrideY = gridSizeY + spacingY; 34 | 35 | // Loop until start of the cell is beyond screen, not end of cell 36 | for (int y = startOffsetY; y < Screen.height; y += cellStrideY) 37 | { 38 | for (int x = startOffsetX; x < Screen.width; x += cellStrideX) 39 | { 40 | // Draw full box even if it goes beyond screen edges 41 | 42 | // Left 43 | GUI.DrawTexture(new Rect(x, y, 1, gridSizeY), Texture2D.whiteTexture); 44 | // Right 45 | GUI.DrawTexture(new Rect(x + gridSizeX - 1, y, 1, gridSizeY), Texture2D.whiteTexture); 46 | // Top 47 | GUI.DrawTexture(new Rect(x, y, gridSizeX, 1), Texture2D.whiteTexture); 48 | // Bottom 49 | GUI.DrawTexture(new Rect(x, y + gridSizeY - 1, gridSizeX, 1), Texture2D.whiteTexture); 50 | } 51 | } 52 | 53 | GUI.color = oldColor; 54 | } 55 | #endif 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /Assets/Scripts/Editor/Tools/GetSelectedMeshInfo.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: eff5480c5ab3f114792d467d0ad841c1 3 | timeCreated: 1511611021 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Editor/Tools/README.md: -------------------------------------------------------------------------------- 1 | ### GameViewGridOverlay.cs 2 | ![Image](https://github.com/user-attachments/assets/48fbced4-48e0-49fe-9acc-666f5449a958) 3 | -------------------------------------------------------------------------------- /Assets/Scripts/Editor/Tools/ReferenceImageViewer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2db76a597f4fe1b4e83ee1084fd940a6 3 | timeCreated: 1594958193 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Editor/Tools/SceneManagerWindow.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9b6b0e046c5bb254f919f740aeb8518b 3 | timeCreated: 1594958194 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Editor/Tools/SceneSwitcherWindow.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fc44dc6a633635b4ba4ed8bfa75dc6bb 3 | timeCreated: 1594958195 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Editor/UI.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ae079ea44417ab84fa840a15feb4daca 3 | folderAsset: yes 4 | timeCreated: 1500793397 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scripts/Editor/UI/CanvasScalerUtil.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4506db3ef67122146adf637a6b43e8eb 3 | folderAsset: yes 4 | timeCreated: 1500793397 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scripts/Editor/UI/CanvasScalerUtil/CanvasScalerUtil.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | /// 4 | /// Author: https://github.com/Sacristan 5 | /// Script to hastily create correct canvas scales. Logic handled at editor's side 6 | /// 7 | namespace UnityLibrary 8 | { 9 | [RequireComponent(typeof(Canvas))] 10 | public class CanvasScalerUtil : MonoBehaviour 11 | { 12 | [SerializeField] 13 | private uint canvasWidth = 800; 14 | 15 | [SerializeField] 16 | private uint canvasHeight = 600; 17 | 18 | [SerializeField] 19 | private float canvasWorldSizeInMeters = 1; 20 | 21 | public uint CanvasWidth { get { return canvasWidth; } } 22 | public uint CanvasHeight { get { return canvasHeight; } } 23 | public float CanvasWorldSizeInMeters { get { return canvasWorldSizeInMeters; } } 24 | 25 | #region MonoBehaviour 26 | private void Awake() 27 | { 28 | Debug.Log("CanvasScalerUtil has nothing to do with realtime logic"); 29 | Destroy(this); 30 | } 31 | #endregion 32 | } 33 | } -------------------------------------------------------------------------------- /Assets/Scripts/Editor/UI/CanvasScalerUtil/CanvasScalerUtil.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bdd93193cc75c9d4f8fc66423ec514b9 3 | timeCreated: 1499173346 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Editor/UI/CanvasScalerUtil/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b598d8a9158f9fe4080b54101474f951 3 | folderAsset: yes 4 | timeCreated: 1499174027 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scripts/Editor/UI/CanvasScalerUtil/Editor/CanvasScalerUtilEditor.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditor; 3 | 4 | /// 5 | /// Author: Girts Kesteris 2017 6 | /// Script to hastily create correct canvas scales. Logic handled at editor's side 7 | /// 8 | namespace UnityLibrary 9 | { 10 | [CustomEditor(typeof(CanvasScalerUtil))] 11 | public class CanvasScalerUtilEditor : Editor 12 | { 13 | CanvasScalerUtil t; 14 | 15 | private void OnEnable() 16 | { 17 | t = (CanvasScalerUtil)target; 18 | } 19 | 20 | public override void OnInspectorGUI() 21 | { 22 | base.OnInspectorGUI(); 23 | if (GUILayout.Button("Scale Canvas")) ScaleCanvas(); 24 | } 25 | 26 | private void ScaleCanvas() 27 | { 28 | Canvas canvas = t.GetComponent(); 29 | RectTransform rectTransform = t.GetComponent(); 30 | 31 | Vector2 sizeDelta = new Vector2(t.CanvasWidth, t.CanvasHeight); 32 | Vector3 scale = t.CanvasWorldSizeInMeters / t.CanvasWidth * Vector3.one; 33 | 34 | if (canvas.renderMode != RenderMode.WorldSpace) 35 | { 36 | Debug.Log("CanvasScalerUtil: Swiched to WorldSpace Render Mode from " + canvas.renderMode); 37 | canvas.renderMode = RenderMode.WorldSpace; 38 | } 39 | 40 | Debug.LogFormat("CanvasScalerUtil: calculated sizeDelta: {0} scale: {1}", sizeDelta, scale); 41 | 42 | rectTransform.sizeDelta = sizeDelta; 43 | rectTransform.localScale = scale; 44 | } 45 | } 46 | } -------------------------------------------------------------------------------- /Assets/Scripts/Editor/UI/CanvasScalerUtil/Editor/CanvasScalerUtilEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f46d15874e9dfbb4882b301fb5dd1160 3 | timeCreated: 1499174035 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Extensions.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f22051d526f0e5841b3027059c57a6cc 3 | folderAsset: yes 4 | timeCreated: 1501517477 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scripts/Extensions/MonoBehaviourExtensions.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9064a058036a7004f829d31b1ec4fa7a 3 | folderAsset: yes 4 | timeCreated: 1594958190 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scripts/Extensions/MonoBehaviourExtensions/Example.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d05efc8881e8e844a8eccc6132e0ddf6 3 | folderAsset: yes 4 | timeCreated: 1594958191 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scripts/Extensions/MonoBehaviourExtensions/Example/MonoBehaviorExtensionsExample.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using Sacristan.Utils.Extensions; 3 | 4 | public class MonoBehaviorExtensionsTest : MonoBehaviour 5 | { 6 | private void Start() 7 | { 8 | this.InvokeRepeatingSafe(Tick, 1f, 1f); 9 | this.InvokeSafe(Tock, 2f); 10 | } 11 | 12 | private void Tick() 13 | { 14 | Debug.Log("Tick"); 15 | } 16 | 17 | private void Tock() 18 | { 19 | Debug.Log("Tock"); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Assets/Scripts/Extensions/MonoBehaviourExtensions/Example/MonoBehaviorExtensionsExample.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7bbf1f0c60c74ac4683995b0a507d537 3 | timeCreated: 1594958194 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Extensions/MonoBehaviourExtensions/MonoBehaviourExtensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using UnityEngine; 4 | 5 | namespace Sacristan.Utils.Extensions 6 | { 7 | public static class MonoBehaviourExtensions 8 | { 9 | public static void InvokeSafe(this MonoBehaviour behavior, System.Action method, float delayInSeconds) 10 | { 11 | behavior.StartCoroutine(InvokeSafeRoutine(method, delayInSeconds)); 12 | } 13 | 14 | public static void InvokeRepeatingSafe(this MonoBehaviour behavior, System.Action method, float delayInSeconds, float repeatRateInSeconds) 15 | { 16 | behavior.StartCoroutine(InvokeSafeRepeatingRoutine(method, delayInSeconds, repeatRateInSeconds)); 17 | } 18 | 19 | private static IEnumerator InvokeSafeRepeatingRoutine(System.Action method, float delayInSeconds, float repeatRateInSeconds) 20 | { 21 | yield return new WaitForSeconds(delayInSeconds); 22 | 23 | while (true) 24 | { 25 | if (method != null) method.Invoke(); 26 | yield return new WaitForSeconds(repeatRateInSeconds); 27 | } 28 | } 29 | 30 | private static IEnumerator InvokeSafeRoutine(System.Action method, float delayInSeconds) 31 | { 32 | yield return new WaitForSeconds(delayInSeconds); 33 | if (method != null) method.Invoke(); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Assets/Scripts/Extensions/MonoBehaviourExtensions/MonoBehaviourExtensions.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 607fadb72caa2c54f833370bcf9558dc 3 | timeCreated: 1594958194 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Extensions/StringExtensions.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Globalization; 3 | 4 | // e.g. "#FFFFFF".ToColor() 5 | 6 | namespace UnityLibrary 7 | { 8 | public static class StringExtensions 9 | { 10 | public static Color ToColor(this string hex) { 11 | hex = hex.Replace("0x", ""); 12 | hex = hex.Replace("#", ""); 13 | 14 | byte a = 255; 15 | byte r = byte.Parse(hex.Substring(0,2), NumberStyles.HexNumber); 16 | byte g = byte.Parse(hex.Substring(2,2), NumberStyles.HexNumber); 17 | byte b = byte.Parse(hex.Substring(4,2), NumberStyles.HexNumber); 18 | 19 | if (hex.Length == 8) 20 | a = byte.Parse(hex.Substring(6,2), NumberStyles.HexNumber); 21 | 22 | return new Color32(r,g,b,a); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Assets/Scripts/Extensions/TransformExtensions.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace UnityLibrary 6 | { 7 | 8 | /// 9 | /// Transform extensions. 10 | /// Useful transform utilities and methods. 11 | /// 12 | public static class TransformExtensions 13 | { 14 | 15 | /// 16 | /// Rotates the transform so the forward vector points at target's current position. 17 | /// 18 | /// Transform. 19 | /// Target. 20 | public static void LookAt2D ( this Transform transform, Transform target ) 21 | { 22 | transform.LookAt2D ( ( Vector2 )target.position ); 23 | } 24 | 25 | /// 26 | /// Rotates the transform so the forward vector points at worldPosition. 27 | /// 28 | /// Transform. 29 | /// World position. 30 | public static void LookAt2D ( this Transform transform, Vector3 worldPosition ) 31 | { 32 | transform.LookAt2D ( ( Vector2 )worldPosition ); 33 | } 34 | 35 | /// 36 | /// Rotates the transform so the forward vector points at worldPosition. 37 | /// 38 | /// Transform. 39 | /// World position. 40 | public static void LookAt2D ( this Transform transform, Vector2 worldPosition ) 41 | { 42 | Vector2 distance = worldPosition - ( Vector2 )transform.position; 43 | transform.eulerAngles = new Vector3 ( 44 | transform.eulerAngles.x, 45 | transform.eulerAngles.y, 46 | Mathf.Atan2 ( distance.y, distance.x ) * Mathf.Rad2Deg ); 47 | } 48 | 49 | } 50 | 51 | } -------------------------------------------------------------------------------- /Assets/Scripts/Extensions/TransformExtensions.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2b0381052a6d9064b9dbd65600663886 3 | timeCreated: 1501517485 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Extensions/Vector2Extensions.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace UnityLibrary 4 | { 5 | static class Vector2Extensions 6 | { 7 | public static Vector2 Round(this Vector2 vector, int to = 0) => new Vector2(vector.x.Round(to), vector.y.Round(to)); 8 | 9 | public static Vector2 Rotate(this Vector2 vector, float angle, Vector2 pivot = default(Vector2)) 10 | { 11 | Vector2 rotated = Quaternion.Euler(new Vector3(0f, 0f, angle)) * (vector - pivot); 12 | return rotated + pivot; 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Assets/Scripts/Extensions/Vector2Extensions.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 058da80b535be1d469c9998e5629a60e 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Scripts/Helpers.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f420d7df62f441e43b80fb1fc389ff95 3 | folderAsset: yes 4 | timeCreated: 1500793395 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scripts/Helpers/Debug.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 163f9d000f608304ab9d958351b79726 3 | folderAsset: yes 4 | timeCreated: 1500793396 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scripts/Helpers/Debug/Timer.cs: -------------------------------------------------------------------------------- 1 | // Timer: get time elapsed in milliseconds 2 | using UnityEngine; 3 | using System.Diagnostics; 4 | using Debug = UnityEngine.Debug; 5 | 6 | namespace UnityLibrary 7 | { 8 | public class Timer : MonoBehaviour 9 | { 10 | void Start () 11 | { 12 | // init and start timer 13 | var stopwatch = new Stopwatch (); 14 | stopwatch.Start (); 15 | 16 | // put your function here.. 17 | for ( int i = 0; i < 1000000; i++ ) 18 | { 19 | // Example : var tmp = "asdf" + 1.ToString(); 20 | } 21 | 22 | // get results in ms 23 | stopwatch.Stop (); 24 | Debug.LogFormat ( "Timer: {0} ms", stopwatch.ElapsedMilliseconds ); 25 | stopwatch.Reset (); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Assets/Scripts/Helpers/Debug/Timer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0a04997683d5b6b459caa6cdfb9df9cc 3 | timeCreated: 1500793400 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Helpers/Debug/WhoDisabledOrEnabled.cs: -------------------------------------------------------------------------------- 1 | // shows who disabled/enabled this gameobject from another script 2 | // usage: attach to gameobject that you want to track (see console stack trace) 3 | 4 | using UnityEngine; 5 | 6 | namespace UnityLibrary 7 | { 8 | public class WhoDisabledOrEnabled : MonoBehaviour 9 | { 10 | private void OnDisable() 11 | { 12 | Debug.LogError("OnDisable: " + gameObject.name, gameObject); 13 | } 14 | 15 | private void OnEnable() 16 | { 17 | Debug.LogError("OnEnable: " + gameObject.name, gameObject); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Assets/Scripts/Helpers/Debug/WhoDisabledOrEnabled.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c69c0e5bff195b040b1c86515b454544 3 | timeCreated: 1594958194 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Helpers/DrawGLLine.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | // Draws lines with GL : https://docs.unity3d.com/ScriptReference/GL.html 4 | // Usage: Attach this script to gameobject in scene 5 | namespace UnityLibrary 6 | { 7 | public class DrawGLLine : MonoBehaviour 8 | { 9 | public Color lineColor = Color.red; 10 | 11 | Material lineMaterial; 12 | 13 | void Awake() 14 | { 15 | // must be called before trying to draw lines.. 16 | CreateLineMaterial(); 17 | } 18 | 19 | void CreateLineMaterial() 20 | { 21 | // Unity has a built-in shader that is useful for drawing simple colored things 22 | var shader = Shader.Find("Hidden/Internal-Colored"); 23 | lineMaterial = new Material(shader); 24 | lineMaterial.hideFlags = HideFlags.HideAndDontSave; 25 | // Turn on alpha blending 26 | lineMaterial.SetInt("_SrcBlend", (int)UnityEngine.Rendering.BlendMode.SrcAlpha); 27 | lineMaterial.SetInt("_DstBlend", (int)UnityEngine.Rendering.BlendMode.OneMinusSrcAlpha); 28 | // Turn backface culling off 29 | lineMaterial.SetInt("_Cull", (int)UnityEngine.Rendering.CullMode.Off); 30 | // Turn off depth writes 31 | lineMaterial.SetInt("_ZWrite", 0); 32 | } 33 | 34 | 35 | // cannot call this on update, line wont be visible then.. and if used OnPostRender() thats works when attached to camera only 36 | void OnRenderObject() 37 | { 38 | lineMaterial.SetPass(0); 39 | 40 | GL.PushMatrix(); 41 | GL.MultMatrix(transform.localToWorldMatrix); 42 | 43 | GL.Begin(GL.LINES); 44 | GL.Color(lineColor); 45 | // start line from transform position 46 | GL.Vertex(transform.position); 47 | // end line 100 units forward from transform position 48 | GL.Vertex(transform.position + transform.forward * 100); 49 | 50 | GL.End(); 51 | GL.PopMatrix(); 52 | } 53 | } 54 | } -------------------------------------------------------------------------------- /Assets/Scripts/Helpers/DrawGLLine.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 95e3fc76aa41bf24089dcc6d549d0945 3 | timeCreated: 1500793403 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Helpers/DrawRendererBounds.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | // draws mesh renderer bounding box using Debug.Drawline 4 | namespace UnityLibrary 5 | { 6 | public class DrawRendererBounds : MonoBehaviour 7 | { 8 | MeshRenderer meshRenderer; 9 | 10 | void Awake() 11 | { 12 | meshRenderer = GetComponent(); 13 | } 14 | 15 | 16 | void Update() 17 | { 18 | var b = meshRenderer.bounds; 19 | 20 | // bottom 21 | var p1 = new Vector3(b.min.x, b.min.y, b.min.z); 22 | var p2 = new Vector3(b.max.x, b.min.y, b.min.z); 23 | var p3 = new Vector3(b.max.x, b.min.y, b.max.z); 24 | var p4 = new Vector3(b.min.x, b.min.y, b.max.z); 25 | 26 | Debug.DrawLine(p1, p2, Color.blue); 27 | Debug.DrawLine(p2, p3, Color.red); 28 | Debug.DrawLine(p3, p4, Color.yellow); 29 | Debug.DrawLine(p4, p1, Color.magenta); 30 | 31 | // top 32 | var p5 = new Vector3(b.min.x, b.max.y, b.min.z); 33 | var p6 = new Vector3(b.max.x, b.max.y, b.min.z); 34 | var p7 = new Vector3(b.max.x, b.max.y, b.max.z); 35 | var p8 = new Vector3(b.min.x, b.max.y, b.max.z); 36 | 37 | Debug.DrawLine(p5, p6, Color.blue); 38 | Debug.DrawLine(p6, p7, Color.red); 39 | Debug.DrawLine(p7, p8, Color.yellow); 40 | Debug.DrawLine(p8, p5, Color.magenta); 41 | 42 | // sides 43 | Debug.DrawLine(p1, p5, Color.white); 44 | Debug.DrawLine(p2, p6, Color.gray); 45 | Debug.DrawLine(p3, p7, Color.green); 46 | Debug.DrawLine(p4, p8, Color.cyan); 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /Assets/Scripts/Helpers/DrawRendererBounds.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c54e110ad2490d9418390c4fa6ff8c98 3 | timeCreated: 1500793403 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Helpers/Drawing.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dc1b64f3b947fe84796b604938b6c54b 3 | folderAsset: yes 4 | timeCreated: 1500793397 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scripts/Helpers/Drawing/DrawCrossHair.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | // Draws crosshair to mouseposition with GL.Lines, takes line length in pixels 5 | // Usage: Attach this script to Main Camera, Assign material (for example some particle shader) 6 | namespace UnityLibrary 7 | { 8 | public class DrawCrossHair : MonoBehaviour 9 | { 10 | public Material mat; 11 | public float lineLen = 5f; // in pixels 12 | 13 | Vector3 mousePos; 14 | float lineLenHorizontal; 15 | float lineLenVertical; 16 | 17 | void Awake() 18 | { 19 | // if you want to adjust lineLen at runtime, would need to calculate these again 20 | lineLenHorizontal = lineLen / Screen.width; 21 | lineLenVertical = lineLen / Screen.height; 22 | } 23 | 24 | void Update() 25 | { 26 | mousePos = Input.mousePosition; 27 | mousePos.x /= Screen.width; 28 | mousePos.y /= Screen.height; 29 | } 30 | 31 | void OnPostRender() 32 | { 33 | GL.PushMatrix(); 34 | mat.SetPass(0); 35 | GL.LoadOrtho(); 36 | GL.Begin(GL.LINES); 37 | GL.Color(Color.white); 38 | GL.Vertex(new Vector3(mousePos.x, mousePos.y - lineLenVertical, 0)); 39 | GL.Vertex(new Vector3(mousePos.x, mousePos.y + lineLenVertical, 0)); 40 | GL.Vertex(new Vector3(mousePos.x - lineLenHorizontal, mousePos.y, 0)); 41 | GL.Vertex(new Vector3(mousePos.x + lineLenHorizontal, mousePos.y, 0)); 42 | GL.End(); 43 | GL.PopMatrix(); 44 | } 45 | } 46 | } -------------------------------------------------------------------------------- /Assets/Scripts/Helpers/Drawing/DrawCrossHair.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 54f5f83ac4d434d4483d8af67fa6507c 3 | timeCreated: 1500793401 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Helpers/FPSCounter.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | namespace UnityLibrary 3 | { 4 | public class FPSCounter : MonoBehaviour 5 | { 6 | [SerializeField] 7 | private float updateInterval = 0.1f; 8 | 9 | private float accum = 0.0f; 10 | private int frames = 0; 11 | private float timeleft; 12 | 13 | int qty; 14 | 15 | float fps; 16 | float avgFps; 17 | 18 | void Update() 19 | { 20 | timeleft -= Time.deltaTime; 21 | accum += Time.timeScale / Time.deltaTime; 22 | ++frames; 23 | 24 | if (timeleft <= 0.0) 25 | { 26 | fps = (accum / frames); 27 | timeleft = updateInterval; 28 | accum = 0f; 29 | frames = 0; 30 | } 31 | 32 | qty++; 33 | 34 | avgFps += (fps - avgFps) / qty; 35 | } 36 | 37 | void OnGUI() 38 | { 39 | GUI.Label(new Rect(Screen.width - 150, 0, 150, 20), "FPS: " + fps.ToString("f2")); 40 | GUI.Label(new Rect(Screen.width - 150, 20, 150, 20), "Avg FPS: " + avgFps.ToString("f2")); 41 | } 42 | 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Assets/Scripts/Helpers/FPSCounter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8992bbf361e600a419f30454b6113634 3 | timeCreated: 1500793402 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Helpers/FileSystem.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3f5edf9425760c84d8dab63f73e53638 3 | folderAsset: yes 4 | timeCreated: 1500793396 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scripts/Helpers/FileSystem/FileSystemWatch.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using UnityEngine; 5 | 6 | // watches specified folder changes in the filesystem 7 | // "Listens to the file system change notifications and raises events when a directory, or file in a directory, changes." 8 | // references: http://stackoverflow.com/questions/15017506/using-filesystemwatcher-to-monitor-a-directory and http://www.c-sharpcorner.com/article/monitoring-file-system-using-filesystemwatcher-class-part1/ 9 | 10 | public class FileSystemWatch : MonoBehaviour 11 | { 12 | string myPath = "c:\\myfolder\\"; 13 | FileSystemWatcher watcher; 14 | 15 | void Start() 16 | { 17 | InitFileSystemWatcher(); 18 | } 19 | 20 | private void InitFileSystemWatcher() 21 | { 22 | watcher = new FileSystemWatcher(); 23 | watcher.Path = myPath; 24 | watcher.NotifyFilter = NotifyFilters.LastAccess | NotifyFilters.LastWrite | NotifyFilters.FileName | NotifyFilters.DirectoryName; 25 | watcher.Filter = "*.*"; 26 | 27 | //Handler for Changed Event 28 | watcher.Changed += new FileSystemEventHandler(FileChanged); 29 | //Handler for Created Event 30 | watcher.Created += new FileSystemEventHandler(FileCreated); 31 | //Handler for Deleted Event 32 | watcher.Deleted += new FileSystemEventHandler(FileDeleted); 33 | //Handler for Renamed Event 34 | watcher.Renamed += new RenamedEventHandler(FileRenamed); 35 | 36 | watcher.EnableRaisingEvents = true; 37 | } 38 | 39 | private void FileChanged(object source, FileSystemEventArgs e) 40 | { 41 | Debug.Log("FileChanged:" + e.FullPath); 42 | } 43 | 44 | private void FileCreated(object source, FileSystemEventArgs e) 45 | { 46 | Debug.Log("FileCreated:" + e.FullPath); 47 | } 48 | 49 | private void FileDeleted(object source, FileSystemEventArgs e) 50 | { 51 | Debug.Log("FileDeleted:" + e.FullPath); 52 | } 53 | 54 | private void FileRenamed(object source, FileSystemEventArgs e) 55 | { 56 | Debug.Log("FileChanged:" + e.FullPath); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /Assets/Scripts/Helpers/FileSystem/FileSystemWatch.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2ef04d2ffb61ab14c8622e026828e447 3 | timeCreated: 1500793401 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Helpers/FileSystem/OpenExternalFile.cs: -------------------------------------------------------------------------------- 1 | // opens external file in default viewer for that filetype 2 | // for example: powerpoint file would open in powerpoint 3 | 4 | using UnityEngine; 5 | using System.Collections; 6 | using System.IO; 7 | using System.Diagnostics; 8 | using System; 9 | using Debug = UnityEngine.Debug; 10 | namespace UnityLibrary 11 | { 12 | public class OpenExternalFile : MonoBehaviour 13 | { 14 | 15 | // opens external file in default viewer 16 | public static void OpenFile(string fullPath) 17 | { 18 | Debug.Log("opening:" + fullPath); 19 | 20 | if (File.Exists(fullPath)) 21 | { 22 | try 23 | { 24 | Process myProcess = new Process(); 25 | myProcess.StartInfo.FileName = fullPath; 26 | myProcess.Start(); 27 | // myProcess.WaitForExit(); 28 | } 29 | catch (Exception e) 30 | { 31 | Debug.Log(e); 32 | } 33 | } 34 | } 35 | } 36 | } -------------------------------------------------------------------------------- /Assets/Scripts/Helpers/FileSystem/OpenExternalFile.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 81def09443d40044295eebf503e1398e 3 | timeCreated: 1500793402 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Helpers/Screenshot.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 85fd4ff8eea2d1844aa2d78c3927ae08 3 | folderAsset: yes 4 | timeCreated: 1500793397 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scripts/Helpers/Screenshot/GrabDesktop.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | using Application = UnityEngine.Application; 4 | using System; 5 | using System.Runtime.InteropServices; 6 | 7 | // Drag windows desktop image using System.Drawing.dll 8 | // guide on using System.Drawing.dll in unity : http://answers.unity3d.com/answers/253571/view.html 9 | 10 | /// 11 | /// Instructions: 12 | /// 1.- Uncomment the code below 13 | /// 2.- Create a "Plugins" folder in your project 14 | /// 3.- Import the System.Drawing.dll and System.Windows.Forms.dll from Unity_Location\Editor\Data\Mono\lib\mono\2.0 15 | /// 16 | 17 | //Uncomment this: 18 | 19 | /* 20 | //using System.Windows.Forms.Screen; 21 | //using System.Drawing; 22 | //using System.Drawing.Imaging; 23 | namespace UnityLibrary{ 24 | public class GrabDesktop : MonoBehaviour 25 | { 26 | [DllImport("kernel32", SetLastError = true)] 27 | static extern IntPtr LoadLibrary(string lpFileName); 28 | 29 | static bool CheckLibrary(string fileName) 30 | { 31 | return LoadLibrary(fileName) == IntPtr.Zero; 32 | } 33 | private void Start() 34 | { 35 | try 36 | { 37 | // screenshot source: http://stackoverflow.com/a/363008/5452781 38 | 39 | //Create a new bitmap. 40 | var bmpScreenshot = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height, PixelFormat.Format32bppArgb); 41 | 42 | // Create a graphics object from the bitmap. 43 | var gfxScreenshot = System.Drawing.Graphics.FromImage(bmpScreenshot); 44 | 45 | // Take the screenshot from the upper left corner to the right bottom corner. 46 | gfxScreenshot.CopyFromScreen(Screen.PrimaryScreen.Bounds.X, Screen.PrimaryScreen.Bounds.Y, 0, 0, Screen.PrimaryScreen.Bounds.Size, CopyPixelOperation.SourceCopy); 47 | 48 | // Save the screenshot to the specified path that the user has chosen. 49 | bmpScreenshot.Save(Application.dataPath + "/Screenshot.png", ImageFormat.Png); 50 | }catch(Exception e) { 51 | Debug.LogError("You must import the dll to the project, refer to the instructions in the Script for more details"); 52 | } 53 | 54 | } 55 | } 56 | } 57 | */ 58 | -------------------------------------------------------------------------------- /Assets/Scripts/Helpers/Screenshot/GrabDesktop.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0dd4e41efe19d45448977b6c170111d4 3 | timeCreated: 1500793400 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Helpers/String.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7a597f7452455c84bbe8aae4cbf2c88b 3 | folderAsset: yes 4 | timeCreated: 1500793397 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scripts/Helpers/String/StringOperationUtil.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f19d41dbf283f0a468253c77d8342784 3 | timeCreated: 1500793404 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Helpers/Version.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c9f673795c933264c8ded10a0f788f3e 3 | folderAsset: yes 4 | timeCreated: 1500793397 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scripts/Helpers/Version/GetVersion.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEngine.UI; 3 | 4 | // Usage: attach this to UI Text component 5 | // it displays current version number from Ios/Android player settings with Application.version 6 | namespace UnityLibrary 7 | { 8 | public class GetVersion : MonoBehaviour 9 | { 10 | void Awake() 11 | { 12 | var t = GetComponent(); 13 | if (t != null) 14 | { 15 | t.text = "v" + Application.version; 16 | } 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /Assets/Scripts/Helpers/Version/GetVersion.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6af499f915b5766429800fedfe008b72 3 | timeCreated: 1500793402 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Helpers/Windows/WindowAlwaysOnTop.cs: -------------------------------------------------------------------------------- 1 | // keep executable window always on top, good for multiplayer testing 2 | 3 | using System; 4 | using System.Runtime.InteropServices; 5 | using UnityEngine; 6 | 7 | namespace UnityLibrary 8 | { 9 | public class WindowAlwaysOnTop : MonoBehaviour 10 | { 11 | #if !UNITY_STANDALONE_LINUX 12 | 13 | // https://stackoverflow.com/a/34703664/5452781 14 | private static readonly IntPtr HWND_TOPMOST = new IntPtr(-1); 15 | private const UInt32 SWP_NOSIZE = 0x0001; 16 | private const UInt32 SWP_NOMOVE = 0x0002; 17 | private const UInt32 TOPMOST_FLAGS = SWP_NOMOVE | SWP_NOSIZE; 18 | 19 | [DllImport("user32.dll")] 20 | [return: MarshalAs(UnmanagedType.Bool)] 21 | public static extern bool SetWindowPos(IntPtr hWnd, IntPtr hWndInsertAfter, int X, int Y, int cx, int cy, uint uFlags); 22 | 23 | // https://forum.unity.com/threads/unity-window-handle.115364/#post-1650240 24 | [DllImport("user32.dll")] 25 | private static extern IntPtr GetActiveWindow(); 26 | 27 | public static IntPtr GetWindowHandle() 28 | { 29 | return GetActiveWindow(); 30 | } 31 | #endif 32 | 33 | void Awake() 34 | { 35 | // TODO save current window pos to player prefs on exit, then can open into same position next time 36 | #if !UNITY_EDITOR && !UNITY_STANDALONE_LINUX 37 | Debug.Log("Make window stay on top"); 38 | SetWindowPos(GetActiveWindow(), HWND_TOPMOST, 0, 0, 0, 0, TOPMOST_FLAGS); 39 | #endif 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Assets/Scripts/ImageEffects.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 515803c91c2131040af4bfa75af4ad38 3 | folderAsset: yes 4 | timeCreated: 1500793395 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scripts/ImageEffects/GrayscaleLayers.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5edc2eab7c433e047b19d869fe66b021 3 | timeCreated: 1500793402 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Mesh.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 14b294f417b66d44a87b73ca589bca2f 3 | folderAsset: yes 4 | timeCreated: 1594958189 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scripts/Mesh/Metaball.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f055b957fef29374d98e499595efe8c3 3 | timeCreated: 1594958194 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Misc.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 265af611d5d54e943985362e12ef25f2 3 | folderAsset: yes 4 | timeCreated: 1500793394 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scripts/Misc/Messaging.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 14a931c0152878540a9389097c2fcc9e 3 | folderAsset: yes 4 | timeCreated: 1500793396 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scripts/Misc/Messaging/Callback.cs: -------------------------------------------------------------------------------- 1 | public delegate void Callback(); 2 | public delegate void Callback(T arg1); 3 | public delegate void Callback(T arg1, U arg2); 4 | public delegate void Callback(T arg1, U arg2, V arg3); -------------------------------------------------------------------------------- /Assets/Scripts/Misc/Messaging/Callback.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5f8b822e50df6a24f8f2bcdb234e3e5a 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/Scripts/Misc/Messaging/Messenger.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cd9a8c4f314d1534c8f40f201c6dd894 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/Scripts/Misc/Messaging/MessengerUnitTest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1c5fc54965e707f408810d9d0d2df2eb 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/Scripts/Misc/Messaging/README.md: -------------------------------------------------------------------------------- 1 | * SendMessage substitute for global messaging without object references; 2 | * To subscribe to event, one must AddListener to event string and provide a callback method (f.e. OnEnable ); 3 | * To unsubscribe to event, one must RemoveListener to event string and provide a callback method (f.e. OnDisable ); 4 | -------------------------------------------------------------------------------- /Assets/Scripts/Misc/Messaging/README.md.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 20e4e9786c8ffd140982a4cc0be76dfb 3 | timeCreated: 1500793397 4 | licenseType: Free 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Scripts/Misc/MeteorRing.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | // Usage: Attach to gameobject (enable gizmos to see Debug.DrawRay()) 5 | // reference: http://forum.unity3d.com/threads/procedural-generation-in-a-specific-shape-question.421659/ 6 | namespace UnityLibrary 7 | { 8 | public class MeteorRing : MonoBehaviour 9 | { 10 | public int totalCount = 5000; 11 | public float ringRadius = 10; 12 | public float ringHeight = 1; 13 | 14 | void Start() 15 | { 16 | for (int i = 0; i < totalCount; i++) 17 | { 18 | // outer ring 19 | float angle = i * (Mathf.PI * 2) / totalCount; 20 | var x = Mathf.Sin(angle) * ringRadius; 21 | var y = Mathf.Cos(angle) * ringRadius; 22 | var pos = new Vector3(x, 0, y); 23 | 24 | // spread within outer ring 25 | pos += Random.insideUnitSphere * ringHeight; 26 | 27 | // draw 28 | Debug.DrawRay(pos, Vector3.up * 0.05f, Color.yellow, 100); 29 | } 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Assets/Scripts/Misc/MeteorRing.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3f41ba8b090d5494b9cd0abb0d73b17e 3 | timeCreated: 1500793401 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Misc/TexturePixels2Quads.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | // Usage: 5 | // - assign texture (that has [x] read/write enabled in inspector 6 | // - assign Quad mesh (prefab) to planePrefab. You can assign Unlit/Color material to the quad prefab first. 7 | namespace UnityLibrary 8 | { 9 | public class TexturePixels2Quads : MonoBehaviour 10 | { 11 | public Texture2D tex; 12 | public Renderer planePrefab; 13 | 14 | void Start() 15 | { 16 | for (int x = 0; x < tex.width; x++) 17 | { 18 | for (int y = 0; y < tex.height; y++) 19 | { 20 | var c = tex.GetPixel(x, y); 21 | var pos = new Vector3(x, y, 0); 22 | var plane = Instantiate(planePrefab, pos, Quaternion.identity) as Renderer; 23 | plane.material.color = c; 24 | } 25 | } 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /Assets/Scripts/Misc/TexturePixels2Quads.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 08b5cc9c62b05af448a31c6d2d020701 3 | timeCreated: 1500793399 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/ObjectPooling/IPoolActions.cs: -------------------------------------------------------------------------------- 1 | namespace UnityHelper.Pooling 2 | { 3 | /// 4 | /// Interface to remind you to add the return to pool function 5 | /// 6 | public interface IPoolActions 7 | { 8 | void ReturnObjectToPool(); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Assets/Scripts/ObjectPooling/IPoolActions.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3e21db0c60302f24b927bcadd6fc6112 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Scripts/ObjectPooling/Images/Initialization.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UnityCommunity/UnityLibrary/540d629be475e7e984b893013a5634c725c3ad74/Assets/Scripts/ObjectPooling/Images/Initialization.PNG -------------------------------------------------------------------------------- /Assets/Scripts/ObjectPooling/Images/PoolObject.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UnityCommunity/UnityLibrary/540d629be475e7e984b893013a5634c725c3ad74/Assets/Scripts/ObjectPooling/Images/PoolObject.PNG -------------------------------------------------------------------------------- /Assets/Scripts/ObjectPooling/Images/PoolObjectLook.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UnityCommunity/UnityLibrary/540d629be475e7e984b893013a5634c725c3ad74/Assets/Scripts/ObjectPooling/Images/PoolObjectLook.PNG -------------------------------------------------------------------------------- /Assets/Scripts/ObjectPooling/Images/SpawnObject.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UnityCommunity/UnityLibrary/540d629be475e7e984b893013a5634c725c3ad74/Assets/Scripts/ObjectPooling/Images/SpawnObject.PNG -------------------------------------------------------------------------------- /Assets/Scripts/ObjectPooling/Pool.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fa158cddf415eb0449d203dbd26ec022 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Scripts/ObjectPooling/PoolObject.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using UnityEngine; 7 | 8 | namespace UnityHelper.Pooling 9 | { 10 | [Serializable] 11 | public class PoolObject 12 | { 13 | /// 14 | /// The gameobject that you want to spawn 15 | /// 16 | public GameObject obj_to_pool; 17 | /// 18 | /// The amount of objects that you want to spawn 19 | /// 20 | public int amount_to_pool; 21 | } 22 | } -------------------------------------------------------------------------------- /Assets/Scripts/ObjectPooling/PoolObject.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b201e930468ede54195a559247b03027 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Scripts/ObjectPooling/README.md.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 39978d1555c9ede47adb909257a1bb01 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Scripts/README.md: -------------------------------------------------------------------------------- 1 | # Scripts 2 | The game logic. the most important part of game development. 3 | 4 | Do you want to make a car? do you try to invent the Wheel from the beginning? no one do it. 5 | 6 | So we have gathered pre made ready-to-use scripts here just for you. 7 | 8 | If you have experienced any errors or problems, [send it to us](https://github.com/UnityCommunity/UnityLibrary/issues), we are here to help. 9 | 10 | ## License 11 | [MIT](https://github.com/UnityCommunity/UnityLibrary/blob/master/LICENSE.md) @ [Unity Community](https://github.com/UnityCommunity/) 12 | 13 | Made with :heart: by [Unity Community](https://github.com/UnityCommunity/) 14 | -------------------------------------------------------------------------------- /Assets/Scripts/README.md.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3769a76ec6f190546995c89726eaf150 3 | timeCreated: 1500793394 4 | licenseType: Free 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Scripts/Serialization.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9f168be270e83ad41bcba642d638e64e 3 | folderAsset: yes 4 | timeCreated: 1501219232 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scripts/Serialization/Color32Serializable.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 061cb47411476a94d8f5231532065360 3 | timeCreated: 1501219363 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Serialization/ColorSerializable.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3b3f6bf5ffa85a94a844cd82e24937d5 3 | timeCreated: 1501219355 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Serialization/MeshSerializable.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cefc979bdf83eee4f9f3bc6cae4700a8 3 | timeCreated: 1501219306 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Serialization/QuaternionSerializable.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0478a8da07814774989772b1065d060b 3 | timeCreated: 1501219344 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Serialization/Vector2Serializable.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fba189e2785c0d044acb994360e29d47 3 | timeCreated: 1501219297 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Serialization/Vector3Serializable.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6c5e14b336560c043bf6176b01621604 3 | timeCreated: 1501219289 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Serialization/Vector4Serializable.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fb0c350f61853c243946e31479fabb1e 3 | timeCreated: 1501219243 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/StandardAssets.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 68d0fff757765464085386ad8f2ba1a3 3 | folderAsset: yes 4 | timeCreated: 1500793395 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scripts/StandardAssets/Effects.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e4f90274a4ad23c45acb3f913c13ede9 3 | folderAsset: yes 4 | timeCreated: 1500793397 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scripts/StandardAssets/Effects/ImageEffects.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2260bfb777ab88a499b7f61f535056b9 3 | folderAsset: yes 4 | timeCreated: 1500793397 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scripts/StandardAssets/Effects/ImageEffects/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 33b3dd2e4d992da4695f9520dbb410bc 3 | folderAsset: yes 4 | timeCreated: 1500793398 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scripts/StandardAssets/Effects/ImageEffects/Scripts/ColorCorrectionCurvesLayers.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2e50bcdf16588814ca6defae8b5d7dd4 3 | timeCreated: 1500793401 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Texture.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 21723003e773f1d44a6ff8203e46f395 3 | folderAsset: yes 4 | timeCreated: 1594958189 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scripts/Texture/GradientTextureMaker.cs: -------------------------------------------------------------------------------- 1 | // returns gradient Texture2D (size=256x1) 2 | 3 | using UnityEngine; 4 | 5 | namespace UnityLibrary 6 | { 7 | public static class GradientTextureMaker 8 | { 9 | const int width = 256; 10 | const int height = 1; 11 | 12 | public static Texture2D Create(Color[] colors, TextureWrapMode textureWrapMode = TextureWrapMode.Clamp, FilterMode filterMode = FilterMode.Point, bool isLinear = false, bool hasMipMap = false) 13 | { 14 | if (colors == null || colors.Length == 0) 15 | { 16 | Debug.LogError("No colors assigned"); 17 | return null; 18 | } 19 | 20 | int length = colors.Length; 21 | if (colors.Length > 8) 22 | { 23 | Debug.LogWarning("Too many colors! maximum is 8, assigned: " + colors.Length); 24 | length = 8; 25 | } 26 | 27 | // build gradient from colors 28 | var colorKeys = new GradientColorKey[length]; 29 | var alphaKeys = new GradientAlphaKey[length]; 30 | 31 | float steps = length - 1f; 32 | for (int i = 0; i < length; i++) 33 | { 34 | float step = i / steps; 35 | colorKeys[i].color = colors[i]; 36 | colorKeys[i].time = step; 37 | alphaKeys[i].alpha = colors[i].a; 38 | alphaKeys[i].time = step; 39 | } 40 | 41 | // create gradient 42 | Gradient gradient = new Gradient(); 43 | gradient.SetKeys(colorKeys, alphaKeys); 44 | 45 | // create texture 46 | Texture2D outputTex = new Texture2D(width, height, TextureFormat.ARGB32, false, isLinear); 47 | outputTex.wrapMode = textureWrapMode; 48 | outputTex.filterMode = filterMode; 49 | 50 | // draw texture 51 | for (int i = 0; i < width; i++) 52 | { 53 | outputTex.SetPixel(i, 0, gradient.Evaluate((float)i / (float)width)); 54 | } 55 | outputTex.Apply(false); 56 | 57 | return outputTex; 58 | } // BuildGradientTexture 59 | 60 | } // class 61 | } // namespcae 62 | -------------------------------------------------------------------------------- /Assets/Scripts/Texture/GradientTextureMaker.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8fd686556c4ac49449e619d0aa69b9da 3 | timeCreated: 1594958194 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Texture/WebCamDisplay.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | // usage: attach this script to any gameobject in which you want to render the webcam display 6 | // create a material, use Unlit/Texture as a shader and place it to the gameobject's material placeholder in the mesh renderer component 7 | 8 | namespace UnityLibrary 9 | { 10 | public class WebCamDisplay : MonoBehaviour 11 | { 12 | void Start() 13 | { 14 | WebCamTexture webCam = new WebCamTexture(); 15 | webCam.deviceName = WebCamTexture.devices[0].name; 16 | this.GetComponent().material.mainTexture = webCam; 17 | webCam.Play(); 18 | } 19 | } 20 | } 21 | 22 | -------------------------------------------------------------------------------- /Assets/Scripts/Texture/WebCamDisplay.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c15440579c94fd245b85260bce402884 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Scripts/Threading.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0b51762ded3cb9b4da62090d1c50dc40 3 | folderAsset: yes 4 | timeCreated: 1500793393 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scripts/Threading/ThreadPoolTest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2d665831a9a905f4ca438b12feeb15c4 3 | timeCreated: 1500793401 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Tools.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4887b891f87d1bc47a7ae210331d1ea7 3 | folderAsset: yes 4 | timeCreated: 1594958190 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scripts/Tools/TerrainTreeReplacer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 91b800e4892ad554dbc156f9543e2402 3 | timeCreated: 1594958194 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/UI.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 57b254d4ae25bfb42a2a6d85c3e1b3b2 3 | folderAsset: yes 4 | timeCreated: 1501227572 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scripts/UI/Animation.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b234f75726460ce46b93b19b770c8385 3 | folderAsset: yes 4 | timeCreated: 1594958190 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scripts/UI/Animation/GrowEffect.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4cc1ed66c8e377c40a814dec093b6f2e 3 | timeCreated: 1594958193 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/UI/Animation/HelicopterGrowEffect.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | public class HelicopterGrowEffect : MonoBehaviour 6 | { 7 | [Header("Configuration")] 8 | [Tooltip("The desired Scale to reach")] 9 | [SerializeField] float m_desiredScale = 1.0f; 10 | [Tooltip("How much time it will take to reach the desired scale")] 11 | [SerializeField] float m_timeToReachDesiredScale = 1.0f; 12 | [Tooltip("How fast the helicopter effect will spin")] 13 | [SerializeField] float m_rotationSpeed = 2.0f; 14 | [Tooltip("the angle of rotation per frame")] 15 | [SerializeField] float m_rotationAngle = 10.0f; 16 | 17 | //private member variables 18 | private float m_currentTime = 0.0f; 19 | private Quaternion startingRotation = Quaternion.identity; 20 | 21 | private void OnEnable() 22 | { 23 | m_currentTime = 0.0f; 24 | //set the base transform to 0 so it can grow 25 | transform.localScale = Vector3.zero; 26 | //set the staring rotation variable to the current rotation 27 | startingRotation = transform.rotation; 28 | 29 | } 30 | 31 | void Update() 32 | { 33 | //increment current time by delta time 34 | m_currentTime += Time.deltaTime; 35 | if (m_currentTime <= m_timeToReachDesiredScale) 36 | { 37 | //rotate the object by the rotation angle and rotation speed 38 | gameObject.transform.Rotate(Vector3.forward, (m_rotationAngle * (m_rotationSpeed * Time.deltaTime))); 39 | //lerp the scale to the desired scale 40 | gameObject.transform.localScale = (Vector3.one * Mathf.LerpUnclamped(0, m_desiredScale, Interpolation.ElasticInOut(m_currentTime/m_timeToReachDesiredScale))); 41 | //leave the function 42 | return; 43 | } 44 | else 45 | { 46 | //when the lerping is done set the rotation to the starting rotation 47 | gameObject.transform.rotation = startingRotation; 48 | //set the scale to the desired scale 49 | gameObject.transform.localScale = Vector3.one * m_desiredScale; 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /Assets/Scripts/UI/Animation/HelicopterGrowEffect.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0e6ad0b8ea027294985b17ecc5ae35b0 3 | timeCreated: 1594958193 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/UI/Animation/ImageFade.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b538d7b1930f56747a8f9bb73ad5c33b 3 | timeCreated: 1594958194 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/UI/Animation/LerpFromOffset.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f461de9f20f87e64ea1c52f11e14a559 3 | timeCreated: 1594958195 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/UI/Animation/Shared.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4318a6e62d3fa9b4e80b0a7ce121d0f3 3 | folderAsset: yes 4 | timeCreated: 1594958191 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scripts/UI/Animation/Shared/Interpolation.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0bafe5c15fee7b64f84801f9b22ff905 3 | timeCreated: 1594958193 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/UI/SetSelected.cs: -------------------------------------------------------------------------------- 1 | // sets UI element selected 2 | // usage: attach to gameobject with UI selectable component (inputfield, button, dropdown. toggle..) 3 | 4 | using UnityEngine; 5 | using UnityEngine.UI; 6 | 7 | namespace UnityLibrary 8 | { 9 | public class SetSelected : MonoBehaviour 10 | { 11 | void Start() 12 | { 13 | var element = GetComponent(); 14 | 15 | if (element != null && element.interactable == true) 16 | { 17 | element.Select(); 18 | } else 19 | { 20 | Debug.LogWarning("Nothing to set selected..", gameObject); 21 | } 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Assets/Scripts/UI/SetSelected.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e262bedb4c989c241a0fe7a4764cabb1 3 | timeCreated: 1501227572 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Utilities.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 19c151059837e8743b47a51a8f572228 3 | folderAsset: yes 4 | timeCreated: 1511611013 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scripts/Utilities/SaveUtility.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7d8aad24cf3d7485c9507bf763b79d42 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Scripts/Utilities/Singleton.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | public abstract class Singleton : MonoBehaviour where T : Component 6 | { 7 | 8 | #region Fields 9 | 10 | /// 11 | /// The instance. 12 | /// 13 | private static T instance; 14 | 15 | #endregion 16 | 17 | #region Properties 18 | 19 | /// 20 | /// Gets the instance. 21 | /// 22 | /// The instance. 23 | public static T Instance 24 | { 25 | get 26 | { 27 | if ( instance == null ) 28 | { 29 | instance = FindObjectOfType (); 30 | if ( instance == null ) 31 | { 32 | GameObject obj = new GameObject (); 33 | obj.name = typeof ( T ).Name; 34 | instance = obj.AddComponent (); 35 | } 36 | } 37 | return instance; 38 | } 39 | } 40 | 41 | #endregion 42 | 43 | #region Methods 44 | 45 | /// 46 | /// Use this for initialization. 47 | /// 48 | protected virtual void Awake () 49 | { 50 | if ( instance == null ) 51 | { 52 | instance = this as T; 53 | DontDestroyOnLoad ( gameObject ); 54 | } 55 | else 56 | { 57 | Destroy ( gameObject ); 58 | } 59 | } 60 | 61 | #endregion 62 | 63 | } 64 | -------------------------------------------------------------------------------- /Assets/Scripts/Utilities/Singleton.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 95550a6b3e0eebd49a11850ed416e9d9 3 | timeCreated: 1511611021 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Shaders.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0341514ed0c04a14eb37ae0d2aa774d4 3 | folderAsset: yes 4 | timeCreated: 1500793393 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Shaders/2D.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 99d7fe7c82d52b245bb4ff8844118c1f 3 | folderAsset: yes 4 | timeCreated: 1511612925 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Shaders/2D/Debug.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 31f63f34ba5d21c4d8ad3c2a63a85220 3 | folderAsset: yes 4 | timeCreated: 1594958190 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Shaders/2D/Debug/HSVDebugger.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3454bedd801ec8049958fc2054f6265e 3 | timeCreated: 1594958198 4 | licenseType: Free 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Shaders/2D/Effects.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4f49c823d2cc1c84eb8af77dcc706003 3 | folderAsset: yes 4 | timeCreated: 1500793395 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Shaders/2D/Effects/ColorCycle.shader: -------------------------------------------------------------------------------- 1 | Shader "UnityLibrary/2D/Effects/ColorCycle" 2 | { 3 | Properties 4 | { 5 | _MainTex ("Grayscale", 2D) = "white" {} 6 | _GradientTex ("Gradient", 2D) = "white" {} 7 | _Speed("Speed",float) = 1 8 | } 9 | 10 | SubShader 11 | { 12 | Tags { "RenderType"="Opaque" } 13 | LOD 100 14 | 15 | Pass 16 | { 17 | CGPROGRAM 18 | #pragma vertex vert 19 | #pragma fragment frag 20 | 21 | #include "UnityCG.cginc" 22 | 23 | struct appdata 24 | { 25 | float4 vertex : POSITION; 26 | float2 uv : TEXCOORD0; 27 | }; 28 | 29 | struct v2f 30 | { 31 | float2 uv : TEXCOORD0; 32 | float4 vertex : SV_POSITION; 33 | }; 34 | 35 | sampler2D _MainTex; 36 | sampler2D _GradientTex; 37 | float4 _MainTex_ST; 38 | float _Speed; 39 | 40 | v2f vert (appdata v) 41 | { 42 | v2f o; 43 | o.vertex = UnityObjectToClipPos(v.vertex); 44 | o.uv = TRANSFORM_TEX(v.uv, _MainTex); 45 | return o; 46 | } 47 | 48 | fixed4 frag (v2f i) : SV_Target 49 | { 50 | // get (grayscale texture) pixel color 51 | float gray = tex2D(_MainTex, i.uv).r; 52 | 53 | // get scrolling 54 | float scroll = frac(gray + _Time.x*_Speed); 55 | 56 | // get gradient color from texture 57 | fixed4 col = tex2D(_GradientTex,float2(scroll,0.5)); 58 | 59 | return col; 60 | } 61 | ENDCG 62 | } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /Assets/Shaders/2D/Effects/ColorCycle.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 330b6be9f3a469e42a73504b34d499c6 3 | timeCreated: 1594958198 4 | licenseType: Free 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Shaders/2D/Effects/Glow.shader: -------------------------------------------------------------------------------- 1 | @@ -1,117 +1,30 @@ 2 | Shader "Custom/Glow" { 3 | Properties { 4 | _Color ("Color", Color) = (1,1,1,1) 5 | } 6 | 7 | SubShader { 8 | Tags { "RenderType"="Transparent" } 9 | LOD 200 10 | ZTest Always 11 | Cull Off 12 | 13 | CGPROGRAM 14 | #pragma surface surf Lambert decal:add 15 | 16 | float4 _Color; 17 | 18 | struct Input { 19 | float3 viewDir; 20 | float3 worldNormal; 21 | }; 22 | 23 | void surf (Input IN, inout SurfaceOutput o) { 24 | o.Alpha = _Color.a * pow(abs(dot(normalize(IN.viewDir), normalize(IN.worldNormal))), 4.0); 25 | o.Emission = _Color.rgb * o.Alpha; 26 | } 27 | ENDCG 28 | } 29 | 30 | FallBack "Diffuse" 31 | } 32 | -------------------------------------------------------------------------------- /Assets/Shaders/2D/Effects/Glow.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: feb86f7525c215b4c803d7ce16a4aedc 3 | timeCreated: 1500793480 4 | licenseType: Free 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Shaders/2D/Effects/Highlight.shader: -------------------------------------------------------------------------------- 1 | Shader "Custom/Highlight" { 2 | Properties { 3 | _Color ("Main Color", Color) = (1,1,1,1) 4 | } 5 | SubShader { 6 | Pass { 7 | ZWrite Off 8 | Offset -1, -1 9 | Blend SrcAlpha OneMinusSrcAlpha 10 | Color [_Color] 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Assets/Shaders/2D/Effects/Highlight.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 23fc256da1af2dd44bb8cf5fe363aed3 3 | timeCreated: 1500793448 4 | licenseType: Free 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Shaders/2D/Effects/ToonIce.shader: -------------------------------------------------------------------------------- 1 | Shader "Toon/Ice" { 2 | Properties { 3 | _Color ("Main Color", Color) = (0.5,0.5,0.5,1) 4 | _Ramp ("Toon Ramp (RGB)", 2D) = "gray" {} 5 | _BottomColor("Bottom Color", Color) = (0.23,0,0.95,1) 6 | _RimBrightness("Rim Brightness", Range(3,4)) = 3.5 7 | _Alpha("Transparency", Range(0,1)) = 0.5 8 | } 9 | 10 | SubShader { 11 | 12 | Tags{ "Queue" = "Transparent" "RenderType" = "Transparent" } 13 | LOD 200 14 | Blend SrcAlpha OneMinusSrcAlpha 15 | CGPROGRAM 16 | //#pragma surface surf ToonRamp 17 | #pragma surface surf Lambert alpha 18 | 19 | sampler2D _Ramp; 20 | 21 | // custom lighting function that uses a texture ramp based 22 | // on angle between light direction and normal 23 | #pragma lighting ToonRamp exclude_path:prepass 24 | inline half4 LightingToonRamp (SurfaceOutput s, half3 lightDir, half atten) 25 | { 26 | #ifndef USING_DIRECTIONAL_LIGHT 27 | lightDir = normalize(lightDir); 28 | #endif 29 | 30 | half d = dot (s.Normal, lightDir)*0.5 + 0.5; 31 | half3 ramp = tex2D (_Ramp, float2(d,d)).rgb; 32 | 33 | half4 c; 34 | c.rgb = s.Albedo * _LightColor0.rgb * ramp * (atten * 2); 35 | c.a = 0; 36 | return c; 37 | } 38 | 39 | 40 | float4 _Color; 41 | float4 _BottomColor; 42 | float _RimBrightness; 43 | float _Alpha; 44 | struct Input { 45 | float3 worldPos; 46 | float3 viewDir; 47 | }; 48 | 49 | void surf (Input IN, inout SurfaceOutput o) { 50 | float3 localPos = saturate(IN.worldPos - mul(unity_ObjectToWorld, float4(0, 0, 0, 1)).xyz); 51 | float softRim = 1.0 - saturate(dot(normalize(IN.viewDir), o.Normal)); 52 | float hardRim = round(softRim); 53 | o.Emission = _Color* lerp(hardRim, softRim, localPos.y) * (_RimBrightness*localPos.y); 54 | float InnerRim = 1.5 + saturate(dot(normalize(IN.viewDir), o.Normal)); 55 | o.Albedo = _Color*pow(InnerRim, 0.7) * lerp(_BottomColor, _Color, localPos.y); 56 | o.Alpha = _Alpha; 57 | } 58 | ENDCG 59 | 60 | } 61 | 62 | Fallback "Diffuse" 63 | } 64 | -------------------------------------------------------------------------------- /Assets/Shaders/2D/Effects/ToonIce.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: af52aa2c61ae85c47a09120b25d5f0eb 3 | timeCreated: 1500793463 4 | licenseType: Free 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Shaders/2D/Effects/WireFrame.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 31fc58e629e444741ba82377c6234196 3 | timeCreated: 1500793449 4 | licenseType: Free 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Shaders/2D/LineRenderer.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e87bf823cfbab8445867a12addd65cd7 3 | folderAsset: yes 4 | timeCreated: 1511611014 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Shaders/2D/LineRenderer/Additive-ScrollingUV.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 15701903e7dd975478b34a9e5bd4979b 3 | timeCreated: 1511611033 4 | licenseType: Free 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Shaders/2D/LineRenderer/LineRenderer_ClipStartEnd.shader: -------------------------------------------------------------------------------- 1 | Shader "UnityLibrary/LineRenderer/ClipStartEnd" 2 | { 3 | Properties 4 | { 5 | _MainTex ("Texture", 2D) = "white" {} 6 | _Start ("Start", Range (0.0,1.0)) = 0.25 7 | _End ("End", Range (0.0,1.0)) = 0.75 8 | } 9 | 10 | SubShader 11 | { 12 | Tags { "RenderType"="Opaque" } 13 | LOD 100 14 | 15 | Pass 16 | { 17 | CGPROGRAM 18 | #pragma vertex vert 19 | #pragma fragment frag 20 | 21 | #include "UnityCG.cginc" 22 | 23 | struct appdata 24 | { 25 | float4 vertex : POSITION; 26 | float2 uv : TEXCOORD0; 27 | float4 color : COLOR; 28 | }; 29 | 30 | struct v2f 31 | { 32 | float2 uv : TEXCOORD0; 33 | float4 vertex : SV_POSITION; 34 | float4 color : COLOR; 35 | }; 36 | 37 | sampler2D _MainTex; 38 | float4 _MainTex_ST; 39 | float _Start; 40 | float _End; 41 | 42 | 43 | v2f vert (appdata v) 44 | { 45 | v2f o; 46 | o.vertex = UnityObjectToClipPos(v.vertex); 47 | o.uv = TRANSFORM_TEX(v.uv, _MainTex); 48 | o.color = v.color; 49 | return o; 50 | } 51 | 52 | fixed4 frag(v2f i) : SV_Target 53 | { 54 | fixed4 col = tex2D(_MainTex, i.uv)*i.color; 55 | clip(-(i.uv.x <_Start || i.uv.x > _End)); 56 | // return fixed4(i.uv.x,0,0,0); // view UV x 57 | return col; 58 | } 59 | ENDCG 60 | } 61 | } 62 | } -------------------------------------------------------------------------------- /Assets/Shaders/2D/Patterns.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 399c75202c145034baa2c9d01212a27c 3 | folderAsset: yes 4 | timeCreated: 1594958190 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Shaders/2D/Patterns/CirclesPattern.shader: -------------------------------------------------------------------------------- 1 | // draws circle pattern 2 | Shader "UnityLibrary/2D/Patterns/Circles" 3 | { 4 | Properties 5 | { 6 | _Color ("Color", Color) = (1,1,1,1) 7 | _CircleSize("Size", Range(0,1)) = 0.5 8 | _Circles("Amount", Range(1,64)) = 8 9 | } 10 | 11 | SubShader 12 | { 13 | Tags { "RenderType"="Opaque" } 14 | LOD 200 15 | 16 | CGPROGRAM 17 | #pragma surface surf Standard fullforwardshadows vertex:vert 18 | #pragma target 3.0 19 | 20 | struct Input 21 | { 22 | float2 texcoord : TEXCOORD0; 23 | }; 24 | 25 | sampler2D _MainTex; 26 | float _Circles; 27 | float _CircleSize; 28 | 29 | half _Glossiness; 30 | half _Metallic; 31 | fixed4 _Color; 32 | 33 | UNITY_INSTANCING_BUFFER_START(Props) 34 | UNITY_INSTANCING_BUFFER_END(Props) 35 | 36 | // https://thebookofshaders.com/09/ 37 | float2 tile(float2 _st, float _zoom) 38 | { 39 | _st *= _zoom; 40 | return frac(_st); 41 | } 42 | 43 | // https://thebookofshaders.com/07/ 44 | float Circle(float2 _st, float _radius) 45 | { 46 | float2 dist = _st - float2(0.5, 0.5); 47 | return 1. - smoothstep(_radius - (_radius * 0.01), _radius + (_radius * 0.01), dot(dist, dist) * 4.0); 48 | } 49 | 50 | void vert(inout appdata_full v, out Input o) 51 | { 52 | UNITY_INITIALIZE_OUTPUT(Input, o); 53 | o.texcoord = v.texcoord; 54 | } 55 | 56 | void surf (Input IN, inout SurfaceOutputStandard o) 57 | { 58 | float2 st = IN.texcoord.xy; 59 | float c = Circle(tile(st, round(_Circles)), _CircleSize); 60 | o.Albedo = c.rrr* _Color; 61 | o.Metallic = _Metallic; 62 | o.Smoothness = _Glossiness; 63 | o.Alpha = c.r; 64 | } 65 | ENDCG 66 | } 67 | FallBack "Diffuse" 68 | } 69 | -------------------------------------------------------------------------------- /Assets/Shaders/2D/Patterns/CirclesPattern.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6a51e5184b408be4b8a27b34dfca55d2 3 | timeCreated: 1594958200 4 | licenseType: Free 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Shaders/2D/Patterns/ScrollingFill.shader: -------------------------------------------------------------------------------- 1 | // animated scrolling texture with fill amount 2 | // https://unitycoder.com/blog/2020/03/13/shader-scrolling-texture-with-fill-amount/ 3 | 4 | Shader "UnityLibrary/Patterns/ScrollingFill" 5 | { 6 | Properties 7 | { 8 | _MainTex ("Texture", 2D) = "white" {} 9 | _Fill("Fill", Range(0.0,1.0)) = 0.5 10 | _Speed("Speed", float) = 5 11 | } 12 | 13 | SubShader 14 | { 15 | Tags { "RenderType"="Opaque" } 16 | LOD 100 17 | 18 | Pass 19 | { 20 | CGPROGRAM 21 | #pragma vertex vert 22 | #pragma fragment frag 23 | 24 | #include "UnityCG.cginc" 25 | 26 | struct appdata 27 | { 28 | float4 vertex : POSITION; 29 | float2 uv : TEXCOORD0; 30 | }; 31 | 32 | struct v2f 33 | { 34 | float2 uv : TEXCOORD0; 35 | float4 vertex : SV_POSITION; 36 | }; 37 | 38 | sampler2D _MainTex; 39 | float4 _MainTex_ST; 40 | float _Fill; 41 | float _Speed; 42 | 43 | v2f vert (appdata v) 44 | { 45 | v2f o; 46 | o.vertex = UnityObjectToClipPos(v.vertex); 47 | o.uv = TRANSFORM_TEX(v.uv, _MainTex); 48 | return o; 49 | } 50 | 51 | fixed4 frag(v2f i) : SV_Target 52 | { 53 | // get scroll value 54 | float2 scroll = float2(0, frac(_Time.x*_Speed)); 55 | 56 | // sample texture 57 | fixed4 col = tex2D(_MainTex, i.uv -scroll); 58 | 59 | // discard if uv.y is below below cut value 60 | clip(step(i.uv.y, _Fill * _MainTex_ST.y)-0.1); 61 | 62 | return col; 63 | 64 | // make un-animated part black 65 | //return col*step(i.uv.y, _Cut * _MainTex_ST.y); 66 | } 67 | ENDCG 68 | } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /Assets/Shaders/2D/Patterns/ScrollingFill.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 34a3246941ff91e4d9a6bf3a8c9bbf56 3 | timeCreated: 1594958198 4 | licenseType: Free 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Shaders/2D/Special.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 52b47187126304f448c235620a02b491 3 | folderAsset: yes 4 | timeCreated: 1594958190 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Shaders/2D/Special/RayMarching.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 80f5dea6657e52b43b3c354aae5371e3 3 | timeCreated: 1594958202 4 | licenseType: Free 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Shaders/2D/Sprites.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d514920e40d9a2c4bb098b6dd37c765b 3 | folderAsset: yes 4 | timeCreated: 1500793395 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Shaders/2D/Sprites/Chromakey.shader: -------------------------------------------------------------------------------- 1 | Shader "UnityCommunity/ChromakeyTransparent" { 2 | Properties 3 | { 4 | _MainTex ("Base (RGB)", 2D) = "white" {} 5 | _MaskCol ("Mask Color", Color) = (1.0, 0.0, 0.0, 1.0) 6 | _Sensitivity ("Threshold Sensitivity", Range(0,1)) = 0.5 7 | _Smooth ("Smoothing", Range(0,1)) = 0.5 8 | } 9 | 10 | SubShader 11 | { 12 | Tags {"Queue"="Transparent" "IgnoreProjector"="true" "RenderType"="Transparent"} 13 | Blend SrcAlpha OneMinusSrcAlpha Cull Off 14 | 15 | Pass 16 | { 17 | 18 | CGPROGRAM 19 | #pragma vertex vert 20 | #pragma fragment frag 21 | #pragma fragmentoption ARB_precision_hint_fastest 22 | #include "UnityCG.cginc" 23 | 24 | struct appdata_t 25 | { 26 | float4 vertex : POSITION; 27 | float2 texcoord : TEXCOORD0; 28 | }; 29 | 30 | struct v2f 31 | { 32 | half2 texcoord : TEXCOORD0; 33 | float4 vertex : SV_POSITION; 34 | }; 35 | 36 | sampler2D _MainTex; 37 | fixed4 _Color; 38 | float _Speed; 39 | 40 | float4 _MaskCol; 41 | float _Sensitivity; 42 | float _Smooth; 43 | 44 | 45 | v2f vert(appdata_t IN) 46 | { 47 | v2f OUT; 48 | OUT.vertex = UnityObjectToClipPos(IN.vertex); 49 | OUT.texcoord = IN.texcoord; 50 | return OUT; 51 | } 52 | 53 | float4 frag (v2f i) : COLOR 54 | { 55 | 56 | float2 uv = i.texcoord.xy; 57 | float4 c = tex2D(_MainTex, uv); 58 | 59 | float maskY = 0.2989 * _MaskCol.r + 0.5866 * _MaskCol.g + 0.1145 * _MaskCol.b; 60 | float maskCr = 0.7132 * (_MaskCol.r - maskY); 61 | float maskCb = 0.5647 * (_MaskCol.b - maskY); 62 | 63 | float Y = 0.2989 * c.r + 0.5866 * c.g + 0.1145 * c.b; 64 | float Cr = 0.7132 * (c.r - Y); 65 | float Cb = 0.5647 * (c.b - Y); 66 | 67 | float blendValue = smoothstep(_Sensitivity, _Sensitivity + _Smooth, distance(float2(Cr, Cb), float2(maskCr, maskCb))); 68 | 69 | return float4(c.rgb,c.a*blendValue); 70 | } 71 | ENDCG 72 | } 73 | } 74 | Fallback "Sprites/Default" 75 | } -------------------------------------------------------------------------------- /Assets/Shaders/2D/Sprites/Chromakey.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d519a4751a0aff74593843250496c08e 3 | timeCreated: 1512025674 4 | licenseType: Free 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Shaders/2D/Sprites/FlipBook.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4ebeb70d938436745afc3679d29342ee 3 | timeCreated: 1594958199 4 | licenseType: Free 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Shaders/2D/Sprites/HSBC.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1c3c166a85bfe60428455775befe0f3b 3 | timeCreated: 1512025650 4 | licenseType: Free 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Shaders/2D/Sprites/Outline2D.shader: -------------------------------------------------------------------------------- 1 |  2 | Shader "UnityCommunity/Sprites/Outline" 3 | { 4 | Properties 5 | { 6 | _MainTex ("Base (RGB)", 2D) = "white" {} 7 | _OutLineSpread ("Outline Spread", Range(0,0.01)) = 0.007 8 | _Color ("Tint", Color) = (1,1,1,1) 9 | _ColorX ("Tint", Color) = (1,1,1,1) 10 | _Alpha ("Alpha", Range (0,1)) = 1.0 11 | } 12 | 13 | SubShader 14 | { 15 | Tags {"Queue"="Transparent" "IgnoreProjector"="true" "RenderType"="Transparent"} 16 | ZWrite Off Blend SrcAlpha OneMinusSrcAlpha Cull Off 17 | 18 | Pass 19 | { 20 | 21 | CGPROGRAM 22 | #pragma vertex vert 23 | #pragma fragment frag 24 | #pragma fragmentoption ARB_precision_hint_fastest 25 | #include "UnityCG.cginc" 26 | 27 | struct appdata_t 28 | { 29 | float4 vertex : POSITION; 30 | float4 color : COLOR; 31 | float2 texcoord : TEXCOORD0; 32 | }; 33 | 34 | struct v2f 35 | { 36 | half2 texcoord : TEXCOORD0; 37 | float4 vertex : SV_POSITION; 38 | fixed4 color : COLOR; 39 | }; 40 | 41 | sampler2D _MainTex; 42 | float _OutLineSpread; 43 | fixed4 _Color; 44 | fixed4 _ColorX; 45 | 46 | v2f vert(appdata_t IN) 47 | { 48 | v2f OUT; 49 | OUT.vertex = UnityObjectToClipPos(IN.vertex); 50 | OUT.texcoord = IN.texcoord; 51 | OUT.color = IN.color; 52 | return OUT; 53 | } 54 | 55 | float4 frag (v2f i) : COLOR 56 | { 57 | 58 | fixed4 mainColor = (tex2D(_MainTex, i.texcoord+float2(-_OutLineSpread,_OutLineSpread)) 59 | + tex2D(_MainTex, i.texcoord+float2(_OutLineSpread,-_OutLineSpread)) 60 | + tex2D(_MainTex, i.texcoord+float2(_OutLineSpread,_OutLineSpread)) 61 | + tex2D(_MainTex, i.texcoord-float2(_OutLineSpread,_OutLineSpread))); 62 | 63 | mainColor.rgb = _ColorX.rgb; 64 | 65 | fixed4 addcolor = tex2D(_MainTex, i.texcoord)*i.color; 66 | 67 | if (mainColor.a > 0.40) { mainColor = _ColorX; } 68 | if (addcolor.a > 0.40) { mainColor = addcolor; mainColor.a = addcolor.a; } 69 | 70 | return mainColor*i.color.a; 71 | } 72 | ENDCG 73 | } 74 | } 75 | Fallback "Sprites/Default" 76 | 77 | } 78 | -------------------------------------------------------------------------------- /Assets/Shaders/2D/Sprites/Outline2D.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 88e77b0dcd3a1a247b7ad32561fefcd8 3 | timeCreated: 1511613854 4 | licenseType: Free 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Shaders/2D/Sprites/Photoshop Blends.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 37f060ed25d19ec49801a3bbf06bdea1 3 | folderAsset: yes 4 | timeCreated: 1512025751 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Shaders/2D/Sprites/Photoshop Blends/Photoshop_Blends.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | [ExecuteInEditMode] 6 | public class Photoshop_Blends : MonoBehaviour { 7 | public enum BlendModes{darken,multiply,colorBurn,linearBurn,darkerColor,lighten,screen,colorDodge,linearDodge,lighterColor,overlay,softLight,hardLight,vividLight,linearLight,pinLight,hardlerp,difference,exclusion,subtract,divide,hue,color,saturation,luminosity} 8 | public BlendModes blendmodes; 9 | private Material Mat; 10 | 11 | void Awake () { 12 | Material material = new Material (Shader.Find("UnityCommunity/Sprites/PhotoshopBlends")); 13 | GetComponent ().sharedMaterial = material; 14 | } 15 | 16 | void Update () { 17 | 18 | GetComponent ().sharedMaterial.SetInt ("number", blendmodes.GetHashCode ()); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Assets/Shaders/2D/Sprites/Photoshop Blends/Photoshop_Blends.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ead4927f89bb6d243a3d67b0fbfef19d 3 | timeCreated: 1512025691 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Shaders/2D/Sprites/Photoshop Blends/photoshop_blends.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 773b7ccd460934140a59c74848880b4d 3 | timeCreated: 1512025692 4 | licenseType: Free 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Shaders/2D/Sprites/Pixelation.shader: -------------------------------------------------------------------------------- 1 | Shader "UnityCommunity/Sprites/Pixelation" 2 | { 3 | Properties 4 | { 5 | _MainTex ("Texture", 2D) = "white" {} 6 | size ("Pixel size",Range(1.0,1000.0)) = 100.0 7 | } 8 | Subshader 9 | { 10 | Tags {"Queue"="Transparent" "IgnoreProjector"="true" "RenderType"="Transparent"} 11 | ZWrite Off Blend SrcAlpha OneMinusSrcAlpha Cull Off 12 | 13 | Pass 14 | { 15 | CGPROGRAM 16 | #pragma vertex vertex_shader 17 | #pragma fragment pixel_shader 18 | #pragma target 2.0 19 | 20 | sampler2D _MainTex; 21 | float size; 22 | 23 | struct custom_type 24 | { 25 | float4 vertex : SV_POSITION; 26 | float2 uv : TEXCOORD0; 27 | }; 28 | 29 | custom_type vertex_shader (float4 vertex:POSITION, float2 uv:TEXCOORD0) 30 | { 31 | custom_type vs; 32 | vs.vertex = UnityObjectToClipPos (vertex); 33 | vs.uv = uv; 34 | return vs; 35 | } 36 | 37 | float4 pixel_shader (custom_type ps) : COLOR 38 | { 39 | return tex2D(_MainTex,ceil(ps.uv.xy*size)/size); 40 | } 41 | ENDCG 42 | } 43 | } 44 | } -------------------------------------------------------------------------------- /Assets/Shaders/2D/Sprites/Pixelation.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 329439a225731b7449c7ac9a8cedb612 3 | timeCreated: 1512026085 4 | licenseType: Free 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Shaders/2D/Sprites/SpriteDropShadow.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f6b01e7d917479745ac109d566b805f4 3 | timeCreated: 1500793478 4 | licenseType: Free 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Shaders/2D/Sprites/SpriteHDRBloom.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b9e666d252d7f5d418f6af0311d5f20c 3 | timeCreated: 1500793465 4 | licenseType: Free 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Shaders/2D/UI.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9f1773e3c18b8d44fa76cebdd910da0c 3 | folderAsset: yes 4 | timeCreated: 1500793395 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Shaders/2D/UI/UI_Always_On_Top.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f93ce66ceeb7f8742bcf09caa64f1fb6 3 | timeCreated: 1500793478 4 | licenseType: Free 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Shaders/3D.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4e16b4c226149b5498e758bba415028e 3 | folderAsset: yes 4 | timeCreated: 1511611817 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Shaders/3D/Debug.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 55b820388fd4d244398803fb14513b49 3 | folderAsset: yes 4 | timeCreated: 1500793395 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Shaders/3D/Debug/DebugNormalsTangents.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4c021e765a244dd4cb0307376032fa0a 3 | timeCreated: 1500793449 4 | licenseType: Free 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Shaders/3D/Debug/LerpColorNearToFarPlane.shader: -------------------------------------------------------------------------------- 1 | // Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)' 2 | 3 | // source: https://forum.unity3d.com/threads/depth-shader-invert-it.12692/#post-89430 4 | // lerp 2 colors between camera NearClipPlane to FarClipPlane 5 | 6 | Shader "UnityCommunity/Debug/LerpColorNearToFarPlane" 7 | { 8 | Properties { 9 | _ColorNear ("Color Near", Color) = (1,0,0,1) 10 | _ColorFar ("Color Far", Color) = (0,1,0,1) 11 | } 12 | SubShader 13 | { 14 | Pass 15 | { 16 | CGPROGRAM 17 | #pragma vertex vert 18 | #pragma fragment frag 19 | #include "UnityCG.cginc" 20 | 21 | struct appdata 22 | { 23 | float4 vertex : POSITION; 24 | }; 25 | 26 | struct v2f 27 | { 28 | float4 pos : SV_POSITION; 29 | float4 color : COLOR; 30 | }; 31 | 32 | uniform float4 _ColorNear; 33 | uniform float4 _ColorFar; 34 | 35 | v2f vert(appdata v) 36 | { 37 | v2f o; 38 | o.pos = UnityObjectToClipPos(v.vertex); 39 | float depth; 40 | COMPUTE_EYEDEPTH(depth); 41 | float factor = depth * _ProjectionParams.w; 42 | o.color = lerp(_ColorNear, _ColorFar, factor); 43 | return o; 44 | } 45 | 46 | fixed4 frag (v2f i) : SV_Target 47 | { 48 | return i.color; 49 | } 50 | 51 | ENDCG 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /Assets/Shaders/3D/Debug/LerpColorNearToFarPlane.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 91f2627c2dd513245bf7515fdb7796f2 3 | timeCreated: 1500793459 4 | licenseType: Free 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Shaders/3D/Effects.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 721c02c14478d394eb2cd50453c1dd46 3 | folderAsset: yes 4 | timeCreated: 1594958190 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Shaders/3D/Effects/Diffuse Stipple Transparency.shader: -------------------------------------------------------------------------------- 1 | // Diffuse shader with stipple transparency 2 | // by Alex Ocias - https://ocias.com 3 | // source: https://ocias.com/blog/unity-stipple-transparency-shader/ 4 | // based on an article by Digital Rune: https://www.digitalrune.com/Blog/Post/1743/Screen-Door-Transparency 5 | 6 | // Simplified Diffuse shader. Differences from regular Diffuse one: 7 | // - no Main Color 8 | // - fully supports only 1 directional light. Other lights can affect it, but it will be per-vertex/SH. 9 | 10 | Shader "Ocias/Diffuse (Stipple Transparency)" { 11 | Properties { 12 | _MainTex ("Base (RGB)", 2D) = "white" {} 13 | _Transparency ("Transparency", Range(0,1)) = 1.0 14 | } 15 | SubShader { 16 | Tags { "RenderType"="Opaque" } 17 | LOD 150 18 | 19 | CGPROGRAM 20 | #pragma surface surf Lambert noforwardadd 21 | 22 | sampler2D _MainTex; 23 | 24 | struct Input { 25 | float2 uv_MainTex; 26 | float4 screenPos; 27 | }; 28 | 29 | half _Transparency; 30 | 31 | void surf (Input IN, inout SurfaceOutput o) { 32 | fixed4 c = tex2D(_MainTex, IN.uv_MainTex); 33 | o.Albedo = c.rgb; 34 | o.Alpha = c.a; 35 | 36 | // Screen-door transparency: Discard pixel if below threshold. 37 | float4x4 thresholdMatrix = 38 | { 1.0 / 17.0, 9.0 / 17.0, 3.0 / 17.0, 11.0 / 17.0, 39 | 13.0 / 17.0, 5.0 / 17.0, 15.0 / 17.0, 7.0 / 17.0, 40 | 4.0 / 17.0, 12.0 / 17.0, 2.0 / 17.0, 10.0 / 17.0, 41 | 16.0 / 17.0, 8.0 / 17.0, 14.0 / 17.0, 6.0 / 17.0 42 | }; 43 | float4x4 _RowAccess = { 1,0,0,0, 0,1,0,0, 0,0,1,0, 0,0,0,1 }; 44 | float2 pos = IN.screenPos.xy / IN.screenPos.w; 45 | pos *= _ScreenParams.xy; // pixel position 46 | clip(_Transparency - thresholdMatrix[fmod(pos.x, 4)] * _RowAccess[fmod(pos.y, 4)]); 47 | } 48 | ENDCG 49 | } 50 | 51 | Fallback "Mobile/VertexLit" 52 | } 53 | -------------------------------------------------------------------------------- /Assets/Shaders/3D/Effects/Standard Stipple Transparency.shader: -------------------------------------------------------------------------------- 1 | // Standard shader with stipple transparency 2 | // by Alex Ocias - https://ocias.com 3 | // source: https://ocias.com/blog/unity-stipple-transparency-shader/ 4 | // based on an article by Digital Rune: https://www.digitalrune.com/Blog/Post/1743/Screen-Door-Transparency 5 | 6 | Shader "Ocias/Standard (Stipple Transparency)" { 7 | Properties { 8 | _Color ("Color", Color) = (1,1,1,1) 9 | _MainTex ("Albedo (RGB)", 2D) = "white" {} 10 | _Glossiness ("Smoothness", Range(0,1)) = 0.5 11 | _Metallic ("Metallic", Range(0,1)) = 0.0 12 | } 13 | SubShader { 14 | Tags { "RenderType"="Opaque" } 15 | LOD 100 16 | 17 | CGPROGRAM 18 | // Physically based Standard lighting model, and enable shadows on all light types 19 | #pragma surface surf Standard fullforwardshadows 20 | 21 | // Use shader model 3.0 target, to get nicer looking lighting 22 | #pragma target 3.0 23 | 24 | sampler2D _MainTex; 25 | 26 | struct Input { 27 | float2 uv_MainTex; 28 | float4 screenPos; 29 | }; 30 | 31 | half _Glossiness; 32 | half _Metallic; 33 | fixed4 _Color; 34 | 35 | void surf (Input IN, inout SurfaceOutputStandard o) { 36 | // Albedo comes from a texture tinted by color 37 | fixed4 c = tex2D (_MainTex, IN.uv_MainTex) * _Color; 38 | o.Albedo = c.rgb; 39 | // Metallic and smoothness come from slider variables 40 | o.Metallic = _Metallic; 41 | o.Smoothness = _Glossiness; 42 | 43 | // Screen-door transparency: Discard pixel if below threshold. 44 | float4x4 thresholdMatrix = 45 | { 1.0 / 17.0, 9.0 / 17.0, 3.0 / 17.0, 11.0 / 17.0, 46 | 13.0 / 17.0, 5.0 / 17.0, 15.0 / 17.0, 7.0 / 17.0, 47 | 4.0 / 17.0, 12.0 / 17.0, 2.0 / 17.0, 10.0 / 17.0, 48 | 16.0 / 17.0, 8.0 / 17.0, 14.0 / 17.0, 6.0 / 17.0 49 | }; 50 | float4x4 _RowAccess = { 1,0,0,0, 0,1,0,0, 0,0,1,0, 0,0,0,1 }; 51 | float2 pos = IN.screenPos.xy / IN.screenPos.w; 52 | pos *= _ScreenParams.xy; // pixel position 53 | clip(c.a - thresholdMatrix[fmod(pos.x, 4)] * _RowAccess[fmod(pos.y, 4)]); 54 | } 55 | ENDCG 56 | } 57 | FallBack "Diffuse" 58 | } 59 | -------------------------------------------------------------------------------- /Assets/Shaders/3D/Effects/Standard-SeeThroughWalls.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 353df71fa3c6e5846a31afbe285baf57 3 | timeCreated: 1594958198 4 | licenseType: Free 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Shaders/3D/Effects/VerticalCameraDistanceFade.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4b3fdf02746e56f4a87156674e1b493c 3 | timeCreated: 1594958199 4 | licenseType: Free 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Shaders/3D/Reflection.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4dcfe792bff0b3e4c9f909a023219231 3 | folderAsset: yes 4 | timeCreated: 1511614225 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Shaders/3D/Reflection/Reflective.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0cc84c491ff495544be1e326393b1615 3 | folderAsset: yes 4 | timeCreated: 1500793394 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Shaders/3D/Reflection/Reflective/BumpedSpecularFresnel.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0079b74170cd5fc4aa82cfb9d7e1ff20 3 | timeCreated: 1500793447 4 | licenseType: Free 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Shaders/3D/Reflection/ReliefMapping.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: feb4f9880e6c6d54083cd1bcb109dc9f 3 | folderAsset: yes 4 | timeCreated: 1500793396 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Shaders/3D/Reflection/ReliefMapping/ReliefMapping.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6323b67979f9b2f41b3a63b382daf156 3 | timeCreated: 1500793453 4 | licenseType: Free 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Shaders/3D/SkyBox.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 733527ee659d25b4e9971e1b58935d11 3 | folderAsset: yes 4 | timeCreated: 1500793395 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Shaders/3D/SkyBox/Cubemap-Simple.shader: -------------------------------------------------------------------------------- 1 | // Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)' 2 | 3 | // simplified skybox shader (unity 5.3.x) 4 | // removed tint, rotation, exposure, HDR calculation 5 | 6 | Shader "UnityLibrary/Skybox/Cubemap-Simple" 7 | { 8 | Properties { 9 | [NoScaleOffset] _Tex ("Cubemap (HDR)", Cube) = "grey" {} 10 | } 11 | 12 | SubShader { 13 | Tags { "Queue"="Background" "RenderType"="Background" "PreviewType"="Skybox" } 14 | Cull Off ZWrite Off 15 | 16 | Pass { 17 | CGPROGRAM 18 | #pragma vertex vert 19 | #pragma fragment frag 20 | 21 | samplerCUBE _Tex; 22 | 23 | struct appdata_t { 24 | float4 vertex : POSITION; 25 | }; 26 | 27 | struct v2f { 28 | float4 vertex : SV_POSITION; 29 | float3 texcoord : TEXCOORD0; 30 | }; 31 | 32 | v2f vert (appdata_t v) 33 | { 34 | v2f o; 35 | o.vertex = UnityObjectToClipPos(v.vertex); 36 | o.texcoord = v.vertex.xyz; 37 | return o; 38 | } 39 | 40 | fixed4 frag (v2f i) : SV_Target 41 | { 42 | return half4(texCUBE(_Tex, i.texcoord).rgb,1); 43 | } 44 | ENDCG 45 | } 46 | } 47 | Fallback Off 48 | } 49 | -------------------------------------------------------------------------------- /Assets/Shaders/3D/SkyBox/Cubemap-Simple.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2a8b2b13e1fbf4d4683fc8ab5cbefd08 3 | timeCreated: 1500793448 4 | licenseType: Free 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Shaders/3D/Standard.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2bc68b9180eac9c4584bd64f091ef2d3 3 | folderAsset: yes 4 | timeCreated: 1594958190 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Shaders/3D/Standard/HueContrastSaturation.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6f585f7124fa4094fa1b503ac78e757b 3 | timeCreated: 1594958201 4 | licenseType: Free 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Shaders/3D/Terrain.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a19e0b2644eb95746a254fe12c1e1f20 3 | folderAsset: yes 4 | timeCreated: 1500793395 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Shaders/3D/Terrain/Splatmask4Textures.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dc4198c03554ea242b092eac310315d8 3 | timeCreated: 1500793475 4 | licenseType: Free 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Shaders/3D/Terrain/Trees.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3d8c59865c792554a9da41def0d54a26 3 | folderAsset: yes 4 | timeCreated: 1500793396 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Shaders/3D/Terrain/Trees/Unity-BillboardTree.shader: -------------------------------------------------------------------------------- 1 | // Unity Tree Billboard (not speedtree) replacement shader that works with Legacy Global Fog 2 | // topic: https://forum.unity3d.com/threads/global-fog-doesnt-affect-billboard-trees.473300/ 3 | 4 | Shader "Hidden/TerrainEngine/BillboardTree" { 5 | Properties { 6 | _MainTex ("Base (RGB) Alpha (A)", 2D) = "white" {} 7 | _Cutoff("Cutoff", float) = 0.33 // adjust this value here in shader code 8 | } 9 | 10 | SubShader { 11 | Tags { "Queue" = "AlphaTest" "IgnoreProjector"="True" "RenderType"="TransparentCutout" } 12 | 13 | Pass { 14 | ColorMask rgb 15 | ZWrite Off Cull Off 16 | 17 | CGPROGRAM 18 | #pragma vertex vert 19 | #pragma fragment frag 20 | #pragma multi_compile_fog 21 | #include "UnityCG.cginc" 22 | #include "TerrainEngine.cginc" 23 | 24 | struct v2f { 25 | float4 pos : SV_POSITION; 26 | fixed4 color : COLOR0; 27 | float2 uv : TEXCOORD0; 28 | UNITY_FOG_COORDS(1) 29 | UNITY_VERTEX_OUTPUT_STEREO 30 | }; 31 | 32 | v2f vert (appdata_tree_billboard v) { 33 | v2f o; 34 | UNITY_SETUP_INSTANCE_ID(v); 35 | UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); 36 | TerrainBillboardTree(v.vertex, v.texcoord1.xy, v.texcoord.y); 37 | o.pos = UnityObjectToClipPos(v.vertex); 38 | o.uv.x = v.texcoord.x; 39 | o.uv.y = v.texcoord.y > 0; 40 | o.color = v.color; 41 | UNITY_TRANSFER_FOG(o,o.pos); 42 | return o; 43 | } 44 | 45 | fixed _Cutoff; 46 | sampler2D _MainTex; 47 | fixed4 frag(v2f input) : SV_Target 48 | { 49 | fixed4 col = tex2D( _MainTex, input.uv); 50 | col.rgb *= input.color.rgb; 51 | clip(col.a-_Cutoff); 52 | UNITY_APPLY_FOG(input.fogCoord, col); 53 | return col; 54 | } 55 | ENDCG 56 | } 57 | } 58 | Fallback Off 59 | } 60 | -------------------------------------------------------------------------------- /Assets/Shaders/3D/Terrain/Trees/Unity-BillboardTree.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e00c8f3696b8b4c4dbcbefe37a28cdfa 3 | timeCreated: 1500793476 4 | licenseType: Free 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Shaders/3D/TextureMapping.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ff1160a8c4b5696449c6df6e4a05909d 3 | folderAsset: yes 4 | timeCreated: 1500793396 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Shaders/3D/TextureMapping/Equirectangular.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c2a51d57daeec064195176107a64ec19 3 | timeCreated: 1500793468 4 | licenseType: Free 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Shaders/3D/Unlit.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1e441a495fdca78418458cb3dba06fd9 3 | folderAsset: yes 4 | timeCreated: 1500793394 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Shaders/3D/Unlit/Reverse-DisIntegrate-Shader: -------------------------------------------------------------------------------- 1 | Shader "Unlit/Reverse_Disintegrate" 2 | { 3 | Properties 4 | { 5 | _MainTex ("Texture", 2D) = "white" {} 6 | _color("Color",color)=(1,1,1,1) 7 | _Transparent("Transparency",float)=0.0 8 | 9 | } 10 | SubShader 11 | { 12 | Tags {"Queue"="Transparent" "RenderType"="Transparent"} 13 | LOD 100 14 | ZWrite Off 15 | Blend SrcAlpha OneMinusSrcAlpha 16 | 17 | Lighting Off 18 | ColorMask RGB 19 | 20 | 21 | Pass 22 | { 23 | CGPROGRAM 24 | #pragma vertex vert 25 | #pragma fragment frag 26 | // make fog work 27 | #pragma multi_compile_fog 28 | 29 | #include "UnityCG.cginc" 30 | 31 | struct appdata 32 | { 33 | float4 vertex : POSITION; 34 | float2 uv : TEXCOORD0; 35 | }; 36 | 37 | sampler2D _MainTex; 38 | float4 _color; 39 | float _Transparent; 40 | struct v2f 41 | { 42 | float2 uv : TEXCOORD0; 43 | UNITY_FOG_COORDS(1) 44 | float4 vertex : SV_POSITION; 45 | }; 46 | 47 | 48 | v2f vert (appdata v) 49 | { 50 | v2f o; 51 | o.vertex = UnityObjectToClipPos(v.vertex); 52 | o.uv = v.uv; 53 | UNITY_TRANSFER_FOG(o,o.vertex); 54 | return o; 55 | } 56 | 57 | fixed4 frag (v2f i) : SV_Target 58 | { 59 | // sample the texture 60 | fixed4 col = tex2D(_MainTex, i.uv)*_color ; 61 | 62 | 63 | _Transparent=_Transparent*(_Time.y*5000); 64 | if(_Transparent<8) 65 | { 66 | col.a=_Transparent; 67 | } 68 | 69 | // apply fog 70 | UNITY_APPLY_FOG(i.fogCoord, col); 71 | return col; 72 | } 73 | ENDCG 74 | } 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /Assets/Shaders/3D/Unlit/Reverse-DisIntegrate-Shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9c8f6c7a074ca5e42add15300bee781a 3 | timeCreated: 1594958191 4 | licenseType: Free 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Shaders/3D/Unlit/UnlitDoubleSided.shader: -------------------------------------------------------------------------------- 1 | Shader "UnityCommunity/Unlit/Double Sided" 2 | { 3 | Properties 4 | { 5 | _MainTex ("Texture", 2D) = "white" {} 6 | } 7 | Subshader 8 | { 9 | Tags {"Queue"="Transparent" "IgnoreProjector"="true" "RenderType"="Transparent"} 10 | ZWrite Off Blend SrcAlpha OneMinusSrcAlpha Cull Off 11 | 12 | Pass 13 | { 14 | Cull Off 15 | CGPROGRAM 16 | #pragma vertex vertex_shader 17 | #pragma fragment pixel_shader 18 | #pragma target 3.0 19 | 20 | sampler2D _MainTex; 21 | 22 | struct custom_type 23 | { 24 | float4 clip_space_vertex : SV_POSITION; 25 | float2 uv : TEXCOORD0; 26 | }; 27 | 28 | custom_type vertex_shader (float4 object_space_vertex : POSITION, float2 uv : TEXCOORD0) 29 | { 30 | custom_type vs; 31 | vs.clip_space_vertex = UnityObjectToClipPos (object_space_vertex); 32 | vs.uv=uv; 33 | return vs; 34 | } 35 | 36 | float4 pixel_shader (custom_type ps) : SV_TARGET 37 | { 38 | return tex2D (_MainTex,ps.uv.xy); 39 | } 40 | 41 | ENDCG 42 | } 43 | } 44 | } -------------------------------------------------------------------------------- /Assets/Shaders/3D/Unlit/UnlitDoubleSided.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 82111366e9d1d0c4fb0aee75e08ca0c3 3 | timeCreated: 1512149105 4 | licenseType: Free 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Shaders/3D/Unlit/UnlitTransparentColor.shader: -------------------------------------------------------------------------------- 1 | Shader "Custom/Unlit/Transparent Color" { 2 | Properties{ 3 | _Color("Color Tint", Color) = (1,1,1,1) 4 | _MainTex("Base (RGB) Trans (A)", 2D) = "white" {} 5 | } 6 | 7 | SubShader{ 8 | Tags{ "Queue" = "Transparent" "IgnoreProjector" = "True" "RenderType" = "Transparent" } 9 | LOD 100 10 | 11 | ZWrite Off 12 | Blend SrcAlpha OneMinusSrcAlpha 13 | 14 | Pass{ 15 | CGPROGRAM 16 | #pragma vertex vert 17 | #pragma fragment frag 18 | 19 | #include "UnityCG.cginc" 20 | 21 | struct appdata_t { 22 | float4 vertex : POSITION; 23 | float2 texcoord : TEXCOORD0; 24 | }; 25 | 26 | struct v2f { 27 | float4 vertex : SV_POSITION; 28 | half2 texcoord : TEXCOORD0; 29 | }; 30 | 31 | sampler2D _MainTex; 32 | float4 _MainTex_ST; 33 | fixed4 _Color; 34 | 35 | v2f vert(appdata_t v) 36 | { 37 | v2f o; 38 | o.vertex = UnityObjectToClipPos(v.vertex); 39 | o.texcoord = TRANSFORM_TEX(v.texcoord, _MainTex); 40 | return o; 41 | } 42 | 43 | fixed4 frag(v2f i) : SV_Target 44 | { 45 | fixed4 col = tex2D(_MainTex, i.texcoord) * _Color; 46 | return col; 47 | } 48 | ENDCG 49 | } 50 | } 51 | 52 | } -------------------------------------------------------------------------------- /Assets/Shaders/3D/Unlit/UnlitTransparentColor.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 067b62334bad98c499c8751f5755581c 3 | timeCreated: 1500793447 4 | licenseType: Free 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Shaders/3D/Unlit/UnlitTransparentColorGradient.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1e18fd258e063d84a83cb144e7708884 3 | timeCreated: 1500793448 4 | licenseType: Free 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Shaders/3D/Vertex.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2a44a518ad7aa66468721a90103ab81e 3 | folderAsset: yes 4 | timeCreated: 1500793394 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Shaders/3D/Vertex/VertexColorMesh.shader: -------------------------------------------------------------------------------- 1 | // Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)' 2 | 3 | // vertex colors shader for mesh 4 | 5 | Shader "UnityCommunity/Vertex/VertexColorMesh" 6 | { 7 | SubShader 8 | { 9 | Tags { "Queue"="Geometry"} 10 | // Lighting Off 11 | Fog { Mode Off } 12 | 13 | Pass 14 | { 15 | CGPROGRAM 16 | #pragma vertex vert 17 | #pragma fragment frag 18 | #pragma fragmentoption ARB_precision_hint_fastest 19 | 20 | struct appdata 21 | { 22 | float4 vertex : POSITION; 23 | fixed4 color : COLOR; 24 | }; 25 | 26 | struct v2f 27 | { 28 | float4 pos : SV_POSITION; 29 | fixed4 color : COLOR; 30 | }; 31 | 32 | v2f vert (appdata v) 33 | { 34 | v2f o; 35 | o.pos = UnityObjectToClipPos(v.vertex); 36 | o.color = v.color; 37 | return o; 38 | } 39 | 40 | half4 frag(v2f i) : COLOR 41 | { 42 | return i.color; 43 | } 44 | ENDCG 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /Assets/Shaders/3D/Vertex/VertexColorMesh.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e0d6ecfd2bff856419569d3aaca8fdc1 3 | timeCreated: 1500793477 4 | licenseType: Free 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Shaders/3D/Water.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6f78ac9f8e56a074a9b3398b55a3798b 3 | folderAsset: yes 4 | timeCreated: 1594958190 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Shaders/3D/Water/WaterBox.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d43f18bcc0c85024ba6a0410b601cbee 3 | timeCreated: 1594958204 4 | licenseType: Free 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Shaders/README.md: -------------------------------------------------------------------------------- 1 | # Shaders 2 | The one of most important things in game development is the visual experience. 3 | 4 | Here is a complete set of useful shaders that everyone will need. 5 | 6 | ## License 7 | [MIT](https://github.com/UnityCommunity/UnityLibrary/blob/master/LICENSE.md) @ [Unity Community](https://github.com/UnityCommunity/) 8 | 9 | Made with :heart: by [Unity Community](https://github.com/UnityCommunity/) 10 | -------------------------------------------------------------------------------- /Assets/Shaders/README.md.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3da44f7f0d7760d4e8b776ae1673fbe1 3 | timeCreated: 1500793395 4 | licenseType: Free 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to Unity Library 2 | 3 | :+1::tada: First off, thanks for taking the time to contribute! :tada::+1: 4 | 5 | ## Table of Contents 6 | 7 | [How Can I Contribute?](#how-can-i-contribute) 8 | - [Reporting Bugs](#reporting-bugs) 9 | - [Adding Content to Wiki](#adding-content-to-wiki) 10 | - [Adding Content to Library](#adding-content-to-library) 11 | - [Making Pull Requests](#making-pull-requests) 12 | 13 | ## How Can I Contribute? 14 | 15 | ### Reporting Bugs 16 | 17 | You can test the existing utitlties and report us the bugs/improvements/ideas. 18 | 19 | Always add a meaningful title to your issue. 20 | 21 | ### Adding Content to Wiki 22 | 23 | You add tutorials and usage guideline for your content or existing content at [Wiki](https://github.com/UnityCommunity/UnityLibrary/wiki) 24 | 25 | Always add a good and meaningful title and content. 26 | 27 | ### Adding Content to Library 28 | 29 | You can add your own content and utilities to the library by [making pull requests](https://github.com/UnityCommunity/UnityLibrary/pulls). 30 | 31 | Always check the library to make sure you aren't adding a duplicate. 32 | 33 | Always test your utitlity to make sure it works as expected and is error free. 34 | 35 | Also you can make a new folder in the relevant category for your utility and include a README.md file for that to provide documentation and usage guideline. 36 | 37 | New Category suggestion is welcome. 38 | 39 | ### Making Pull Requests 40 | 41 | You can submit your [Pull Requests](https://github.com/UnityCommunity/UnityLibrary/pulls) to us and we will merge them when they are ready. 42 | 43 | Always add a meaningful pull request title. 44 | -------------------------------------------------------------------------------- /External/Logging/LogcatNoActivity.bat: -------------------------------------------------------------------------------- 1 | REM run adb logcat without activity logging 2 | adb logcat -s Unity dalvikvm DEBUG 3 | -------------------------------------------------------------------------------- /External/README.md: -------------------------------------------------------------------------------- 1 | # External 2 | External libraries, scripts and utitlities that are related to unity. 3 | 4 | ## License 5 | [MIT](https://github.com/UnityCommunity/UnityLibrary/blob/master/LICENSE.md) @ [Unity Community](https://github.com/UnityCommunity/) 6 | 7 | Made with :heart: by [Unity Community](https://github.com/UnityCommunity/) 8 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Logos/Unity_Library_Black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UnityCommunity/UnityLibrary/540d629be475e7e984b893013a5634c725c3ad74/Logos/Unity_Library_Black.png -------------------------------------------------------------------------------- /Logos/Unity_Library_White.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UnityCommunity/UnityLibrary/540d629be475e7e984b893013a5634c725c3ad74/Logos/Unity_Library_White.png -------------------------------------------------------------------------------- /ScriptTemplates/81a-C# Editor Script-NewEditorScript.cs.txt: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEditor; 5 | 6 | public class #SCRIPTNAME# : EditorWindow { 7 | 8 | // Use this for initialization 9 | [MenuItem("Window/#SCRIPTNAME#")] 10 | private static void Initialize () { 11 | #NOTRIM# 12 | } 13 | 14 | // Draw the Window GUI 15 | void OnGUI () { 16 | #NOTRIM# 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /ScriptTemplates/81b-C# Custom Editor Script-NewCustomEditorScript.cs.txt: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEditor; 5 | 6 | [CustomEditor(typeof (#SCRIPTNAME#))] 7 | [CanEditMultipleObjects] 8 | public class #SCRIPTNAME# : Editor { 9 | 10 | // Use this for initialization 11 | void OnEnable () { 12 | 13 | } 14 | 15 | // Use this for drawing the GUI 16 | public override void OnInspectorGUI () { 17 | 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /ScriptTemplates/81c-C# Interface Script-NewInterfaceScript.cs.txt: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | public interface #SCRIPTNAME# { 6 | 7 | void Sample (); 8 | 9 | } 10 | -------------------------------------------------------------------------------- /ScriptTemplates/81d-C# Property Drawer Script-NewPropertyDrawerScript.cs.txt: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEditor; 5 | 6 | [CustomPropertyDrawer (typeof (#SCRIPTNAME#))] 7 | public class #SCRIPTNAME# : PropertyDrawer { 8 | 9 | // Use this for drawing the GUI 10 | void OnGUI (Rect position, SerializedProperty property, GUIContent label) { 11 | 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /ScriptTemplates/README.md: -------------------------------------------------------------------------------- 1 | # Script Templates 2 | Script templates are plain text documents that contains a simple script functionally that let's you get started with script faster. 3 | 4 | Here we have bunch of script templates that makes your scripting more fun. 5 | 6 | ## Installation 7 | Download the script template(s) you want and copy them to: (Choose your current operating system) 8 | 9 | - **Windows**: C:\Program Files\Unity\Editor\Data\Resources\ScriptTemplates 10 | - **Mac**: /Applications/Unity/Editor/Data/Resources/ScriptTemplates 11 | - **Mac (since 5.2.1f1)**: /Applications/Unity/Unity.app/Contents/Resources/ScriptTemplates 12 | 13 | And paste them. (Some script templates may need replace confirmation) 14 | 15 | All done, now restart the Unity Editor and enjoy. 16 | 17 | ## Modification 18 | Every script template has a special format, this format consists of: 19 | 20 | **Format**: {Order in menu}-{Menu item name}-{Initial script name}.txt 21 | 22 | **Example**: 81a-C# Editor Script-NewEditorScript.cs.txt 23 | 24 | Also the content of the file contains a simple script that replaces it's class name with the entered name for the file. 25 | you can find it in the file by **#SCRIPTNAME#** tag. 26 | 27 | [**More information**](https://support.unity3d.com/hc/en-us/articles/210223733-How-to-customize-Unity-script-templates) 28 | 29 | ## License 30 | [MIT](https://github.com/UnityCommunity/UnityLibrary/blob/master/LICENSE.md) @ [Unity Community](https://github.com/UnityCommunity/) 31 | 32 | Made with :heart: by [Unity Community](https://github.com/UnityCommunity/) 33 | --------------------------------------------------------------------------------