├── ProjectSettings ├── ProjectVersion.txt ├── ClusterInputManager.asset ├── PresetManager.asset ├── EditorBuildSettings.asset ├── NetworkManager.asset ├── TimeManager.asset ├── AudioManager.asset ├── EditorSettings.asset ├── TagManager.asset ├── DynamicsManager.asset ├── UnityConnectSettings.asset ├── NavMeshAreas.asset ├── Physics2DSettings.asset ├── GraphicsSettings.asset ├── QualitySettings.asset └── InputManager.asset ├── images ├── icon.png ├── shapes.png └── window.png ├── Assets ├── Icons │ ├── icons.afdesign │ └── icons.afdesign.meta ├── ThisOtherThing │ ├── UI Shapes Kit │ │ ├── Geometry │ │ │ ├── Editor │ │ │ │ ├── Icons │ │ │ │ │ ├── Arc.png │ │ │ │ │ ├── Line.png │ │ │ │ │ ├── Ellipse.png │ │ │ │ │ ├── Polygon.png │ │ │ │ │ ├── Sector.png │ │ │ │ │ ├── PixelLine.png │ │ │ │ │ ├── Rectangle.png │ │ │ │ │ ├── EdgeGradient.png │ │ │ │ │ ├── EmptyFillRect.png │ │ │ │ │ ├── Arc.png.meta │ │ │ │ │ ├── Line.png.meta │ │ │ │ │ ├── Ellipse.png.meta │ │ │ │ │ ├── PixelLine.png.meta │ │ │ │ │ ├── Polygon.png.meta │ │ │ │ │ ├── Rectangle.png.meta │ │ │ │ │ ├── Sector.png.meta │ │ │ │ │ ├── EdgeGradient.png.meta │ │ │ │ │ └── EmptyFillRect.png.meta │ │ │ │ ├── Editors.meta │ │ │ │ ├── Icons.meta │ │ │ │ ├── CustomDrawers.meta │ │ │ │ ├── MenuItems.cs.meta │ │ │ │ ├── Editors │ │ │ │ │ ├── ArcEditor.cs.meta │ │ │ │ │ ├── LineEditor.cs.meta │ │ │ │ │ ├── SectorEditor.cs.meta │ │ │ │ │ ├── EllipseEditor.cs.meta │ │ │ │ │ ├── PixelLineEditor.cs.meta │ │ │ │ │ ├── PolygonEditor.cs.meta │ │ │ │ │ ├── RectangleEditor.cs.meta │ │ │ │ │ ├── EdgeGradientEditor.cs.meta │ │ │ │ │ ├── EmptyFillRectEditor.cs.meta │ │ │ │ │ ├── EmptyFillRectEditor.cs │ │ │ │ │ ├── EdgeGradientEditor.cs │ │ │ │ │ ├── PixelLineEditor.cs │ │ │ │ │ ├── SectorEditor.cs │ │ │ │ │ ├── EllipseEditor.cs │ │ │ │ │ ├── RectangleEditor.cs │ │ │ │ │ ├── ArcEditor.cs │ │ │ │ │ ├── PolygonEditor.cs │ │ │ │ │ └── LineEditor.cs │ │ │ │ ├── CustomDrawers │ │ │ │ │ ├── PointListDrawer.cs.meta │ │ │ │ │ ├── LinePropertiesDrawer.cs.meta │ │ │ │ │ ├── ShapePropertiesDrawer.cs.meta │ │ │ │ │ ├── EllipsePropertiesDrawer.cs.meta │ │ │ │ │ ├── PointListPropertiesDrawer.cs.meta │ │ │ │ │ ├── PolygonPropertiesDrawer.cs.meta │ │ │ │ │ ├── RoundedPropertiesDrawer.cs.meta │ │ │ │ │ ├── RoundingPropertiesDrawer.cs.meta │ │ │ │ │ ├── ShadowsPropertiesDrawer.cs.meta │ │ │ │ │ ├── OutlineShapePropertiesDrawer.cs.meta │ │ │ │ │ ├── ShapePropertiesDrawer.cs │ │ │ │ │ ├── RoundingPropertiesDrawer.cs │ │ │ │ │ ├── LinePropertiesDrawer.cs │ │ │ │ │ ├── EllipsePropertiesDrawer.cs │ │ │ │ │ ├── OutlineShapePropertiesDrawer.cs │ │ │ │ │ ├── PolygonPropertiesDrawer.cs │ │ │ │ │ ├── PointListDrawer.cs │ │ │ │ │ └── ShadowsPropertiesDrawer.cs │ │ │ │ └── MenuItems.cs │ │ │ ├── IShape.cs │ │ │ ├── Editor.meta │ │ │ ├── Shapes.meta │ │ │ ├── ShapeUtils.meta │ │ │ ├── ShapeUtils │ │ │ │ ├── PointsGenerators.meta │ │ │ │ ├── Arcs.cs.meta │ │ │ │ ├── Lines.cs.meta │ │ │ │ ├── Rects.cs.meta │ │ │ │ ├── Ellipses.cs.meta │ │ │ │ ├── PointsList.cs.meta │ │ │ │ ├── Polygons.cs.meta │ │ │ │ ├── RoundedRects.cs.meta │ │ │ │ └── PointsGenerators │ │ │ │ │ └── PointsGenerators.cs.meta │ │ │ ├── IShape.cs.meta │ │ │ ├── UIGeoUtils.cs.meta │ │ │ └── Shapes │ │ │ │ ├── Arc.cs.meta │ │ │ │ ├── Line.cs.meta │ │ │ │ ├── Ellipse.cs.meta │ │ │ │ ├── PixelLine.cs.meta │ │ │ │ ├── Polygon.cs.meta │ │ │ │ ├── Rectangle.cs.meta │ │ │ │ ├── Sector.cs.meta │ │ │ │ ├── EdgeGradient.cs.meta │ │ │ │ ├── EmptyFillRect.cs.meta │ │ │ │ ├── EmptyFillRect.cs │ │ │ │ ├── PixelLine.cs │ │ │ │ ├── Sector.cs │ │ │ │ ├── EdgeGradient.cs │ │ │ │ ├── Polygon.cs │ │ │ │ ├── Ellipse.cs │ │ │ │ ├── Line.cs │ │ │ │ └── Rectangle.cs │ │ ├── Examples │ │ │ ├── Overview.unity.meta │ │ │ ├── Animation │ │ │ │ ├── Animation.unity.meta │ │ │ │ ├── Animation.anim.meta │ │ │ │ ├── Canvas.controller.meta │ │ │ │ └── Canvas.controller │ │ │ └── Animation.meta │ │ ├── Examples.meta │ │ └── Geometry.meta │ ├── Utils.meta │ ├── UI Shapes Kit.meta │ └── Utils │ │ ├── Animation.meta │ │ ├── Attributes.meta │ │ ├── Animation │ │ ├── Editor.meta │ │ ├── ValueSetter.cs.meta │ │ ├── ValueSetter2.cs.meta │ │ ├── Editor │ │ │ ├── ValueSetterEditor.cs.meta │ │ │ ├── ValueSetterEditor2.cs.meta │ │ │ ├── ValueSetterEditor2.cs │ │ │ └── ValueSetterEditor.cs │ │ ├── ValueSetter.cs │ │ └── ValueSetter2.cs │ │ └── Attributes │ │ ├── Editor.meta │ │ ├── MinAttribute.cs.meta │ │ ├── Editor │ │ ├── MinAttributeDrawer.cs.meta │ │ └── MinAttributeDrawer.cs │ │ └── MinAttribute.cs ├── Icons.meta ├── TestShaders.meta ├── ThisOtherThing.meta └── TestShaders │ ├── lineUvTest.shader.meta │ ├── uiUvTest.shader.meta │ ├── Unlit_lineUvTest.mat.meta │ ├── Unlit_uiUvTest.mat.meta │ ├── Unlit_uiUvTest.mat │ ├── Unlit_lineUvTest.mat │ ├── uiUvTest.shader │ └── lineUvTest.shader ├── todo.txt ├── .gitignore ├── LICENSE ├── Packages └── manifest.json ├── README.md └── CODE_OF_CONDUCT.md /ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 2018.2.3f1 2 | -------------------------------------------------------------------------------- /images/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thisotherthing/ui-shapes-kit/HEAD/images/icon.png -------------------------------------------------------------------------------- /images/shapes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thisotherthing/ui-shapes-kit/HEAD/images/shapes.png -------------------------------------------------------------------------------- /images/window.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thisotherthing/ui-shapes-kit/HEAD/images/window.png -------------------------------------------------------------------------------- /Assets/Icons/icons.afdesign: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thisotherthing/ui-shapes-kit/HEAD/Assets/Icons/icons.afdesign -------------------------------------------------------------------------------- /ProjectSettings/ClusterInputManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!236 &1 4 | ClusterInputManager: 5 | m_ObjectHideFlags: 0 6 | m_Inputs: [] 7 | -------------------------------------------------------------------------------- /ProjectSettings/PresetManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1386491679 &1 4 | PresetManager: 5 | m_ObjectHideFlags: 0 6 | m_DefaultList: [] 7 | -------------------------------------------------------------------------------- /Assets/ThisOtherThing/UI Shapes Kit/Geometry/Editor/Icons/Arc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thisotherthing/ui-shapes-kit/HEAD/Assets/ThisOtherThing/UI Shapes Kit/Geometry/Editor/Icons/Arc.png -------------------------------------------------------------------------------- /Assets/ThisOtherThing/UI Shapes Kit/Geometry/Editor/Icons/Line.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thisotherthing/ui-shapes-kit/HEAD/Assets/ThisOtherThing/UI Shapes Kit/Geometry/Editor/Icons/Line.png -------------------------------------------------------------------------------- /Assets/ThisOtherThing/UI Shapes Kit/Geometry/Editor/Icons/Ellipse.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thisotherthing/ui-shapes-kit/HEAD/Assets/ThisOtherThing/UI Shapes Kit/Geometry/Editor/Icons/Ellipse.png -------------------------------------------------------------------------------- /Assets/ThisOtherThing/UI Shapes Kit/Geometry/Editor/Icons/Polygon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thisotherthing/ui-shapes-kit/HEAD/Assets/ThisOtherThing/UI Shapes Kit/Geometry/Editor/Icons/Polygon.png -------------------------------------------------------------------------------- /Assets/ThisOtherThing/UI Shapes Kit/Geometry/Editor/Icons/Sector.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thisotherthing/ui-shapes-kit/HEAD/Assets/ThisOtherThing/UI Shapes Kit/Geometry/Editor/Icons/Sector.png -------------------------------------------------------------------------------- /Assets/ThisOtherThing/UI Shapes Kit/Geometry/Editor/Icons/PixelLine.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thisotherthing/ui-shapes-kit/HEAD/Assets/ThisOtherThing/UI Shapes Kit/Geometry/Editor/Icons/PixelLine.png -------------------------------------------------------------------------------- /Assets/ThisOtherThing/UI Shapes Kit/Geometry/Editor/Icons/Rectangle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thisotherthing/ui-shapes-kit/HEAD/Assets/ThisOtherThing/UI Shapes Kit/Geometry/Editor/Icons/Rectangle.png -------------------------------------------------------------------------------- /ProjectSettings/EditorBuildSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1045 &1 4 | EditorBuildSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Scenes: [] 8 | -------------------------------------------------------------------------------- /Assets/ThisOtherThing/UI Shapes Kit/Geometry/Editor/Icons/EdgeGradient.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thisotherthing/ui-shapes-kit/HEAD/Assets/ThisOtherThing/UI Shapes Kit/Geometry/Editor/Icons/EdgeGradient.png -------------------------------------------------------------------------------- /Assets/ThisOtherThing/UI Shapes Kit/Geometry/Editor/Icons/EmptyFillRect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thisotherthing/ui-shapes-kit/HEAD/Assets/ThisOtherThing/UI Shapes Kit/Geometry/Editor/Icons/EmptyFillRect.png -------------------------------------------------------------------------------- /ProjectSettings/NetworkManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!149 &1 4 | NetworkManager: 5 | m_ObjectHideFlags: 0 6 | m_DebugLevel: 0 7 | m_Sendrate: 15 8 | m_AssetToPrefab: {} 9 | -------------------------------------------------------------------------------- /ProjectSettings/TimeManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!5 &1 4 | TimeManager: 5 | m_ObjectHideFlags: 0 6 | Fixed Timestep: 0.02 7 | Maximum Allowed Timestep: 0.33333334 8 | m_TimeScale: 1 9 | -------------------------------------------------------------------------------- /Assets/Icons/icons.afdesign.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 52f828617c2c34011a10014f24d1d44a 3 | timeCreated: 1483998614 4 | licenseType: Pro 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Icons.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0462443a0cbd6424e869422f00023813 3 | folderAsset: yes 4 | timeCreated: 1483998614 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/TestShaders.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0a4a865373f144800965e3ce4d3b6b45 3 | folderAsset: yes 4 | timeCreated: 1498674754 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/ThisOtherThing.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2ec9da6baf23a4444bca1986e896cbd5 3 | folderAsset: yes 4 | timeCreated: 1477221822 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/ThisOtherThing/UI Shapes Kit/Examples/Overview.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e7ee9bcfad4d64e5788abfce66d78641 3 | timeCreated: 1477222884 4 | licenseType: Pro 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/ThisOtherThing/Utils.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 71aa0ec0f43164919a6b534e4bba4e0b 3 | folderAsset: yes 4 | timeCreated: 1484492425 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/ThisOtherThing/UI Shapes Kit.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3d4fb24232c0246a491fdef6f3b40fd4 3 | folderAsset: yes 4 | timeCreated: 1477927448 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/TestShaders/lineUvTest.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8f1d77282460e4c77b6cd1cb716a743f 3 | timeCreated: 1497430631 4 | licenseType: Pro 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/TestShaders/uiUvTest.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b4afa1c3386df43aa8236e4476ae6419 3 | timeCreated: 1493506860 4 | licenseType: Pro 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/ThisOtherThing/UI Shapes Kit/Examples/Animation/Animation.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4feb3994495914d2fbbed80818157c05 3 | timeCreated: 1498573182 4 | licenseType: Pro 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/ThisOtherThing/Utils/Animation.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 781e6af77ecca4b62ab2dc69a248199f 3 | folderAsset: yes 4 | timeCreated: 1498587719 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/ThisOtherThing/Utils/Attributes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d30bbbdbaa3b044b0a5dba78b8c5b0e1 3 | folderAsset: yes 4 | timeCreated: 1485189066 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/ThisOtherThing/UI Shapes Kit/Examples.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0f7519005156545ec863b38551c03801 3 | folderAsset: yes 4 | timeCreated: 1498573286 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/ThisOtherThing/UI Shapes Kit/Geometry.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d838ec84972754699ae931b0a6b2a187 3 | folderAsset: yes 4 | timeCreated: 1471380978 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/ThisOtherThing/UI Shapes Kit/Geometry/IShape.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace ThisOtherThing.UI.Shapes 6 | { 7 | public interface IShape 8 | { 9 | void ForceMeshUpdate(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Assets/ThisOtherThing/Utils/Animation/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b45e22a4fae4943f08792d0207e4f731 3 | folderAsset: yes 4 | timeCreated: 1498587762 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/ThisOtherThing/Utils/Attributes/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 26246c145b7224dbb8e5e37e583053fd 3 | folderAsset: yes 4 | timeCreated: 1484492510 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/ThisOtherThing/UI Shapes Kit/Geometry/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5ba3e364fda66495b96710faa71e2f99 3 | folderAsset: yes 4 | timeCreated: 1483196694 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/ThisOtherThing/UI Shapes Kit/Geometry/Shapes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6dea5eae846964c3aadec297f31881d9 3 | folderAsset: yes 4 | timeCreated: 1477305732 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/TestShaders/Unlit_lineUvTest.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f2702209233964cd2a55eb5e9a96af4a 3 | timeCreated: 1497430889 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | mainObjectFileID: 2100000 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/TestShaders/Unlit_uiUvTest.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b3d31c4193a684ac89215a6a314ca4e0 3 | timeCreated: 1493506876 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | mainObjectFileID: 2100000 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/ThisOtherThing/UI Shapes Kit/Examples/Animation.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2a15183eaf7ef45b7bc290c7e3705bd4 3 | folderAsset: yes 4 | timeCreated: 1498573276 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/ThisOtherThing/UI Shapes Kit/Geometry/ShapeUtils.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fbc313fa8891d4c26a115d1f5f743368 3 | folderAsset: yes 4 | timeCreated: 1477306207 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/ThisOtherThing/UI Shapes Kit/Geometry/Editor/Editors.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6d76a0c6dad6442debd6d07133505cdc 3 | folderAsset: yes 4 | timeCreated: 1483658007 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/ThisOtherThing/UI Shapes Kit/Geometry/Editor/Icons.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 27865421daf3746428ac17cc09bd4d84 3 | folderAsset: yes 4 | timeCreated: 1483998614 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/ThisOtherThing/UI Shapes Kit/Geometry/Editor/CustomDrawers.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a34ef4704abcc4bf1b222bc7a441b2d0 3 | folderAsset: yes 4 | timeCreated: 1483657992 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/ThisOtherThing/UI Shapes Kit/Geometry/ShapeUtils/PointsGenerators.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 20e57da70ab774ea69aded611d013b3d 3 | folderAsset: yes 4 | timeCreated: 1485249360 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/ThisOtherThing/UI Shapes Kit/Examples/Animation/Animation.anim.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8d30306302b294371a1b5fb4e7742aca 3 | timeCreated: 1498573276 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | mainObjectFileID: 7400000 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/ThisOtherThing/UI Shapes Kit/Examples/Animation/Canvas.controller.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dfcbbeab99e0649b6b626b8fa47b6742 3 | timeCreated: 1498573276 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | mainObjectFileID: 9100000 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/ThisOtherThing/UI Shapes Kit/Geometry/IShape.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c88d75e266b174b58a339abee20fb364 3 | timeCreated: 1498625803 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/ThisOtherThing/Utils/Animation/ValueSetter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2311c7ef9ff3241e9bd25e7e84e505cc 3 | timeCreated: 1498587728 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/ThisOtherThing/Utils/Animation/ValueSetter2.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 459cf18c0ce804734a560d31e594018f 3 | timeCreated: 1498587728 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/ThisOtherThing/Utils/Attributes/MinAttribute.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8e2d60cc0d2f840a2af3ce58ddf55209 3 | timeCreated: 1484492441 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/ThisOtherThing/UI Shapes Kit/Geometry/UIGeoUtils.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 92c70941adc6340ad8756f7924a5a10c 3 | timeCreated: 1477830390 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/ThisOtherThing/UI Shapes Kit/Geometry/Editor/MenuItems.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c0fa5f6db720c4e979186c6a13ad03e6 3 | timeCreated: 1493806815 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/ThisOtherThing/UI Shapes Kit/Geometry/ShapeUtils/Arcs.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 127ae285312e74e3ea20a86a7f5f25ab 3 | timeCreated: 1477395627 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/ThisOtherThing/UI Shapes Kit/Geometry/ShapeUtils/Lines.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b66db35bb1a1e462ab14182986a3a9e0 3 | timeCreated: 1477927650 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/ThisOtherThing/UI Shapes Kit/Geometry/ShapeUtils/Rects.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d7006d1ec7d3c46ff85252e808da72a0 3 | timeCreated: 1477306159 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/ThisOtherThing/Utils/Animation/Editor/ValueSetterEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 372d521f2ea454d3197abc934351c016 3 | timeCreated: 1498587769 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/ThisOtherThing/UI Shapes Kit/Geometry/ShapeUtils/Ellipses.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ad0cef9c395df41acbda81e78fc4a049 3 | timeCreated: 1483372773 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/ThisOtherThing/UI Shapes Kit/Geometry/ShapeUtils/PointsList.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bd145542605fc4cd783afc971b81c788 3 | timeCreated: 1479805426 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/ThisOtherThing/UI Shapes Kit/Geometry/ShapeUtils/Polygons.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5db9e114ce68346179b6a45c6a60f786 3 | timeCreated: 1479382360 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/ThisOtherThing/Utils/Animation/Editor/ValueSetterEditor2.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e48e4913fa8a347c685cc74e621299bb 3 | timeCreated: 1498587769 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/ThisOtherThing/Utils/Attributes/Editor/MinAttributeDrawer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2e1ec6b6a75d94521839e015b171c16b 3 | timeCreated: 1484492523 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/ThisOtherThing/UI Shapes Kit/Geometry/Editor/Editors/ArcEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ff363083422434b308fa75f4dde36cd0 3 | timeCreated: 1483990892 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/ThisOtherThing/UI Shapes Kit/Geometry/Editor/Editors/LineEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fe7ecbab103a4408d99cc3184d24fba4 3 | timeCreated: 1483196736 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/ThisOtherThing/UI Shapes Kit/Geometry/Editor/Editors/SectorEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b5dcaad6371644fc49154165b3615b4f 3 | timeCreated: 1483991154 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/ThisOtherThing/UI Shapes Kit/Geometry/ShapeUtils/RoundedRects.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3a731b3bcf82f4698b1036fe38e48a9e 3 | timeCreated: 1477309522 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/ThisOtherThing/UI Shapes Kit/Geometry/Editor/Editors/EllipseEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0e3f4ecce2f664000ad5960cdc47bb58 3 | timeCreated: 1483989445 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/ThisOtherThing/UI Shapes Kit/Geometry/Editor/Editors/PixelLineEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9d7411872e3b94e3783fbeb3ccbf2588 3 | timeCreated: 1483987036 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/ThisOtherThing/UI Shapes Kit/Geometry/Editor/Editors/PolygonEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 376c44824fcd2450bbdefbe1a20145d9 3 | timeCreated: 1483208405 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/ThisOtherThing/UI Shapes Kit/Geometry/Editor/Editors/RectangleEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9a8bf33ed14a24256b10b726cf24c26a 3 | timeCreated: 1483990388 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/ThisOtherThing/UI Shapes Kit/Geometry/Editor/CustomDrawers/PointListDrawer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0d30e1a75b4c74fb3a7160892bec3eab 3 | timeCreated: 1483299301 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/ThisOtherThing/UI Shapes Kit/Geometry/Editor/Editors/EdgeGradientEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 551176190a4ea4396b48999613f45ca2 3 | timeCreated: 1483988024 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/ThisOtherThing/UI Shapes Kit/Geometry/Editor/Editors/EmptyFillRectEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fb069d3596d05483eae28d65f767eb1b 3 | timeCreated: 1483985660 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/ThisOtherThing/UI Shapes Kit/Geometry/Editor/CustomDrawers/LinePropertiesDrawer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ca4d34440554c417b86c8e27843dc5eb 3 | timeCreated: 1484241961 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/ThisOtherThing/UI Shapes Kit/Geometry/Editor/CustomDrawers/ShapePropertiesDrawer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8efe5e26a7f3c4ba2845e34e7f06855f 3 | timeCreated: 1483908835 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/ThisOtherThing/UI Shapes Kit/Geometry/Editor/CustomDrawers/EllipsePropertiesDrawer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d181d156721e94b72880d6c96f42257a 3 | timeCreated: 1483372883 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/ThisOtherThing/UI Shapes Kit/Geometry/Editor/CustomDrawers/PointListPropertiesDrawer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f147fff7b961c48f197c5f803fcb3993 3 | timeCreated: 1484241961 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/ThisOtherThing/UI Shapes Kit/Geometry/Editor/CustomDrawers/PolygonPropertiesDrawer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a0731d003b0954be980bad6716ac242f 3 | timeCreated: 1483658067 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/ThisOtherThing/UI Shapes Kit/Geometry/Editor/CustomDrawers/RoundedPropertiesDrawer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9514359060ed14772a2def1844c4c82e 3 | timeCreated: 1483358289 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/ThisOtherThing/UI Shapes Kit/Geometry/Editor/CustomDrawers/RoundingPropertiesDrawer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5e8317fe3b53847848a7009a374b1d6f 3 | timeCreated: 1483366599 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/ThisOtherThing/UI Shapes Kit/Geometry/Editor/CustomDrawers/ShadowsPropertiesDrawer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8ea64c1e343c14bc097e08821ea96ee3 3 | timeCreated: 1483814684 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/ThisOtherThing/UI Shapes Kit/Geometry/ShapeUtils/PointsGenerators/PointsGenerators.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9eae27491a1ea42be8f56978d929c5d5 3 | timeCreated: 1485249370 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/ThisOtherThing/UI Shapes Kit/Geometry/Editor/CustomDrawers/OutlineShapePropertiesDrawer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7c9cd09f79f7c4befbb8161ca198a9a4 3 | timeCreated: 1483938038 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/ThisOtherThing/UI Shapes Kit/Geometry/Shapes/Arc.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a72bb19132f6b485c9709b0ba738a558 3 | timeCreated: 1484000693 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {fileID: 2800000, guid: e8aff800bb7ca40b98c2be9446f4d477, type: 3} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/ThisOtherThing/UI Shapes Kit/Geometry/Shapes/Line.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a305c46669c4c4e8ca0f75ccafaea1ab 3 | timeCreated: 1484244715 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {fileID: 2800000, guid: 6e619290b04324a9991e268915eacde1, type: 3} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/ThisOtherThing/UI Shapes Kit/Geometry/Shapes/Ellipse.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 628d7d29024984117a9b515c9a8527a9 3 | timeCreated: 1483998813 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {fileID: 2800000, guid: 4970b109d6adc491dac8ad3cbcb5f46f, type: 3} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/ThisOtherThing/UI Shapes Kit/Geometry/Shapes/PixelLine.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 228d07dbb186d47959b9badfdeaac2eb 3 | timeCreated: 1484004301 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {fileID: 2800000, guid: 4faba3079041d4fa695831c2d408eb0c, type: 3} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/ThisOtherThing/UI Shapes Kit/Geometry/Shapes/Polygon.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 57dfd76833af642b2a35764a7676928a 3 | timeCreated: 1484006169 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {fileID: 2800000, guid: b4b375e38b4194fbd8b936c168a6b85f, type: 3} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/ThisOtherThing/UI Shapes Kit/Geometry/Shapes/Rectangle.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9a832df0d7bb845ec878cc0adac39c0f 3 | timeCreated: 1483999477 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {fileID: 2800000, guid: fc78df1d26d14400997949af8a512abc, type: 3} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/ThisOtherThing/UI Shapes Kit/Geometry/Shapes/Sector.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 87867942ad5644cf2b3d0b17d85ebaf2 3 | timeCreated: 1484002151 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {fileID: 2800000, guid: 97adddb811011441c98e6899e7ebf2ed, type: 3} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /ProjectSettings/AudioManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!11 &1 4 | AudioManager: 5 | m_ObjectHideFlags: 0 6 | m_Volume: 1 7 | Rolloff Scale: 1 8 | Doppler Factor: 1 9 | Default Speaker Mode: 2 10 | m_SampleRate: 0 11 | m_DSPBufferSize: 0 12 | m_VirtualVoiceCount: 512 13 | m_RealVoiceCount: 32 14 | m_SpatializerPlugin: 15 | m_DisableAudio: 0 16 | m_VirtualizeEffects: 1 17 | -------------------------------------------------------------------------------- /Assets/ThisOtherThing/UI Shapes Kit/Geometry/Shapes/EdgeGradient.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cd2d30215909f46179b7032389ddc177 3 | timeCreated: 1484002540 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {fileID: 2800000, guid: 275da091860824010b2df2bfbb37d887, type: 3} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/ThisOtherThing/UI Shapes Kit/Geometry/Shapes/EmptyFillRect.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ef1fd207c9e38406699574f6258d60bd 3 | timeCreated: 1484002856 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {fileID: 2800000, guid: b5982c025774e4848aa93c34c790f5dd, type: 3} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/ThisOtherThing/Utils/Attributes/MinAttribute.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace ThisOtherThing.Utils 4 | { 5 | public class MinAttribute : PropertyAttribute 6 | { 7 | public readonly float minFloat; 8 | public readonly int minInt; 9 | 10 | public MinAttribute(float min) 11 | { 12 | this.minFloat = min; 13 | } 14 | 15 | public MinAttribute(int min) 16 | { 17 | this.minInt = min; 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /todo.txt: -------------------------------------------------------------------------------- 1 | - optimize PointsGenerators by caching sin/cos resuls 2 | - add arrow line caps 3 | - add point drawer with PointList? 4 | - add dashed line drawer with PointList? 5 | - shadows 6 | - add resolution and radius overrider? 7 | - maybe inner glow 8 | - add UVs to shapes 9 | - normalized on shape bounds 10 | - screenspace (have same texture across multiple shapes without seams) 11 | - add shift move axis snapping to point list editor -------------------------------------------------------------------------------- /Assets/ThisOtherThing/UI Shapes Kit/Geometry/Shapes/EmptyFillRect.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEngine.UI; 3 | 4 | namespace ThisOtherThing.UI.Shapes 5 | { 6 | 7 | [AddComponentMenu("UI/Shapes/Empty Fill Rect", 200)] 8 | public class EmptyFillRect : Graphic 9 | { 10 | public override void SetMaterialDirty() { return; } 11 | public override void SetVerticesDirty() { return; } 12 | 13 | protected override void OnPopulateMesh(VertexHelper vh) 14 | { 15 | vh.Clear(); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /ProjectSettings/EditorSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!159 &1 4 | EditorSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 3 7 | m_ExternalVersionControlSupport: Visible Meta Files 8 | m_SerializationMode: 2 9 | m_WebSecurityEmulationEnabled: 0 10 | m_WebSecurityEmulationHostUrl: http://www.mydomain.com/mygame.unity3d 11 | m_DefaultBehaviorMode: 1 12 | m_SpritePackerMode: 2 13 | m_SpritePackerPaddingPower: 1 14 | m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd 15 | m_ProjectGenerationRootNamespace: 16 | -------------------------------------------------------------------------------- /ProjectSettings/TagManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!78 &1 4 | TagManager: 5 | serializedVersion: 2 6 | tags: [] 7 | layers: 8 | - Default 9 | - TransparentFX 10 | - Ignore Raycast 11 | - 12 | - Water 13 | - UI 14 | - 15 | - 16 | - 17 | - 18 | - 19 | - 20 | - 21 | - 22 | - 23 | - 24 | - 25 | - 26 | - 27 | - 28 | - 29 | - 30 | - 31 | - 32 | - 33 | - 34 | - 35 | - 36 | - 37 | - 38 | - 39 | - 40 | m_SortingLayers: 41 | - name: Default 42 | uniqueID: 0 43 | locked: 0 44 | -------------------------------------------------------------------------------- /Assets/ThisOtherThing/UI Shapes Kit/Geometry/Editor/Editors/EmptyFillRectEditor.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditor; 3 | using UnityEditor.UI; 4 | 5 | using EmptyFillRect = ThisOtherThing.UI.Shapes.EmptyFillRect; 6 | 7 | [CustomEditor(typeof(EmptyFillRect))] 8 | [CanEditMultipleObjects] 9 | public class EmptyFillRectEditor : GraphicEditor 10 | { 11 | protected override void OnEnable() 12 | { 13 | base.OnEnable(); 14 | } 15 | 16 | public override void OnInspectorGUI() 17 | { 18 | serializedObject.Update(); 19 | 20 | RaycastControlsGUI(); 21 | 22 | serializedObject.ApplyModifiedProperties(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /[Ll]ibrary/ 2 | /[Tt]emp/ 3 | /[Oo]bj/ 4 | /[Bb]uild/ 5 | /[Bb]uilds/ 6 | /Assets/AssetStoreTools* 7 | 8 | # Rendered output 9 | *.mov 10 | 11 | # Visual Studio 2015 cache directory 12 | /.vs/ 13 | 14 | # Autogenerated VS/MD/Consulo solution and project files 15 | ExportedObj/ 16 | .consulo/ 17 | *.csproj 18 | *.unityproj 19 | *.sln 20 | *.suo 21 | *.tmp 22 | *.user 23 | *.userprefs 24 | *.pidb 25 | *.booproj 26 | *.svd 27 | *.pdb 28 | 29 | # Unity3D generated meta files 30 | *.pidb.meta 31 | 32 | # Unity3D Generated File On Crash Reports 33 | sysinfo.txt 34 | 35 | # Builds 36 | *.apk 37 | *.unitypackage 38 | 39 | # visual studio code unity integration 40 | .vscode/ 41 | .vscode/launch.json 42 | 43 | 44 | # Mac OS X hidden files 45 | .DS_Store -------------------------------------------------------------------------------- /ProjectSettings/DynamicsManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!55 &1 4 | PhysicsManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Gravity: {x: 0, y: -9.81, z: 0} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_BounceThreshold: 2 10 | m_SleepThreshold: 0.005 11 | m_DefaultContactOffset: 0.01 12 | m_SolverIterationCount: 6 13 | m_SolverVelocityIterations: 1 14 | m_QueriesHitTriggers: 1 15 | m_EnableAdaptiveForce: 0 16 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 17 | -------------------------------------------------------------------------------- /ProjectSettings/UnityConnectSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!310 &1 4 | UnityConnectSettings: 5 | m_ObjectHideFlags: 0 6 | m_Enabled: 0 7 | m_TestMode: 0 8 | m_TestEventUrl: 9 | m_TestConfigUrl: 10 | CrashReportingSettings: 11 | m_EventUrl: https://perf-events.cloud.unity3d.com/api/events/crashes 12 | m_Enabled: 0 13 | m_CaptureEditorExceptions: 1 14 | UnityPurchasingSettings: 15 | m_Enabled: 0 16 | m_TestMode: 0 17 | UnityAnalyticsSettings: 18 | m_Enabled: 1 19 | m_InitializeOnStartup: 1 20 | m_TestMode: 0 21 | m_TestEventUrl: 22 | m_TestConfigUrl: 23 | UnityAdsSettings: 24 | m_Enabled: 0 25 | m_InitializeOnStartup: 1 26 | m_TestMode: 0 27 | m_EnabledPlatforms: 4294967295 28 | m_IosGameId: 29 | m_AndroidGameId: 30 | -------------------------------------------------------------------------------- /Assets/ThisOtherThing/Utils/Attributes/Editor/MinAttributeDrawer.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditor; 3 | 4 | using ThisOtherThing.Utils; 5 | 6 | namespace ThisOtherThing 7 | { 8 | [CustomPropertyDrawer(typeof(MinAttribute))] 9 | public class MinDrawer : PropertyDrawer 10 | { 11 | public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) 12 | { 13 | MinAttribute attribute = (MinAttribute)base.attribute; 14 | 15 | switch (property.propertyType) 16 | { 17 | case SerializedPropertyType.Integer: 18 | int valueI = EditorGUI.IntField(position, label, property.intValue); 19 | property.intValue = Mathf.Max(valueI, attribute.minInt); 20 | break; 21 | case SerializedPropertyType.Float: 22 | float valueF = EditorGUI.FloatField(position, label, property.floatValue); 23 | property.floatValue = Mathf.Max(valueF, attribute.minFloat); 24 | break; 25 | } 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Assets/TestShaders/Unlit_uiUvTest.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_PrefabParentObject: {fileID: 0} 8 | m_PrefabInternal: {fileID: 0} 9 | m_Name: Unlit_uiUvTest 10 | m_Shader: {fileID: 4800000, guid: b4afa1c3386df43aa8236e4476ae6419, type: 3} 11 | m_ShaderKeywords: 12 | m_LightmapFlags: 4 13 | m_EnableInstancingVariants: 0 14 | m_CustomRenderQueue: -1 15 | stringTagMap: {} 16 | disabledShaderPasses: [] 17 | m_SavedProperties: 18 | serializedVersion: 3 19 | m_TexEnvs: 20 | - _MainTex: 21 | m_Texture: {fileID: 0} 22 | m_Scale: {x: 1, y: 1} 23 | m_Offset: {x: 0, y: 0} 24 | m_Floats: 25 | - _ColorMask: 15 26 | - _Stencil: 0 27 | - _StencilComp: 8 28 | - _StencilOp: 0 29 | - _StencilReadMask: 255 30 | - _StencilWriteMask: 255 31 | - _UseUIAlphaClip: 0 32 | m_Colors: 33 | - _Color: {r: 1, g: 1, b: 1, a: 1} 34 | -------------------------------------------------------------------------------- /Assets/TestShaders/Unlit_lineUvTest.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_PrefabParentObject: {fileID: 0} 8 | m_PrefabInternal: {fileID: 0} 9 | m_Name: Unlit_lineUvTest 10 | m_Shader: {fileID: 4800000, guid: 8f1d77282460e4c77b6cd1cb716a743f, type: 3} 11 | m_ShaderKeywords: 12 | m_LightmapFlags: 4 13 | m_EnableInstancingVariants: 0 14 | m_CustomRenderQueue: -1 15 | stringTagMap: {} 16 | disabledShaderPasses: [] 17 | m_SavedProperties: 18 | serializedVersion: 3 19 | m_TexEnvs: 20 | - _MainTex: 21 | m_Texture: {fileID: 0} 22 | m_Scale: {x: 1, y: 1} 23 | m_Offset: {x: 0, y: 0} 24 | m_Floats: 25 | - _ColorMask: 15 26 | - _Stencil: 0 27 | - _StencilComp: 8 28 | - _StencilOp: 0 29 | - _StencilReadMask: 255 30 | - _StencilWriteMask: 255 31 | - _UseUIAlphaClip: 0 32 | m_Colors: 33 | - _Color: {r: 1, g: 1, b: 1, a: 1} 34 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 thisotherthing 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 | -------------------------------------------------------------------------------- /ProjectSettings/NavMeshAreas.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!126 &1 4 | NavMeshAreas: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | areas: 8 | - name: Walkable 9 | cost: 1 10 | - name: Not Walkable 11 | cost: 1 12 | - name: Jump 13 | cost: 2 14 | - name: 15 | cost: 1 16 | - name: 17 | cost: 1 18 | - name: 19 | cost: 1 20 | - name: 21 | cost: 1 22 | - name: 23 | cost: 1 24 | - name: 25 | cost: 1 26 | - name: 27 | cost: 1 28 | - name: 29 | cost: 1 30 | - name: 31 | cost: 1 32 | - name: 33 | cost: 1 34 | - name: 35 | cost: 1 36 | - name: 37 | cost: 1 38 | - name: 39 | cost: 1 40 | - name: 41 | cost: 1 42 | - name: 43 | cost: 1 44 | - name: 45 | cost: 1 46 | - name: 47 | cost: 1 48 | - name: 49 | cost: 1 50 | - name: 51 | cost: 1 52 | - name: 53 | cost: 1 54 | - name: 55 | cost: 1 56 | - name: 57 | cost: 1 58 | - name: 59 | cost: 1 60 | - name: 61 | cost: 1 62 | - name: 63 | cost: 1 64 | - name: 65 | cost: 1 66 | - name: 67 | cost: 1 68 | - name: 69 | cost: 1 70 | - name: 71 | cost: 1 72 | -------------------------------------------------------------------------------- /Assets/ThisOtherThing/UI Shapes Kit/Geometry/Editor/Editors/EdgeGradientEditor.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditor; 3 | using UnityEditor.UI; 4 | 5 | using EdgeGradient = ThisOtherThing.UI.Shapes.EdgeGradient; 6 | 7 | [CustomEditor(typeof(EdgeGradient))] 8 | [CanEditMultipleObjects] 9 | public class EdgeGradientEditor : GraphicEditor 10 | { 11 | protected SerializedProperty materialProp; 12 | protected SerializedProperty raycastTargetProp; 13 | 14 | protected SerializedProperty propertiesProp; 15 | 16 | protected override void OnEnable() 17 | { 18 | materialProp = serializedObject.FindProperty("m_Material"); 19 | raycastTargetProp = serializedObject.FindProperty("m_RaycastTarget"); 20 | 21 | propertiesProp = serializedObject.FindProperty("Properties"); 22 | } 23 | 24 | protected override void OnDisable() 25 | { 26 | Tools.hidden = false; 27 | } 28 | 29 | public override void OnInspectorGUI() 30 | { 31 | serializedObject.Update(); 32 | 33 | EditorGUILayout.PropertyField(materialProp); 34 | EditorGUILayout.PropertyField(raycastTargetProp); 35 | EditorGUILayout.Space(); 36 | 37 | EditorGUILayout.PropertyField(propertiesProp, new GUIContent("Edges"), true); 38 | 39 | serializedObject.ApplyModifiedProperties(); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /ProjectSettings/Physics2DSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!19 &1 4 | Physics2DSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Gravity: {x: 0, y: -9.81} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_VelocityIterations: 8 10 | m_PositionIterations: 3 11 | m_VelocityThreshold: 1 12 | m_MaxLinearCorrection: 0.2 13 | m_MaxAngularCorrection: 8 14 | m_MaxTranslationSpeed: 100 15 | m_MaxRotationSpeed: 360 16 | m_MinPenetrationForPenalty: 0.01 17 | m_BaumgarteScale: 0.2 18 | m_BaumgarteTimeOfImpactScale: 0.75 19 | m_TimeToSleep: 0.5 20 | m_LinearSleepTolerance: 0.01 21 | m_AngularSleepTolerance: 2 22 | m_QueriesHitTriggers: 1 23 | m_QueriesStartInColliders: 1 24 | m_ChangeStopsCallbacks: 0 25 | m_AlwaysShowColliders: 0 26 | m_ShowColliderSleep: 1 27 | m_ShowColliderContacts: 0 28 | m_ContactArrowScale: 0.2 29 | m_ColliderAwakeColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.7529412} 30 | m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432} 31 | m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745} 32 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 33 | -------------------------------------------------------------------------------- /Assets/ThisOtherThing/UI Shapes Kit/Geometry/Editor/Editors/PixelLineEditor.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditor; 3 | using UnityEditor.UI; 4 | 5 | using PixelLine = ThisOtherThing.UI.Shapes.PixelLine; 6 | 7 | [CustomEditor(typeof(PixelLine))] 8 | [CanEditMultipleObjects] 9 | public class PixelLineEditor : GraphicEditor 10 | { 11 | protected SerializedProperty colorProp; 12 | protected SerializedProperty materialProp; 13 | protected SerializedProperty raycastTargetProp; 14 | 15 | protected SerializedProperty lineWeightProp; 16 | protected SerializedProperty snappedPropertiesProp; 17 | 18 | protected override void OnEnable() 19 | { 20 | colorProp = serializedObject.FindProperty("m_Color"); 21 | materialProp = serializedObject.FindProperty("m_Material"); 22 | raycastTargetProp = serializedObject.FindProperty("m_RaycastTarget"); 23 | 24 | lineWeightProp = serializedObject.FindProperty("LineWeight"); 25 | snappedPropertiesProp = serializedObject.FindProperty("SnappedProperties"); 26 | } 27 | 28 | protected override void OnDisable() 29 | { 30 | Tools.hidden = false; 31 | } 32 | 33 | public override void OnInspectorGUI() 34 | { 35 | serializedObject.Update(); 36 | 37 | EditorGUILayout.PropertyField(colorProp); 38 | EditorGUILayout.PropertyField(materialProp); 39 | EditorGUILayout.PropertyField(raycastTargetProp); 40 | EditorGUILayout.Space(); 41 | 42 | EditorGUILayout.PropertyField(lineWeightProp); 43 | 44 | EditorGUILayout.Space(); 45 | 46 | EditorGUILayout.PropertyField(snappedPropertiesProp, true); 47 | 48 | serializedObject.ApplyModifiedProperties(); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /Assets/ThisOtherThing/UI Shapes Kit/Geometry/Editor/CustomDrawers/ShapePropertiesDrawer.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditor; 3 | 4 | using ShapeProperties = ThisOtherThing.UI.GeoUtils.ShapeProperties; 5 | 6 | [CustomPropertyDrawer(typeof(ShapeProperties))] 7 | public class ShapePropertiesDrawer : PropertyDrawer 8 | { 9 | public override void OnGUI (Rect position, SerializedProperty property, GUIContent label) 10 | { 11 | position.height = EditorGUIUtility.singleLineHeight; 12 | property.isExpanded = EditorGUI.Foldout(position, property.isExpanded, label); 13 | 14 | if (!property.isExpanded) 15 | return; 16 | 17 | EditorGUI.BeginProperty(position, label, property); 18 | 19 | // ShapeProperties shapeProperties = 20 | // (ShapeProperties)fieldInfo.GetValue(property.serializedObject.targetObject); 21 | 22 | var indent = EditorGUI.indentLevel; 23 | EditorGUI.indentLevel = 1; 24 | 25 | Rect propertyPosition = new Rect (position.x, position.y + EditorGUIUtility.singleLineHeight, position.width, EditorGUIUtility.singleLineHeight); 26 | 27 | EditorGUI.PropertyField(propertyPosition, property.FindPropertyRelative("FillColor"), new GUIContent("Color")); 28 | 29 | propertyPosition.y += EditorGUIUtility.singleLineHeight * 1.25f; 30 | 31 | EditorGUI.indentLevel = indent; 32 | EditorGUI.EndProperty(); 33 | } 34 | 35 | public override float GetPropertyHeight(SerializedProperty property, GUIContent label) 36 | { 37 | if (!property.isExpanded) 38 | { 39 | return EditorGUIUtility.singleLineHeight; 40 | } 41 | 42 | float height = EditorGUIUtility.singleLineHeight * 2.0f; 43 | 44 | return height; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Packages/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "com.unity.ads": "2.0.8", 4 | "com.unity.analytics": "2.0.16", 5 | "com.unity.package-manager-ui": "1.9.11", 6 | "com.unity.purchasing": "2.0.3", 7 | "com.unity.textmeshpro": "1.2.4", 8 | "com.unity.modules.ai": "1.0.0", 9 | "com.unity.modules.animation": "1.0.0", 10 | "com.unity.modules.assetbundle": "1.0.0", 11 | "com.unity.modules.audio": "1.0.0", 12 | "com.unity.modules.cloth": "1.0.0", 13 | "com.unity.modules.director": "1.0.0", 14 | "com.unity.modules.imageconversion": "1.0.0", 15 | "com.unity.modules.imgui": "1.0.0", 16 | "com.unity.modules.jsonserialize": "1.0.0", 17 | "com.unity.modules.particlesystem": "1.0.0", 18 | "com.unity.modules.physics": "1.0.0", 19 | "com.unity.modules.physics2d": "1.0.0", 20 | "com.unity.modules.screencapture": "1.0.0", 21 | "com.unity.modules.terrain": "1.0.0", 22 | "com.unity.modules.terrainphysics": "1.0.0", 23 | "com.unity.modules.tilemap": "1.0.0", 24 | "com.unity.modules.ui": "1.0.0", 25 | "com.unity.modules.uielements": "1.0.0", 26 | "com.unity.modules.umbra": "1.0.0", 27 | "com.unity.modules.unityanalytics": "1.0.0", 28 | "com.unity.modules.unitywebrequest": "1.0.0", 29 | "com.unity.modules.unitywebrequestassetbundle": "1.0.0", 30 | "com.unity.modules.unitywebrequestaudio": "1.0.0", 31 | "com.unity.modules.unitywebrequesttexture": "1.0.0", 32 | "com.unity.modules.unitywebrequestwww": "1.0.0", 33 | "com.unity.modules.vehicles": "1.0.0", 34 | "com.unity.modules.video": "1.0.0", 35 | "com.unity.modules.vr": "1.0.0", 36 | "com.unity.modules.wind": "1.0.0", 37 | "com.unity.modules.xr": "1.0.0" 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # UI Shapes Kit 2 | 3 | UI Shapes Kit 4 | 5 | create and edit UI directly in the editor, without the need for textures 6 | 7 | ## Features 8 | 9 | - create flat ui without textures 10 | - resolution independent 11 | - geometry based anti-aliasing 12 | - geometry based shadows/glows 13 | - custom Editor and Property Drawers 14 | - clean geometry 15 | - basic UVs 16 | 17 | ## Supported Shapes 18 | 19 | - Rectangles (with sharp and rounded corners) 20 | - Ellipses 21 | - Rings 22 | - Arcs 23 | - Lines (close/projected/rounded caps and corner rounding) 24 | - N-gons (with corner rounding) 25 | - Pixel-Perfect Lines 26 | - 2 Color Gradients 27 | - Empty Graphic to use as a Raycast Target 28 | 29 | 30 | ## Documentation 31 | 32 | [Online Documentation](http://uishapeskit.thisotherthing.co/home/) 33 | 34 | ## Images 35 | 36 | editor 37 | shapes 38 | 39 | ## Videos 40 | 41 | Demo 42 | [![Demo Video](https://i.vimeocdn.com/video/662254189.jpg?mw=960&mh=540)](https://vimeo.com/239311115) 43 | 44 | Wireframe Demo 45 | [![Demo Video Wireframe](https://i.vimeocdn.com/video/662255495.jpg?mw=960&mh=540)](https://vimeo.com/239312415) 46 | 47 | ## License 48 | 49 | UI Shapes Kit is available under the [MIT License](LICENSE.md). This means that you can use it in any commercial or noncommercial project. The only requirement is that you need to include attribution in your game's docs. A credit would be very, very nice, too, but isn't required. If you'd like to know more about what this license lets you do tldrlegal.com have a [very nice write up about the MIT license](https://tldrlegal.com/license/mit-license) that you might find useful. 50 | 51 | 52 | UI Shapes Kit was originally created by [this other thing](https://www.thisotherthing.co/) 53 | -------------------------------------------------------------------------------- /Assets/ThisOtherThing/UI Shapes Kit/Geometry/Editor/CustomDrawers/RoundingPropertiesDrawer.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditor; 3 | 4 | using RoundingProperties = ThisOtherThing.UI.GeoUtils.RoundingProperties; 5 | 6 | [CustomPropertyDrawer(typeof(RoundingProperties))] 7 | public class RoundingPropertiesDrawer : PropertyDrawer 8 | { 9 | public override void OnGUI (Rect position, SerializedProperty property, GUIContent label) 10 | { 11 | position.height = EditorGUIUtility.singleLineHeight; 12 | 13 | EditorGUI.BeginProperty(position, label, property); 14 | 15 | RoundingProperties.ResolutionType resolutionType = 16 | (RoundingProperties.ResolutionType)property.FindPropertyRelative("Resolution").enumValueIndex; 17 | 18 | EditorGUI.LabelField(position, label); 19 | 20 | var indent = EditorGUI.indentLevel; 21 | EditorGUI.indentLevel++; 22 | 23 | Rect propertyPosition = new Rect (position.x, position.y + EditorGUIUtility.singleLineHeight, position.width, EditorGUIUtility.singleLineHeight); 24 | 25 | EditorGUI.PropertyField(propertyPosition, property.FindPropertyRelative("Resolution"), new GUIContent("Type")); 26 | 27 | propertyPosition.y += EditorGUIUtility.singleLineHeight; 28 | 29 | switch (resolutionType) 30 | { 31 | case RoundingProperties.ResolutionType.Calculated: 32 | EditorGUI.PropertyField( 33 | propertyPosition, 34 | property.FindPropertyRelative("ResolutionMaxDistance"), 35 | new GUIContent("Max Distance") 36 | ); 37 | break; 38 | 39 | case RoundingProperties.ResolutionType.Fixed: 40 | EditorGUI.PropertyField( 41 | propertyPosition, 42 | property.FindPropertyRelative("FixedResolution"), 43 | new GUIContent("Resolution") 44 | ); 45 | break; 46 | } 47 | 48 | EditorGUI.indentLevel = indent; 49 | 50 | EditorGUI.EndProperty (); 51 | } 52 | 53 | public override float GetPropertyHeight(SerializedProperty property, GUIContent label) 54 | { 55 | return EditorGUIUtility.singleLineHeight * 4.0f; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /Assets/ThisOtherThing/UI Shapes Kit/Geometry/Editor/Editors/SectorEditor.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditor; 3 | using UnityEditor.UI; 4 | 5 | using Sector = ThisOtherThing.UI.Shapes.Sector; 6 | 7 | [CustomEditor(typeof(Sector))] 8 | [CanEditMultipleObjects] 9 | public class SectorEditor : GraphicEditor 10 | { 11 | protected SerializedProperty materialProp; 12 | protected SerializedProperty raycastTargetProp; 13 | 14 | protected SerializedProperty shapePropertiesProp; 15 | protected SerializedProperty ellipsePropertiesProp; 16 | protected SerializedProperty arcPropertiesProp; 17 | protected SerializedProperty shadowPropertiesProp; 18 | protected SerializedProperty antiAliasingPropertiesProp; 19 | 20 | protected override void OnEnable() 21 | { 22 | materialProp = serializedObject.FindProperty("m_Material"); 23 | raycastTargetProp = serializedObject.FindProperty("m_RaycastTarget"); 24 | 25 | shapePropertiesProp = serializedObject.FindProperty("ShapeProperties"); 26 | ellipsePropertiesProp = serializedObject.FindProperty("EllipseProperties"); 27 | arcPropertiesProp = serializedObject.FindProperty("ArcProperties"); 28 | shadowPropertiesProp = serializedObject.FindProperty("ShadowProperties"); 29 | antiAliasingPropertiesProp = serializedObject.FindProperty("AntiAliasingProperties"); 30 | } 31 | 32 | protected override void OnDisable() 33 | { 34 | Tools.hidden = false; 35 | } 36 | 37 | public override void OnInspectorGUI() 38 | { 39 | serializedObject.Update(); 40 | 41 | EditorGUILayout.PropertyField(materialProp); 42 | EditorGUILayout.PropertyField(raycastTargetProp); 43 | EditorGUILayout.Space(); 44 | 45 | EditorGUILayout.PropertyField(shapePropertiesProp, true); 46 | EditorGUILayout.PropertyField(ellipsePropertiesProp, true); 47 | EditorGUILayout.PropertyField(arcPropertiesProp, true); 48 | 49 | EditorGUILayout.PropertyField(shadowPropertiesProp, true); 50 | EditorGUILayout.PropertyField(antiAliasingPropertiesProp, true); 51 | 52 | serializedObject.ApplyModifiedProperties(); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /Assets/ThisOtherThing/UI Shapes Kit/Examples/Animation/Canvas.controller: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!91 &9100000 4 | AnimatorController: 5 | m_ObjectHideFlags: 0 6 | m_PrefabParentObject: {fileID: 0} 7 | m_PrefabInternal: {fileID: 0} 8 | m_Name: Canvas 9 | serializedVersion: 5 10 | m_AnimatorParameters: [] 11 | m_AnimatorLayers: 12 | - serializedVersion: 5 13 | m_Name: Base Layer 14 | m_StateMachine: {fileID: 1107818039813522002} 15 | m_Mask: {fileID: 0} 16 | m_Motions: [] 17 | m_Behaviours: [] 18 | m_BlendingMode: 0 19 | m_SyncedLayerIndex: -1 20 | m_DefaultWeight: 0 21 | m_IKPass: 0 22 | m_SyncedLayerAffectsTiming: 0 23 | m_Controller: {fileID: 9100000} 24 | --- !u!1102 &1102876560348550834 25 | AnimatorState: 26 | serializedVersion: 5 27 | m_ObjectHideFlags: 1 28 | m_PrefabParentObject: {fileID: 0} 29 | m_PrefabInternal: {fileID: 0} 30 | m_Name: New Animation 31 | m_Speed: 1 32 | m_CycleOffset: 0 33 | m_Transitions: [] 34 | m_StateMachineBehaviours: [] 35 | m_Position: {x: 50, y: 50, z: 0} 36 | m_IKOnFeet: 0 37 | m_WriteDefaultValues: 1 38 | m_Mirror: 0 39 | m_SpeedParameterActive: 0 40 | m_MirrorParameterActive: 0 41 | m_CycleOffsetParameterActive: 0 42 | m_Motion: {fileID: 7400000, guid: 8d30306302b294371a1b5fb4e7742aca, type: 2} 43 | m_Tag: 44 | m_SpeedParameter: 45 | m_MirrorParameter: 46 | m_CycleOffsetParameter: 47 | --- !u!1107 &1107818039813522002 48 | AnimatorStateMachine: 49 | serializedVersion: 5 50 | m_ObjectHideFlags: 1 51 | m_PrefabParentObject: {fileID: 0} 52 | m_PrefabInternal: {fileID: 0} 53 | m_Name: Base Layer 54 | m_ChildStates: 55 | - serializedVersion: 1 56 | m_State: {fileID: 1102876560348550834} 57 | m_Position: {x: 200, y: 0, z: 0} 58 | m_ChildStateMachines: [] 59 | m_AnyStateTransitions: [] 60 | m_EntryTransitions: [] 61 | m_StateMachineTransitions: {} 62 | m_StateMachineBehaviours: [] 63 | m_AnyStatePosition: {x: 50, y: 20, z: 0} 64 | m_EntryPosition: {x: 50, y: 120, z: 0} 65 | m_ExitPosition: {x: 800, y: 120, z: 0} 66 | m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} 67 | m_DefaultState: {fileID: 1102876560348550834} 68 | -------------------------------------------------------------------------------- /Assets/ThisOtherThing/UI Shapes Kit/Geometry/Editor/Editors/EllipseEditor.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditor; 3 | using UnityEditor.UI; 4 | 5 | using Ellipse = ThisOtherThing.UI.Shapes.Ellipse; 6 | 7 | [CustomEditor(typeof(Ellipse))] 8 | [CanEditMultipleObjects] 9 | public class EllipseEditor : GraphicEditor 10 | { 11 | Ellipse ellipse; 12 | 13 | protected SerializedProperty materialProp; 14 | protected SerializedProperty spriteProp; 15 | protected SerializedProperty raycastTargetProp; 16 | 17 | protected SerializedProperty shapePropertiesProp; 18 | protected SerializedProperty ellipsePropertiesProp; 19 | protected SerializedProperty outlinePropertiesProp; 20 | protected SerializedProperty shadowPropertiesProp; 21 | protected SerializedProperty antiAliasingPropertiesProp; 22 | 23 | protected override void OnEnable() 24 | { 25 | ellipse = (Ellipse)target; 26 | 27 | materialProp = serializedObject.FindProperty("m_Material"); 28 | spriteProp = serializedObject.FindProperty("Sprite"); 29 | raycastTargetProp = serializedObject.FindProperty("m_RaycastTarget"); 30 | 31 | shapePropertiesProp = serializedObject.FindProperty("ShapeProperties"); 32 | ellipsePropertiesProp = serializedObject.FindProperty("EllipseProperties"); 33 | outlinePropertiesProp = serializedObject.FindProperty("OutlineProperties"); 34 | shadowPropertiesProp = serializedObject.FindProperty("ShadowProperties"); 35 | antiAliasingPropertiesProp = serializedObject.FindProperty("AntiAliasingProperties"); 36 | } 37 | 38 | protected override void OnDisable() 39 | { 40 | Tools.hidden = false; 41 | } 42 | 43 | public override void OnInspectorGUI() 44 | { 45 | serializedObject.Update(); 46 | 47 | EditorGUILayout.PropertyField(materialProp); 48 | EditorGUILayout.PropertyField(spriteProp); 49 | EditorGUILayout.PropertyField(raycastTargetProp); 50 | EditorGUILayout.Space(); 51 | 52 | EditorGUILayout.PropertyField(shapePropertiesProp, true); 53 | EditorGUILayout.PropertyField(ellipsePropertiesProp, true); 54 | 55 | if (ellipse.ShapeProperties.DrawOutline) 56 | { 57 | EditorGUILayout.PropertyField(outlinePropertiesProp, true); 58 | } 59 | 60 | EditorGUILayout.PropertyField(shadowPropertiesProp, true); 61 | EditorGUILayout.PropertyField(antiAliasingPropertiesProp, true); 62 | 63 | serializedObject.ApplyModifiedProperties(); 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /Assets/ThisOtherThing/UI Shapes Kit/Geometry/Editor/Editors/RectangleEditor.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditor; 3 | using UnityEditor.UI; 4 | 5 | using Rectangle = ThisOtherThing.UI.Shapes.Rectangle; 6 | 7 | [CustomEditor(typeof(Rectangle))] 8 | [CanEditMultipleObjects] 9 | public class RectangleEditor : GraphicEditor 10 | { 11 | Rectangle rectangle; 12 | 13 | protected SerializedProperty materialProp; 14 | protected SerializedProperty spriteProp; 15 | protected SerializedProperty raycastTargetProp; 16 | 17 | protected SerializedProperty shapePropertiesProp; 18 | protected SerializedProperty roundedPropertiesProp; 19 | protected SerializedProperty outlinePropertiesProp; 20 | protected SerializedProperty shadowPropertiesProp; 21 | protected SerializedProperty antiAliasingPropertiesProp; 22 | 23 | protected override void OnEnable() 24 | { 25 | rectangle = (Rectangle)target; 26 | 27 | materialProp = serializedObject.FindProperty("m_Material"); 28 | spriteProp = serializedObject.FindProperty("Sprite"); 29 | raycastTargetProp = serializedObject.FindProperty("m_RaycastTarget"); 30 | 31 | shapePropertiesProp = serializedObject.FindProperty("ShapeProperties"); 32 | roundedPropertiesProp = serializedObject.FindProperty("RoundedProperties"); 33 | outlinePropertiesProp = serializedObject.FindProperty("OutlineProperties"); 34 | shadowPropertiesProp = serializedObject.FindProperty("ShadowProperties"); 35 | antiAliasingPropertiesProp = serializedObject.FindProperty("AntiAliasingProperties"); 36 | } 37 | 38 | protected override void OnDisable() 39 | { 40 | Tools.hidden = false; 41 | } 42 | 43 | public override void OnInspectorGUI() 44 | { 45 | serializedObject.Update(); 46 | 47 | EditorGUILayout.PropertyField(materialProp); 48 | EditorGUILayout.PropertyField(spriteProp); 49 | EditorGUILayout.PropertyField(raycastTargetProp); 50 | EditorGUILayout.Space(); 51 | 52 | EditorGUILayout.PropertyField(shapePropertiesProp, true); 53 | EditorGUILayout.PropertyField(roundedPropertiesProp, true); 54 | 55 | if (rectangle.ShapeProperties.DrawOutline) 56 | { 57 | EditorGUILayout.PropertyField(outlinePropertiesProp, true); 58 | } 59 | 60 | EditorGUILayout.PropertyField(shadowPropertiesProp, true); 61 | EditorGUILayout.PropertyField(antiAliasingPropertiesProp, true); 62 | 63 | serializedObject.ApplyModifiedProperties(); 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /ProjectSettings/GraphicsSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!30 &1 4 | GraphicsSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 9 7 | m_Deferred: 8 | m_Mode: 1 9 | m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0} 10 | m_DeferredReflections: 11 | m_Mode: 1 12 | m_Shader: {fileID: 74, guid: 0000000000000000f000000000000000, type: 0} 13 | m_ScreenSpaceShadows: 14 | m_Mode: 1 15 | m_Shader: {fileID: 64, guid: 0000000000000000f000000000000000, type: 0} 16 | m_LegacyDeferred: 17 | m_Mode: 1 18 | m_Shader: {fileID: 63, guid: 0000000000000000f000000000000000, type: 0} 19 | m_DepthNormals: 20 | m_Mode: 1 21 | m_Shader: {fileID: 62, guid: 0000000000000000f000000000000000, type: 0} 22 | m_MotionVectors: 23 | m_Mode: 1 24 | m_Shader: {fileID: 75, guid: 0000000000000000f000000000000000, type: 0} 25 | m_LightHalo: 26 | m_Mode: 1 27 | m_Shader: {fileID: 105, guid: 0000000000000000f000000000000000, type: 0} 28 | m_LensFlare: 29 | m_Mode: 1 30 | m_Shader: {fileID: 102, guid: 0000000000000000f000000000000000, type: 0} 31 | m_AlwaysIncludedShaders: 32 | - {fileID: 7, guid: 0000000000000000f000000000000000, type: 0} 33 | - {fileID: 15104, guid: 0000000000000000f000000000000000, type: 0} 34 | - {fileID: 15105, guid: 0000000000000000f000000000000000, type: 0} 35 | - {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0} 36 | - {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} 37 | - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} 38 | - {fileID: 10782, guid: 0000000000000000f000000000000000, type: 0} 39 | m_PreloadedShaders: [] 40 | m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, 41 | type: 0} 42 | m_TierSettings_Tier1: 43 | renderingPath: 1 44 | useCascadedShadowMaps: 1 45 | m_TierSettings_Tier2: 46 | renderingPath: 1 47 | useCascadedShadowMaps: 1 48 | m_TierSettings_Tier3: 49 | renderingPath: 1 50 | useCascadedShadowMaps: 1 51 | m_DefaultRenderingPath: 1 52 | m_DefaultMobileRenderingPath: 1 53 | m_TierSettings: [] 54 | m_LightmapStripping: 0 55 | m_FogStripping: 0 56 | m_LightmapKeepPlain: 1 57 | m_LightmapKeepDirCombined: 1 58 | m_LightmapKeepDirSeparate: 1 59 | m_LightmapKeepDynamicPlain: 1 60 | m_LightmapKeepDynamicDirCombined: 1 61 | m_LightmapKeepDynamicDirSeparate: 1 62 | m_FogKeepLinear: 1 63 | m_FogKeepExp: 1 64 | m_FogKeepExp2: 1 65 | -------------------------------------------------------------------------------- /Assets/ThisOtherThing/UI Shapes Kit/Geometry/Editor/CustomDrawers/LinePropertiesDrawer.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditor; 3 | 4 | using LineProperties = ThisOtherThing.UI.ShapeUtils.Lines.LineProperties; 5 | 6 | [CustomPropertyDrawer(typeof(LineProperties))] 7 | public class LinePropertiesDrawer : PropertyDrawer 8 | { 9 | public override void OnGUI (Rect position, SerializedProperty property, GUIContent label) 10 | { 11 | position.height = EditorGUIUtility.singleLineHeight; 12 | property.isExpanded = EditorGUI.Foldout(position, property.isExpanded, label); 13 | 14 | if (!property.isExpanded) 15 | return; 16 | 17 | EditorGUI.BeginProperty(position, label, property); 18 | 19 | LineProperties lineProperties = 20 | (LineProperties)fieldInfo.GetValue(property.serializedObject.targetObject); 21 | 22 | var indent = EditorGUI.indentLevel; 23 | EditorGUI.indentLevel++; 24 | 25 | Rect propertyPosition = new Rect (position.x, position.y + EditorGUIUtility.singleLineHeight, position.width, EditorGUIUtility.singleLineHeight); 26 | 27 | EditorGUI.PropertyField(propertyPosition, property.FindPropertyRelative("Closed"), new GUIContent("Closed")); 28 | propertyPosition.y += EditorGUIUtility.singleLineHeight * 1.25f; 29 | 30 | if (lineProperties.Closed) 31 | { 32 | EditorGUI.indentLevel--; 33 | return; 34 | } 35 | 36 | EditorGUI.PropertyField(propertyPosition, property.FindPropertyRelative("LineCap"), new GUIContent("Cap")); 37 | propertyPosition.y += EditorGUIUtility.singleLineHeight * 1.25f; 38 | 39 | switch (lineProperties.LineCap) 40 | { 41 | case LineProperties.LineCapTypes.Round: 42 | EditorGUI.PropertyField(propertyPosition, property.FindPropertyRelative("RoundedCapResolution"), new GUIContent("Resolution")); 43 | break; 44 | } 45 | 46 | EditorGUI.indentLevel = indent; 47 | 48 | EditorGUI.EndProperty (); 49 | } 50 | 51 | public override float GetPropertyHeight(SerializedProperty property, GUIContent label) 52 | { 53 | if (!property.isExpanded) 54 | { 55 | return EditorGUIUtility.singleLineHeight; 56 | } 57 | 58 | LineProperties lineProperties = 59 | (LineProperties)fieldInfo.GetValue(property.serializedObject.targetObject); 60 | 61 | if (lineProperties.Closed) 62 | { 63 | return EditorGUIUtility.singleLineHeight * 2.0f; 64 | } 65 | 66 | if (lineProperties.LineCap != LineProperties.LineCapTypes.Round) 67 | { 68 | return EditorGUIUtility.singleLineHeight * 3.25f; 69 | } 70 | 71 | return EditorGUIUtility.singleLineHeight * 6.5f; 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /Assets/ThisOtherThing/UI Shapes Kit/Geometry/Editor/CustomDrawers/EllipsePropertiesDrawer.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditor; 3 | 4 | using EllipseProperties = ThisOtherThing.UI.ShapeUtils.Ellipses.EllipseProperties; 5 | 6 | [CustomPropertyDrawer(typeof(EllipseProperties))] 7 | public class EllipsePropertiesDrawer : PropertyDrawer 8 | { 9 | 10 | public override void OnGUI (Rect position, SerializedProperty property, GUIContent label) 11 | { 12 | position.height = EditorGUIUtility.singleLineHeight; 13 | property.isExpanded = EditorGUI.Foldout(position, property.isExpanded, label); 14 | 15 | if (!property.isExpanded) 16 | return; 17 | 18 | EditorGUI.BeginProperty(position, label, property); 19 | 20 | EllipseProperties roundedProperties = 21 | (EllipseProperties)fieldInfo.GetValue(property.serializedObject.targetObject); 22 | 23 | var indent = EditorGUI.indentLevel; 24 | EditorGUI.indentLevel = 1; 25 | 26 | Rect propertyPosition = new Rect (position.x, position.y + EditorGUIUtility.singleLineHeight, position.width, EditorGUIUtility.singleLineHeight); 27 | 28 | EditorGUI.PropertyField(propertyPosition, property.FindPropertyRelative("Fitting"), new GUIContent("Fitting")); 29 | propertyPosition.y += EditorGUIUtility.singleLineHeight; 30 | 31 | EditorGUI.PropertyField(propertyPosition, property.FindPropertyRelative("BaseAngle"), new GUIContent("Base Angle")); 32 | propertyPosition.y += EditorGUIUtility.singleLineHeight; 33 | 34 | propertyPosition.y += EditorGUIUtility.singleLineHeight; 35 | 36 | EditorGUI.LabelField(propertyPosition, "Resolution"); 37 | propertyPosition.y += EditorGUIUtility.singleLineHeight * 1.25f; 38 | 39 | EditorGUI.PropertyField(propertyPosition, property.FindPropertyRelative("Resolution"), new GUIContent("Mode")); 40 | propertyPosition.y += EditorGUIUtility.singleLineHeight; 41 | 42 | switch (roundedProperties.Resolution) 43 | { 44 | case EllipseProperties.ResolutionType.Calculated: 45 | EditorGUI.PropertyField(propertyPosition, property.FindPropertyRelative("ResolutionMaxDistance"), new GUIContent("Max Distance")); 46 | break; 47 | case EllipseProperties.ResolutionType.Fixed: 48 | EditorGUI.PropertyField(propertyPosition, property.FindPropertyRelative("FixedResolution"), new GUIContent("Resolution")); 49 | break; 50 | } 51 | 52 | EditorGUI.indentLevel = indent; 53 | EditorGUI.EndProperty(); 54 | } 55 | 56 | public override float GetPropertyHeight(SerializedProperty property, GUIContent label) 57 | { 58 | if (!property.isExpanded) 59 | { 60 | return EditorGUIUtility.singleLineHeight; 61 | } 62 | 63 | return EditorGUIUtility.singleLineHeight * 7.25f; 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /Assets/ThisOtherThing/UI Shapes Kit/Geometry/Editor/Icons/Arc.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e8aff800bb7ca40b98c2be9446f4d477 3 | timeCreated: 1493137490 4 | licenseType: Pro 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 4 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 0 11 | sRGBTexture: 1 12 | linearTexture: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: 0.25 21 | normalMapFilter: 0 22 | isReadable: 0 23 | grayScaleToAlpha: 0 24 | generateCubemap: 6 25 | cubemapConvolution: 0 26 | seamlessCubemap: 0 27 | textureFormat: 1 28 | maxTextureSize: 2048 29 | textureSettings: 30 | filterMode: -1 31 | aniso: -1 32 | mipBias: -1 33 | wrapMode: 1 34 | nPOTScale: 0 35 | lightmap: 0 36 | compressionQuality: 50 37 | spriteMode: 1 38 | spriteExtrude: 1 39 | spriteMeshType: 1 40 | alignment: 0 41 | spritePivot: {x: 0.5, y: 0.5} 42 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 43 | spritePixelsToUnits: 100 44 | alphaUsage: 1 45 | alphaIsTransparency: 1 46 | spriteTessellationDetail: -1 47 | textureType: 0 48 | textureShape: 1 49 | maxTextureSizeSet: 0 50 | compressionQualitySet: 0 51 | textureFormatSet: 0 52 | platformSettings: 53 | - buildTarget: DefaultTexturePlatform 54 | maxTextureSize: 2048 55 | textureFormat: -1 56 | textureCompression: 0 57 | compressionQuality: 50 58 | crunchedCompression: 0 59 | allowsAlphaSplitting: 0 60 | overridden: 0 61 | - buildTarget: Standalone 62 | maxTextureSize: 2048 63 | textureFormat: -1 64 | textureCompression: 0 65 | compressionQuality: 50 66 | crunchedCompression: 0 67 | allowsAlphaSplitting: 0 68 | overridden: 0 69 | - buildTarget: iPhone 70 | maxTextureSize: 2048 71 | textureFormat: -1 72 | textureCompression: 0 73 | compressionQuality: 50 74 | crunchedCompression: 0 75 | allowsAlphaSplitting: 0 76 | overridden: 0 77 | - buildTarget: Android 78 | maxTextureSize: 2048 79 | textureFormat: -1 80 | textureCompression: 0 81 | compressionQuality: 50 82 | crunchedCompression: 0 83 | allowsAlphaSplitting: 0 84 | overridden: 0 85 | - buildTarget: WebGL 86 | maxTextureSize: 2048 87 | textureFormat: -1 88 | textureCompression: 0 89 | compressionQuality: 50 90 | crunchedCompression: 0 91 | allowsAlphaSplitting: 0 92 | overridden: 0 93 | spriteSheet: 94 | serializedVersion: 2 95 | sprites: [] 96 | outline: [] 97 | spritePackingTag: 98 | userData: 99 | assetBundleName: 100 | assetBundleVariant: 101 | -------------------------------------------------------------------------------- /Assets/ThisOtherThing/UI Shapes Kit/Geometry/Editor/Icons/Line.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6e619290b04324a9991e268915eacde1 3 | timeCreated: 1484003389 4 | licenseType: Pro 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 4 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 0 11 | sRGBTexture: 1 12 | linearTexture: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: 0.25 21 | normalMapFilter: 0 22 | isReadable: 0 23 | grayScaleToAlpha: 0 24 | generateCubemap: 6 25 | cubemapConvolution: 0 26 | seamlessCubemap: 0 27 | textureFormat: 1 28 | maxTextureSize: 2048 29 | textureSettings: 30 | filterMode: -1 31 | aniso: -1 32 | mipBias: -1 33 | wrapMode: 1 34 | nPOTScale: 0 35 | lightmap: 0 36 | compressionQuality: 50 37 | spriteMode: 1 38 | spriteExtrude: 1 39 | spriteMeshType: 1 40 | alignment: 0 41 | spritePivot: {x: 0.5, y: 0.5} 42 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 43 | spritePixelsToUnits: 100 44 | alphaUsage: 1 45 | alphaIsTransparency: 1 46 | spriteTessellationDetail: -1 47 | textureType: 0 48 | textureShape: 1 49 | maxTextureSizeSet: 0 50 | compressionQualitySet: 0 51 | textureFormatSet: 0 52 | platformSettings: 53 | - buildTarget: DefaultTexturePlatform 54 | maxTextureSize: 2048 55 | textureFormat: -1 56 | textureCompression: 0 57 | compressionQuality: 50 58 | crunchedCompression: 0 59 | allowsAlphaSplitting: 0 60 | overridden: 0 61 | - buildTarget: Standalone 62 | maxTextureSize: 2048 63 | textureFormat: -1 64 | textureCompression: 0 65 | compressionQuality: 50 66 | crunchedCompression: 0 67 | allowsAlphaSplitting: 0 68 | overridden: 0 69 | - buildTarget: iPhone 70 | maxTextureSize: 2048 71 | textureFormat: -1 72 | textureCompression: 0 73 | compressionQuality: 50 74 | crunchedCompression: 0 75 | allowsAlphaSplitting: 0 76 | overridden: 0 77 | - buildTarget: Android 78 | maxTextureSize: 2048 79 | textureFormat: -1 80 | textureCompression: 0 81 | compressionQuality: 50 82 | crunchedCompression: 0 83 | allowsAlphaSplitting: 0 84 | overridden: 0 85 | - buildTarget: WebGL 86 | maxTextureSize: 2048 87 | textureFormat: -1 88 | textureCompression: 0 89 | compressionQuality: 50 90 | crunchedCompression: 0 91 | allowsAlphaSplitting: 0 92 | overridden: 0 93 | spriteSheet: 94 | serializedVersion: 2 95 | sprites: [] 96 | outline: [] 97 | spritePackingTag: 98 | userData: 99 | assetBundleName: 100 | assetBundleVariant: 101 | -------------------------------------------------------------------------------- /Assets/ThisOtherThing/UI Shapes Kit/Geometry/Editor/Icons/Ellipse.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4970b109d6adc491dac8ad3cbcb5f46f 3 | timeCreated: 1493136284 4 | licenseType: Pro 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 4 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 0 11 | sRGBTexture: 1 12 | linearTexture: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: 0.25 21 | normalMapFilter: 0 22 | isReadable: 0 23 | grayScaleToAlpha: 0 24 | generateCubemap: 6 25 | cubemapConvolution: 0 26 | seamlessCubemap: 0 27 | textureFormat: 1 28 | maxTextureSize: 2048 29 | textureSettings: 30 | filterMode: 1 31 | aniso: -1 32 | mipBias: -1 33 | wrapMode: 1 34 | nPOTScale: 0 35 | lightmap: 0 36 | compressionQuality: 50 37 | spriteMode: 1 38 | spriteExtrude: 1 39 | spriteMeshType: 1 40 | alignment: 0 41 | spritePivot: {x: 0.5, y: 0.5} 42 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 43 | spritePixelsToUnits: 100 44 | alphaUsage: 1 45 | alphaIsTransparency: 1 46 | spriteTessellationDetail: -1 47 | textureType: 0 48 | textureShape: 1 49 | maxTextureSizeSet: 0 50 | compressionQualitySet: 0 51 | textureFormatSet: 0 52 | platformSettings: 53 | - buildTarget: DefaultTexturePlatform 54 | maxTextureSize: 2048 55 | textureFormat: -1 56 | textureCompression: 0 57 | compressionQuality: 50 58 | crunchedCompression: 0 59 | allowsAlphaSplitting: 0 60 | overridden: 0 61 | - buildTarget: Standalone 62 | maxTextureSize: 2048 63 | textureFormat: -1 64 | textureCompression: 0 65 | compressionQuality: 50 66 | crunchedCompression: 0 67 | allowsAlphaSplitting: 0 68 | overridden: 0 69 | - buildTarget: iPhone 70 | maxTextureSize: 2048 71 | textureFormat: -1 72 | textureCompression: 0 73 | compressionQuality: 50 74 | crunchedCompression: 0 75 | allowsAlphaSplitting: 0 76 | overridden: 0 77 | - buildTarget: Android 78 | maxTextureSize: 2048 79 | textureFormat: -1 80 | textureCompression: 0 81 | compressionQuality: 50 82 | crunchedCompression: 0 83 | allowsAlphaSplitting: 0 84 | overridden: 0 85 | - buildTarget: WebGL 86 | maxTextureSize: 2048 87 | textureFormat: -1 88 | textureCompression: 0 89 | compressionQuality: 50 90 | crunchedCompression: 0 91 | allowsAlphaSplitting: 0 92 | overridden: 0 93 | spriteSheet: 94 | serializedVersion: 2 95 | sprites: [] 96 | outline: [] 97 | spritePackingTag: 98 | userData: 99 | assetBundleName: 100 | assetBundleVariant: 101 | -------------------------------------------------------------------------------- /Assets/ThisOtherThing/UI Shapes Kit/Geometry/Editor/Icons/PixelLine.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4faba3079041d4fa695831c2d408eb0c 3 | timeCreated: 1493134498 4 | licenseType: Pro 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 4 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 0 11 | sRGBTexture: 1 12 | linearTexture: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: 0.25 21 | normalMapFilter: 0 22 | isReadable: 0 23 | grayScaleToAlpha: 0 24 | generateCubemap: 6 25 | cubemapConvolution: 0 26 | seamlessCubemap: 0 27 | textureFormat: 1 28 | maxTextureSize: 2048 29 | textureSettings: 30 | filterMode: -1 31 | aniso: -1 32 | mipBias: -1 33 | wrapMode: 1 34 | nPOTScale: 0 35 | lightmap: 0 36 | compressionQuality: 50 37 | spriteMode: 1 38 | spriteExtrude: 1 39 | spriteMeshType: 1 40 | alignment: 0 41 | spritePivot: {x: 0.5, y: 0.5} 42 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 43 | spritePixelsToUnits: 100 44 | alphaUsage: 1 45 | alphaIsTransparency: 1 46 | spriteTessellationDetail: -1 47 | textureType: 0 48 | textureShape: 1 49 | maxTextureSizeSet: 0 50 | compressionQualitySet: 0 51 | textureFormatSet: 0 52 | platformSettings: 53 | - buildTarget: DefaultTexturePlatform 54 | maxTextureSize: 2048 55 | textureFormat: -1 56 | textureCompression: 0 57 | compressionQuality: 50 58 | crunchedCompression: 0 59 | allowsAlphaSplitting: 0 60 | overridden: 0 61 | - buildTarget: Standalone 62 | maxTextureSize: 2048 63 | textureFormat: -1 64 | textureCompression: 0 65 | compressionQuality: 50 66 | crunchedCompression: 0 67 | allowsAlphaSplitting: 0 68 | overridden: 0 69 | - buildTarget: iPhone 70 | maxTextureSize: 2048 71 | textureFormat: -1 72 | textureCompression: 0 73 | compressionQuality: 50 74 | crunchedCompression: 0 75 | allowsAlphaSplitting: 0 76 | overridden: 0 77 | - buildTarget: Android 78 | maxTextureSize: 2048 79 | textureFormat: -1 80 | textureCompression: 0 81 | compressionQuality: 50 82 | crunchedCompression: 0 83 | allowsAlphaSplitting: 0 84 | overridden: 0 85 | - buildTarget: WebGL 86 | maxTextureSize: 2048 87 | textureFormat: -1 88 | textureCompression: 0 89 | compressionQuality: 50 90 | crunchedCompression: 0 91 | allowsAlphaSplitting: 0 92 | overridden: 0 93 | spriteSheet: 94 | serializedVersion: 2 95 | sprites: [] 96 | outline: [] 97 | spritePackingTag: 98 | userData: 99 | assetBundleName: 100 | assetBundleVariant: 101 | -------------------------------------------------------------------------------- /Assets/ThisOtherThing/UI Shapes Kit/Geometry/Editor/Icons/Polygon.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b4b375e38b4194fbd8b936c168a6b85f 3 | timeCreated: 1484006004 4 | licenseType: Pro 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 4 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 0 11 | sRGBTexture: 1 12 | linearTexture: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: 0.25 21 | normalMapFilter: 0 22 | isReadable: 0 23 | grayScaleToAlpha: 0 24 | generateCubemap: 6 25 | cubemapConvolution: 0 26 | seamlessCubemap: 0 27 | textureFormat: 1 28 | maxTextureSize: 2048 29 | textureSettings: 30 | filterMode: -1 31 | aniso: -1 32 | mipBias: -1 33 | wrapMode: 1 34 | nPOTScale: 0 35 | lightmap: 0 36 | compressionQuality: 50 37 | spriteMode: 1 38 | spriteExtrude: 1 39 | spriteMeshType: 1 40 | alignment: 0 41 | spritePivot: {x: 0.5, y: 0.5} 42 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 43 | spritePixelsToUnits: 100 44 | alphaUsage: 1 45 | alphaIsTransparency: 1 46 | spriteTessellationDetail: -1 47 | textureType: 0 48 | textureShape: 1 49 | maxTextureSizeSet: 0 50 | compressionQualitySet: 0 51 | textureFormatSet: 0 52 | platformSettings: 53 | - buildTarget: DefaultTexturePlatform 54 | maxTextureSize: 2048 55 | textureFormat: -1 56 | textureCompression: 0 57 | compressionQuality: 50 58 | crunchedCompression: 0 59 | allowsAlphaSplitting: 0 60 | overridden: 0 61 | - buildTarget: Standalone 62 | maxTextureSize: 2048 63 | textureFormat: -1 64 | textureCompression: 0 65 | compressionQuality: 50 66 | crunchedCompression: 0 67 | allowsAlphaSplitting: 0 68 | overridden: 0 69 | - buildTarget: iPhone 70 | maxTextureSize: 2048 71 | textureFormat: -1 72 | textureCompression: 0 73 | compressionQuality: 50 74 | crunchedCompression: 0 75 | allowsAlphaSplitting: 0 76 | overridden: 0 77 | - buildTarget: Android 78 | maxTextureSize: 2048 79 | textureFormat: -1 80 | textureCompression: 0 81 | compressionQuality: 50 82 | crunchedCompression: 0 83 | allowsAlphaSplitting: 0 84 | overridden: 0 85 | - buildTarget: WebGL 86 | maxTextureSize: 2048 87 | textureFormat: -1 88 | textureCompression: 0 89 | compressionQuality: 50 90 | crunchedCompression: 0 91 | allowsAlphaSplitting: 0 92 | overridden: 0 93 | spriteSheet: 94 | serializedVersion: 2 95 | sprites: [] 96 | outline: [] 97 | spritePackingTag: 98 | userData: 99 | assetBundleName: 100 | assetBundleVariant: 101 | -------------------------------------------------------------------------------- /Assets/ThisOtherThing/UI Shapes Kit/Geometry/Editor/Icons/Rectangle.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fc78df1d26d14400997949af8a512abc 3 | timeCreated: 1493134498 4 | licenseType: Pro 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 4 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 0 11 | sRGBTexture: 1 12 | linearTexture: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: 0.25 21 | normalMapFilter: 0 22 | isReadable: 0 23 | grayScaleToAlpha: 0 24 | generateCubemap: 6 25 | cubemapConvolution: 0 26 | seamlessCubemap: 0 27 | textureFormat: 1 28 | maxTextureSize: 2048 29 | textureSettings: 30 | filterMode: -1 31 | aniso: -1 32 | mipBias: -1 33 | wrapMode: 1 34 | nPOTScale: 0 35 | lightmap: 0 36 | compressionQuality: 50 37 | spriteMode: 1 38 | spriteExtrude: 1 39 | spriteMeshType: 1 40 | alignment: 0 41 | spritePivot: {x: 0.5, y: 0.5} 42 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 43 | spritePixelsToUnits: 100 44 | alphaUsage: 1 45 | alphaIsTransparency: 1 46 | spriteTessellationDetail: -1 47 | textureType: 0 48 | textureShape: 1 49 | maxTextureSizeSet: 0 50 | compressionQualitySet: 0 51 | textureFormatSet: 0 52 | platformSettings: 53 | - buildTarget: DefaultTexturePlatform 54 | maxTextureSize: 2048 55 | textureFormat: -1 56 | textureCompression: 0 57 | compressionQuality: 50 58 | crunchedCompression: 0 59 | allowsAlphaSplitting: 0 60 | overridden: 0 61 | - buildTarget: Standalone 62 | maxTextureSize: 2048 63 | textureFormat: -1 64 | textureCompression: 0 65 | compressionQuality: 50 66 | crunchedCompression: 0 67 | allowsAlphaSplitting: 0 68 | overridden: 0 69 | - buildTarget: iPhone 70 | maxTextureSize: 2048 71 | textureFormat: -1 72 | textureCompression: 0 73 | compressionQuality: 50 74 | crunchedCompression: 0 75 | allowsAlphaSplitting: 0 76 | overridden: 0 77 | - buildTarget: Android 78 | maxTextureSize: 2048 79 | textureFormat: -1 80 | textureCompression: 0 81 | compressionQuality: 50 82 | crunchedCompression: 0 83 | allowsAlphaSplitting: 0 84 | overridden: 0 85 | - buildTarget: WebGL 86 | maxTextureSize: 2048 87 | textureFormat: -1 88 | textureCompression: 0 89 | compressionQuality: 50 90 | crunchedCompression: 0 91 | allowsAlphaSplitting: 0 92 | overridden: 0 93 | spriteSheet: 94 | serializedVersion: 2 95 | sprites: [] 96 | outline: [] 97 | spritePackingTag: 98 | userData: 99 | assetBundleName: 100 | assetBundleVariant: 101 | -------------------------------------------------------------------------------- /Assets/ThisOtherThing/UI Shapes Kit/Geometry/Editor/Icons/Sector.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 97adddb811011441c98e6899e7ebf2ed 3 | timeCreated: 1493135861 4 | licenseType: Pro 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 4 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 0 11 | sRGBTexture: 1 12 | linearTexture: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: 0.25 21 | normalMapFilter: 0 22 | isReadable: 0 23 | grayScaleToAlpha: 0 24 | generateCubemap: 6 25 | cubemapConvolution: 0 26 | seamlessCubemap: 0 27 | textureFormat: 1 28 | maxTextureSize: 2048 29 | textureSettings: 30 | filterMode: -1 31 | aniso: -1 32 | mipBias: -1 33 | wrapMode: 1 34 | nPOTScale: 0 35 | lightmap: 0 36 | compressionQuality: 50 37 | spriteMode: 1 38 | spriteExtrude: 1 39 | spriteMeshType: 1 40 | alignment: 0 41 | spritePivot: {x: 0.5, y: 0.5} 42 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 43 | spritePixelsToUnits: 100 44 | alphaUsage: 1 45 | alphaIsTransparency: 1 46 | spriteTessellationDetail: -1 47 | textureType: 0 48 | textureShape: 1 49 | maxTextureSizeSet: 0 50 | compressionQualitySet: 0 51 | textureFormatSet: 0 52 | platformSettings: 53 | - buildTarget: DefaultTexturePlatform 54 | maxTextureSize: 2048 55 | textureFormat: -1 56 | textureCompression: 0 57 | compressionQuality: 50 58 | crunchedCompression: 0 59 | allowsAlphaSplitting: 0 60 | overridden: 0 61 | - buildTarget: Standalone 62 | maxTextureSize: 2048 63 | textureFormat: -1 64 | textureCompression: 0 65 | compressionQuality: 50 66 | crunchedCompression: 0 67 | allowsAlphaSplitting: 0 68 | overridden: 0 69 | - buildTarget: iPhone 70 | maxTextureSize: 2048 71 | textureFormat: -1 72 | textureCompression: 0 73 | compressionQuality: 50 74 | crunchedCompression: 0 75 | allowsAlphaSplitting: 0 76 | overridden: 0 77 | - buildTarget: Android 78 | maxTextureSize: 2048 79 | textureFormat: -1 80 | textureCompression: 0 81 | compressionQuality: 50 82 | crunchedCompression: 0 83 | allowsAlphaSplitting: 0 84 | overridden: 0 85 | - buildTarget: WebGL 86 | maxTextureSize: 2048 87 | textureFormat: -1 88 | textureCompression: 0 89 | compressionQuality: 50 90 | crunchedCompression: 0 91 | allowsAlphaSplitting: 0 92 | overridden: 0 93 | spriteSheet: 94 | serializedVersion: 2 95 | sprites: [] 96 | outline: [] 97 | spritePackingTag: 98 | userData: 99 | assetBundleName: 100 | assetBundleVariant: 101 | -------------------------------------------------------------------------------- /Assets/ThisOtherThing/UI Shapes Kit/Geometry/Editor/Icons/EdgeGradient.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 275da091860824010b2df2bfbb37d887 3 | timeCreated: 1493135113 4 | licenseType: Pro 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 4 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 0 11 | sRGBTexture: 1 12 | linearTexture: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: 0.25 21 | normalMapFilter: 0 22 | isReadable: 0 23 | grayScaleToAlpha: 0 24 | generateCubemap: 6 25 | cubemapConvolution: 0 26 | seamlessCubemap: 0 27 | textureFormat: 1 28 | maxTextureSize: 2048 29 | textureSettings: 30 | filterMode: -1 31 | aniso: -1 32 | mipBias: -1 33 | wrapMode: 1 34 | nPOTScale: 0 35 | lightmap: 0 36 | compressionQuality: 50 37 | spriteMode: 1 38 | spriteExtrude: 1 39 | spriteMeshType: 1 40 | alignment: 0 41 | spritePivot: {x: 0.5, y: 0.5} 42 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 43 | spritePixelsToUnits: 100 44 | alphaUsage: 1 45 | alphaIsTransparency: 1 46 | spriteTessellationDetail: -1 47 | textureType: 0 48 | textureShape: 1 49 | maxTextureSizeSet: 0 50 | compressionQualitySet: 0 51 | textureFormatSet: 0 52 | platformSettings: 53 | - buildTarget: DefaultTexturePlatform 54 | maxTextureSize: 2048 55 | textureFormat: -1 56 | textureCompression: 0 57 | compressionQuality: 50 58 | crunchedCompression: 0 59 | allowsAlphaSplitting: 0 60 | overridden: 0 61 | - buildTarget: Standalone 62 | maxTextureSize: 2048 63 | textureFormat: -1 64 | textureCompression: 0 65 | compressionQuality: 50 66 | crunchedCompression: 0 67 | allowsAlphaSplitting: 0 68 | overridden: 0 69 | - buildTarget: iPhone 70 | maxTextureSize: 2048 71 | textureFormat: -1 72 | textureCompression: 0 73 | compressionQuality: 50 74 | crunchedCompression: 0 75 | allowsAlphaSplitting: 0 76 | overridden: 0 77 | - buildTarget: Android 78 | maxTextureSize: 2048 79 | textureFormat: -1 80 | textureCompression: 0 81 | compressionQuality: 50 82 | crunchedCompression: 0 83 | allowsAlphaSplitting: 0 84 | overridden: 0 85 | - buildTarget: WebGL 86 | maxTextureSize: 2048 87 | textureFormat: -1 88 | textureCompression: 0 89 | compressionQuality: 50 90 | crunchedCompression: 0 91 | allowsAlphaSplitting: 0 92 | overridden: 0 93 | spriteSheet: 94 | serializedVersion: 2 95 | sprites: [] 96 | outline: [] 97 | spritePackingTag: 98 | userData: 99 | assetBundleName: 100 | assetBundleVariant: 101 | -------------------------------------------------------------------------------- /Assets/ThisOtherThing/UI Shapes Kit/Geometry/Editor/Icons/EmptyFillRect.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b5982c025774e4848aa93c34c790f5dd 3 | timeCreated: 1493135514 4 | licenseType: Pro 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 4 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 0 11 | sRGBTexture: 1 12 | linearTexture: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: 0.25 21 | normalMapFilter: 0 22 | isReadable: 0 23 | grayScaleToAlpha: 0 24 | generateCubemap: 6 25 | cubemapConvolution: 0 26 | seamlessCubemap: 0 27 | textureFormat: 1 28 | maxTextureSize: 2048 29 | textureSettings: 30 | filterMode: -1 31 | aniso: -1 32 | mipBias: -1 33 | wrapMode: 1 34 | nPOTScale: 0 35 | lightmap: 0 36 | compressionQuality: 50 37 | spriteMode: 1 38 | spriteExtrude: 1 39 | spriteMeshType: 1 40 | alignment: 0 41 | spritePivot: {x: 0.5, y: 0.5} 42 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 43 | spritePixelsToUnits: 100 44 | alphaUsage: 1 45 | alphaIsTransparency: 1 46 | spriteTessellationDetail: -1 47 | textureType: 0 48 | textureShape: 1 49 | maxTextureSizeSet: 0 50 | compressionQualitySet: 0 51 | textureFormatSet: 0 52 | platformSettings: 53 | - buildTarget: DefaultTexturePlatform 54 | maxTextureSize: 2048 55 | textureFormat: -1 56 | textureCompression: 0 57 | compressionQuality: 50 58 | crunchedCompression: 0 59 | allowsAlphaSplitting: 0 60 | overridden: 0 61 | - buildTarget: Standalone 62 | maxTextureSize: 2048 63 | textureFormat: -1 64 | textureCompression: 0 65 | compressionQuality: 50 66 | crunchedCompression: 0 67 | allowsAlphaSplitting: 0 68 | overridden: 0 69 | - buildTarget: iPhone 70 | maxTextureSize: 2048 71 | textureFormat: -1 72 | textureCompression: 0 73 | compressionQuality: 50 74 | crunchedCompression: 0 75 | allowsAlphaSplitting: 0 76 | overridden: 0 77 | - buildTarget: Android 78 | maxTextureSize: 2048 79 | textureFormat: -1 80 | textureCompression: 0 81 | compressionQuality: 50 82 | crunchedCompression: 0 83 | allowsAlphaSplitting: 0 84 | overridden: 0 85 | - buildTarget: WebGL 86 | maxTextureSize: 2048 87 | textureFormat: -1 88 | textureCompression: 0 89 | compressionQuality: 50 90 | crunchedCompression: 0 91 | allowsAlphaSplitting: 0 92 | overridden: 0 93 | spriteSheet: 94 | serializedVersion: 2 95 | sprites: [] 96 | outline: [] 97 | spritePackingTag: 98 | userData: 99 | assetBundleName: 100 | assetBundleVariant: 101 | -------------------------------------------------------------------------------- /Assets/TestShaders/uiUvTest.shader: -------------------------------------------------------------------------------- 1 | Shader "Unlit/uiUvTest" 2 | { 3 | Properties 4 | { 5 | [PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {} 6 | _Color ("Tint", Color) = (1,1,1,1) 7 | 8 | _StencilComp ("Stencil Comparison", Float) = 8 9 | _Stencil ("Stencil ID", Float) = 0 10 | _StencilOp ("Stencil Operation", Float) = 0 11 | _StencilWriteMask ("Stencil Write Mask", Float) = 255 12 | _StencilReadMask ("Stencil Read Mask", Float) = 255 13 | 14 | _ColorMask ("Color Mask", Float) = 15 15 | 16 | [Toggle(UNITY_UI_ALPHACLIP)] _UseUIAlphaClip ("Use Alpha Clip", Float) = 0 17 | } 18 | 19 | SubShader 20 | { 21 | Tags 22 | { 23 | "Queue"="Transparent" 24 | "IgnoreProjector"="True" 25 | "RenderType"="Transparent" 26 | "PreviewType"="Plane" 27 | "CanUseSpriteAtlas"="True" 28 | } 29 | 30 | Stencil 31 | { 32 | Ref [_Stencil] 33 | Comp [_StencilComp] 34 | Pass [_StencilOp] 35 | ReadMask [_StencilReadMask] 36 | WriteMask [_StencilWriteMask] 37 | } 38 | 39 | Cull Off 40 | Lighting Off 41 | ZWrite Off 42 | ZTest [unity_GUIZTestMode] 43 | Blend SrcAlpha OneMinusSrcAlpha 44 | ColorMask [_ColorMask] 45 | 46 | Pass 47 | { 48 | Name "Default" 49 | CGPROGRAM 50 | #pragma vertex vert 51 | #pragma fragment frag 52 | #pragma target 2.0 53 | 54 | #include "UnityCG.cginc" 55 | #include "UnityUI.cginc" 56 | 57 | #pragma multi_compile __ UNITY_UI_ALPHACLIP 58 | 59 | struct appdata_t 60 | { 61 | float4 vertex : POSITION; 62 | float4 color : COLOR; 63 | float2 texcoord : TEXCOORD0; 64 | UNITY_VERTEX_INPUT_INSTANCE_ID 65 | }; 66 | 67 | struct v2f 68 | { 69 | float4 vertex : SV_POSITION; 70 | fixed4 color : COLOR; 71 | float2 texcoord : TEXCOORD0; 72 | float4 worldPosition : TEXCOORD1; 73 | UNITY_VERTEX_OUTPUT_STEREO 74 | }; 75 | 76 | fixed4 _Color; 77 | fixed4 _TextureSampleAdd; 78 | float4 _ClipRect; 79 | 80 | v2f vert(appdata_t IN) 81 | { 82 | v2f OUT; 83 | UNITY_SETUP_INSTANCE_ID(IN); 84 | UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(OUT); 85 | OUT.worldPosition = IN.vertex; 86 | OUT.vertex = UnityObjectToClipPos(OUT.worldPosition); 87 | 88 | OUT.texcoord = IN.texcoord; 89 | 90 | OUT.color = IN.color * _Color; 91 | return OUT; 92 | } 93 | 94 | sampler2D _MainTex; 95 | 96 | fixed4 frag(v2f IN) : SV_Target 97 | { 98 | half4 color = (tex2D(_MainTex, IN.texcoord) + _TextureSampleAdd) * IN.color; 99 | 100 | color.a *= UnityGet2DClipping(IN.worldPosition.xy, _ClipRect); 101 | 102 | #ifdef UNITY_UI_ALPHACLIP 103 | clip (color.a - 0.001); 104 | #endif 105 | 106 | // return color; 107 | return fixed4(IN.texcoord.xy, 0.0f, color.a); 108 | } 109 | ENDCG 110 | } 111 | } 112 | } 113 | -------------------------------------------------------------------------------- /Assets/ThisOtherThing/UI Shapes Kit/Geometry/Editor/Editors/ArcEditor.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditor; 3 | using UnityEditor.UI; 4 | 5 | using Arc = ThisOtherThing.UI.Shapes.Arc; 6 | 7 | [CustomEditor(typeof(Arc))] 8 | [CanEditMultipleObjects] 9 | public class ArcEditor : GraphicEditor 10 | { 11 | protected SerializedProperty materialProp; 12 | protected SerializedProperty raycastTargetProp; 13 | 14 | protected SerializedProperty shapePropertiesProp; 15 | protected SerializedProperty ellipsePropertiesProp; 16 | protected SerializedProperty arcPropertiesProp; 17 | protected SerializedProperty lineCapProp; 18 | protected SerializedProperty CapRoundingPropertiesProp; 19 | protected SerializedProperty outlinePropertiesProp; 20 | protected SerializedProperty shadowPropertiesProp; 21 | protected SerializedProperty antiAliasingPropertiesProp; 22 | 23 | bool capExpanded = false; 24 | 25 | protected override void OnEnable() 26 | { 27 | materialProp = serializedObject.FindProperty("m_Material"); 28 | raycastTargetProp = serializedObject.FindProperty("m_RaycastTarget"); 29 | 30 | shapePropertiesProp = serializedObject.FindProperty("ShapeProperties"); 31 | ellipsePropertiesProp = serializedObject.FindProperty("EllipseProperties"); 32 | arcPropertiesProp = serializedObject.FindProperty("ArcProperties"); 33 | outlinePropertiesProp = serializedObject.FindProperty("OutlineProperties"); 34 | shadowPropertiesProp = serializedObject.FindProperty("ShadowProperties"); 35 | antiAliasingPropertiesProp = serializedObject.FindProperty("AntiAliasingProperties"); 36 | 37 | lineCapProp = serializedObject.FindProperty("LineProperties").FindPropertyRelative("LineCap"); 38 | CapRoundingPropertiesProp = serializedObject.FindProperty("LineProperties").FindPropertyRelative("RoundedCapResolution"); 39 | } 40 | 41 | protected override void OnDisable() 42 | { 43 | Tools.hidden = false; 44 | } 45 | 46 | public override void OnInspectorGUI() 47 | { 48 | serializedObject.Update(); 49 | 50 | EditorGUILayout.PropertyField(materialProp); 51 | EditorGUILayout.PropertyField(raycastTargetProp); 52 | EditorGUILayout.Space(); 53 | 54 | EditorGUILayout.PropertyField(shapePropertiesProp, true); 55 | EditorGUILayout.PropertyField(ellipsePropertiesProp, true); 56 | EditorGUILayout.PropertyField(arcPropertiesProp, true); 57 | 58 | capExpanded = EditorGUILayout.Foldout(capExpanded, "Cap"); 59 | if (capExpanded) 60 | { 61 | EditorGUILayout.PropertyField(lineCapProp); 62 | 63 | if (lineCapProp.enumValueIndex == (int)ThisOtherThing.UI.ShapeUtils.Lines.LineProperties.LineCapTypes.Round) 64 | { 65 | EditorGUILayout.PropertyField(CapRoundingPropertiesProp); 66 | } 67 | } 68 | 69 | EditorGUILayout.PropertyField(outlinePropertiesProp, true); 70 | 71 | EditorGUILayout.PropertyField(shadowPropertiesProp, true); 72 | EditorGUILayout.PropertyField(antiAliasingPropertiesProp, true); 73 | 74 | serializedObject.ApplyModifiedProperties(); 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /Assets/ThisOtherThing/UI Shapes Kit/Geometry/Editor/CustomDrawers/OutlineShapePropertiesDrawer.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditor; 3 | 4 | using ShapeProperties = ThisOtherThing.UI.GeoUtils.OutlineShapeProperties; 5 | 6 | [CustomPropertyDrawer(typeof(ShapeProperties))] 7 | public class OutlineShapePropertiesDrawer : PropertyDrawer 8 | { 9 | public override void OnGUI (Rect position, SerializedProperty property, GUIContent label) 10 | { 11 | position.height = EditorGUIUtility.singleLineHeight; 12 | property.isExpanded = EditorGUI.Foldout(position, property.isExpanded, label); 13 | 14 | if (!property.isExpanded) 15 | return; 16 | 17 | EditorGUI.BeginProperty(position, label, property); 18 | 19 | ShapeProperties shapeProperties = 20 | (ShapeProperties)fieldInfo.GetValue(property.serializedObject.targetObject); 21 | 22 | var indent = EditorGUI.indentLevel; 23 | EditorGUI.indentLevel = 1; 24 | 25 | Rect propertyPosition = new Rect (position.x, position.y + EditorGUIUtility.singleLineHeight, position.width, EditorGUIUtility.singleLineHeight); 26 | 27 | EditorGUI.PropertyField(propertyPosition, property.FindPropertyRelative("DrawFill"), new GUIContent("Draw Fill")); 28 | 29 | if (shapeProperties.DrawFill) 30 | { 31 | propertyPosition.y += EditorGUIUtility.singleLineHeight; 32 | EditorGUI.PropertyField(propertyPosition, property.FindPropertyRelative("DrawFillShadow"), new GUIContent("Shadow")); 33 | 34 | propertyPosition.y += EditorGUIUtility.singleLineHeight; 35 | EditorGUI.PropertyField(propertyPosition, property.FindPropertyRelative("FillColor"), new GUIContent("Color")); 36 | } 37 | 38 | propertyPosition.y += EditorGUIUtility.singleLineHeight * 1.25f; 39 | 40 | EditorGUI.PropertyField(propertyPosition, property.FindPropertyRelative("DrawOutline"), new GUIContent("Draw Outline")); 41 | 42 | if (shapeProperties.DrawOutline) 43 | { 44 | propertyPosition.y += EditorGUIUtility.singleLineHeight; 45 | EditorGUI.PropertyField(propertyPosition, property.FindPropertyRelative("DrawOutlineShadow"), new GUIContent("Shadow")); 46 | 47 | propertyPosition.y += EditorGUIUtility.singleLineHeight; 48 | EditorGUI.PropertyField(propertyPosition, property.FindPropertyRelative("OutlineColor"), new GUIContent("Color")); 49 | } 50 | 51 | EditorGUI.indentLevel = indent; 52 | EditorGUI.EndProperty(); 53 | } 54 | 55 | public override float GetPropertyHeight(SerializedProperty property, GUIContent label) 56 | { 57 | if (!property.isExpanded) 58 | { 59 | return EditorGUIUtility.singleLineHeight; 60 | } 61 | 62 | float height = EditorGUIUtility.singleLineHeight * 3.25f; 63 | 64 | ShapeProperties shapeProperties = 65 | (ShapeProperties)fieldInfo.GetValue(property.serializedObject.targetObject); 66 | 67 | if (shapeProperties.DrawFill) 68 | { 69 | height += EditorGUIUtility.singleLineHeight * 2.0f; 70 | } 71 | 72 | if (shapeProperties.DrawOutline) 73 | { 74 | height += EditorGUIUtility.singleLineHeight * 2.0f; 75 | } 76 | 77 | return height; 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /Assets/ThisOtherThing/UI Shapes Kit/Geometry/Editor/Editors/PolygonEditor.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditor; 3 | using UnityEditor.UI; 4 | 5 | using Polygon = ThisOtherThing.UI.Shapes.Polygon; 6 | 7 | [CustomEditor(typeof(Polygon))] 8 | public class PolygonEditor : GraphicEditor 9 | { 10 | Polygon polygon; 11 | ThisOtherThing.UI.ShapeUtils.PointsList.PointListsProperties pointListsProperties; 12 | RectTransform rectTransform; 13 | 14 | protected SerializedProperty materialProp; 15 | protected SerializedProperty raycastTargetProp; 16 | 17 | protected SerializedProperty shapePropertiesProp; 18 | protected SerializedProperty pointListPropertiesProp; 19 | protected SerializedProperty polygonPropertiesProp; 20 | protected SerializedProperty shadowPropertiesProp; 21 | protected SerializedProperty antiAliasingPropertiesProp; 22 | 23 | protected override void OnEnable() 24 | { 25 | polygon = (Polygon)target; 26 | 27 | rectTransform = polygon.rectTransform; 28 | pointListsProperties = polygon.PointListsProperties; 29 | 30 | materialProp = serializedObject.FindProperty("m_Material"); 31 | raycastTargetProp = serializedObject.FindProperty("m_RaycastTarget"); 32 | 33 | shapePropertiesProp = serializedObject.FindProperty("ShapeProperties"); 34 | pointListPropertiesProp = serializedObject.FindProperty("PointListsProperties"); 35 | polygonPropertiesProp = serializedObject.FindProperty("PolygonProperties"); 36 | shadowPropertiesProp = serializedObject.FindProperty("ShadowProperties"); 37 | antiAliasingPropertiesProp = serializedObject.FindProperty("AntiAliasingProperties"); 38 | } 39 | 40 | protected override void OnDisable() 41 | { 42 | Tools.hidden = false; 43 | } 44 | 45 | public override void OnInspectorGUI() 46 | { 47 | serializedObject.Update(); 48 | 49 | EditorGUILayout.PropertyField(materialProp); 50 | EditorGUILayout.PropertyField(raycastTargetProp); 51 | EditorGUILayout.Space(); 52 | 53 | EditorGUILayout.PropertyField(shapePropertiesProp, true); 54 | EditorGUILayout.PropertyField(pointListPropertiesProp, true); 55 | EditorGUILayout.PropertyField(polygonPropertiesProp, true); 56 | 57 | EditorGUILayout.PropertyField(shadowPropertiesProp, true); 58 | EditorGUILayout.PropertyField(antiAliasingPropertiesProp, true); 59 | 60 | serializedObject.ApplyModifiedProperties(); 61 | } 62 | 63 | void OnSceneGUI() 64 | { 65 | Undo.RecordObject(polygon, "test"); 66 | 67 | for (int i = 0; i < pointListsProperties.PointListProperties.Length; i++) 68 | { 69 | if ( 70 | pointListsProperties.PointListProperties[i].ShowHandles && 71 | pointListsProperties.PointListProperties[i].GeneratorData.Generator == ThisOtherThing.UI.ShapeUtils.PointsList.PointListGeneratorData.Generators.Custom 72 | ) { 73 | if (PointListDrawer.Draw( 74 | ref pointListsProperties.PointListProperties[i].Positions, 75 | rectTransform, 76 | true, 77 | 3 78 | )) 79 | polygon.ForceMeshUpdate(); 80 | } 81 | } 82 | 83 | 84 | // if (!Application.isPlaying && polygon.enabled) 85 | // { 86 | // polygon.enabled = false; 87 | // polygon.enabled = true; 88 | // } 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /Assets/ThisOtherThing/UI Shapes Kit/Geometry/Shapes/PixelLine.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEngine.UI; 3 | using System.Collections; 4 | 5 | namespace ThisOtherThing.UI.Shapes 6 | { 7 | [AddComponentMenu("UI/Shapes/Pixel Line", 100)] 8 | public class PixelLine : MaskableGraphic, IShape 9 | { 10 | 11 | public float LineWeight = 1.0f; 12 | 13 | public GeoUtils.SnappedPositionAndOrientationProperties SnappedProperties = 14 | new GeoUtils.SnappedPositionAndOrientationProperties(); 15 | 16 | Vector3 center = Vector3.zero; 17 | 18 | public void ForceMeshUpdate() 19 | { 20 | SetVerticesDirty(); 21 | SetMaterialDirty(); 22 | } 23 | 24 | #if UNITY_EDITOR 25 | protected override void OnValidate() 26 | { 27 | ForceMeshUpdate(); 28 | } 29 | #endif 30 | 31 | protected override void OnPopulateMesh(VertexHelper vh) 32 | { 33 | vh.Clear(); 34 | 35 | Rect pixelRect = RectTransformUtility.PixelAdjustRect(rectTransform, canvas); 36 | 37 | float pixelSizeScaler = 1.0f; 38 | 39 | if (canvas != null) 40 | { 41 | pixelSizeScaler = 1.0f / canvas.scaleFactor; 42 | } 43 | 44 | float adjustedLineWeight = LineWeight * pixelSizeScaler; 45 | 46 | switch (SnappedProperties.Position) 47 | { 48 | case GeoUtils.SnappedPositionAndOrientationProperties.PositionTypes.Center: 49 | center.x = pixelRect.center.x; 50 | center.y = pixelRect.center.y; 51 | break; 52 | case GeoUtils.SnappedPositionAndOrientationProperties.PositionTypes.Top: 53 | center.x = pixelRect.center.x; 54 | center.y = pixelRect.yMax - adjustedLineWeight; 55 | break; 56 | case GeoUtils.SnappedPositionAndOrientationProperties.PositionTypes.Bottom: 57 | center.x = pixelRect.center.x; 58 | center.y = pixelRect.yMin; 59 | break; 60 | case GeoUtils.SnappedPositionAndOrientationProperties.PositionTypes.Left: 61 | center.x = pixelRect.xMin; 62 | center.y = pixelRect.center.y; 63 | break; 64 | case GeoUtils.SnappedPositionAndOrientationProperties.PositionTypes.Right: 65 | center.x = pixelRect.xMax; 66 | center.y = pixelRect.center.y; 67 | break; 68 | default: 69 | throw new System.ArgumentOutOfRangeException (); 70 | } 71 | 72 | float width = 0.0f; 73 | float height = 0.0f; 74 | 75 | switch (SnappedProperties.Orientation) 76 | { 77 | case GeoUtils.SnappedPositionAndOrientationProperties.OrientationTypes.Horizontal: 78 | width = pixelRect.width; 79 | height = adjustedLineWeight; 80 | 81 | // topLeft.x -= width * 0.5f + adjustedLineWeight; 82 | break; 83 | case GeoUtils.SnappedPositionAndOrientationProperties.OrientationTypes.Vertical: 84 | width = adjustedLineWeight; 85 | height = pixelRect.height; 86 | 87 | // topLeft.y += height * 0.5f - adjustedLineWeight; 88 | break; 89 | default: 90 | throw new System.ArgumentOutOfRangeException (); 91 | } 92 | 93 | ShapeUtils.Rects.AddRect( 94 | ref vh, 95 | center, 96 | width, 97 | height, 98 | color, 99 | GeoUtils.ZeroV2 100 | ); 101 | 102 | } 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /Assets/TestShaders/lineUvTest.shader: -------------------------------------------------------------------------------- 1 | Shader "Unlit/lineUvTest" 2 | { 3 | Properties 4 | { 5 | [PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {} 6 | _Color ("Tint", Color) = (1,1,1,1) 7 | 8 | _StencilComp ("Stencil Comparison", Float) = 8 9 | _Stencil ("Stencil ID", Float) = 0 10 | _StencilOp ("Stencil Operation", Float) = 0 11 | _StencilWriteMask ("Stencil Write Mask", Float) = 255 12 | _StencilReadMask ("Stencil Read Mask", Float) = 255 13 | 14 | _ColorMask ("Color Mask", Float) = 15 15 | 16 | [Toggle(UNITY_UI_ALPHACLIP)] _UseUIAlphaClip ("Use Alpha Clip", Float) = 0 17 | } 18 | 19 | SubShader 20 | { 21 | Tags 22 | { 23 | "Queue"="Transparent" 24 | "IgnoreProjector"="True" 25 | "RenderType"="Transparent" 26 | "PreviewType"="Plane" 27 | "CanUseSpriteAtlas"="True" 28 | } 29 | 30 | Stencil 31 | { 32 | Ref [_Stencil] 33 | Comp [_StencilComp] 34 | Pass [_StencilOp] 35 | ReadMask [_StencilReadMask] 36 | WriteMask [_StencilWriteMask] 37 | } 38 | 39 | Cull Off 40 | Lighting Off 41 | ZWrite Off 42 | ZTest [unity_GUIZTestMode] 43 | Blend SrcAlpha OneMinusSrcAlpha 44 | ColorMask [_ColorMask] 45 | 46 | Pass 47 | { 48 | Name "Default" 49 | CGPROGRAM 50 | #pragma vertex vert 51 | #pragma fragment frag 52 | #pragma target 2.0 53 | 54 | #include "UnityCG.cginc" 55 | #include "UnityUI.cginc" 56 | 57 | #pragma multi_compile __ UNITY_UI_ALPHACLIP 58 | 59 | struct appdata_t 60 | { 61 | float4 vertex : POSITION; 62 | float4 color : COLOR; 63 | float2 texcoord : TEXCOORD0; 64 | UNITY_VERTEX_INPUT_INSTANCE_ID 65 | }; 66 | 67 | struct v2f 68 | { 69 | float4 vertex : SV_POSITION; 70 | fixed4 color : COLOR; 71 | float2 texcoord : TEXCOORD0; 72 | float4 worldPosition : TEXCOORD1; 73 | UNITY_VERTEX_OUTPUT_STEREO 74 | }; 75 | 76 | fixed4 _Color; 77 | fixed4 _TextureSampleAdd; 78 | float4 _ClipRect; 79 | 80 | float cubicPulse( float c, float w, float x ) 81 | { 82 | x = abs(x - c); 83 | if( x>w ) return 0.0f; 84 | x /= w; 85 | return 1.0f - x*x*(3.0f-2.0f*x); 86 | } 87 | 88 | v2f vert(appdata_t IN) 89 | { 90 | v2f OUT; 91 | UNITY_SETUP_INSTANCE_ID(IN); 92 | UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(OUT); 93 | OUT.worldPosition = IN.vertex; 94 | OUT.vertex = UnityObjectToClipPos(OUT.worldPosition); 95 | 96 | OUT.texcoord = IN.texcoord; 97 | 98 | OUT.color = IN.color * _Color; 99 | return OUT; 100 | } 101 | 102 | sampler2D _MainTex; 103 | 104 | fixed4 frag(v2f IN) : SV_Target 105 | { 106 | half4 color = (tex2D(_MainTex, IN.texcoord) + _TextureSampleAdd) * IN.color; 107 | 108 | color.a *= UnityGet2DClipping(IN.worldPosition.xy, _ClipRect); 109 | 110 | #ifdef UNITY_UI_ALPHACLIP 111 | clip (color.a - 0.001); 112 | #endif 113 | 114 | // return color; 115 | // return fixed4(IN.texcoord.xy, 0.0f, color.a); 116 | color.r = cubicPulse(IN.texcoord.x, 0.2, _Time.y % 1.0); 117 | color.gb = color.r; 118 | // color.a = 1.0; 119 | 120 | return color; 121 | } 122 | ENDCG 123 | } 124 | } 125 | } 126 | 127 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. 6 | 7 | ## Our Standards 8 | 9 | Examples of behavior that contributes to creating a positive environment include: 10 | 11 | * Using welcoming and inclusive language 12 | * Being respectful of differing viewpoints and experiences 13 | * Gracefully accepting constructive criticism 14 | * Focusing on what is best for the community 15 | * Showing empathy towards other community members 16 | 17 | Examples of unacceptable behavior by participants include: 18 | 19 | * The use of sexualized language or imagery and unwelcome sexual attention or advances 20 | * Trolling, insulting/derogatory comments, and personal or political attacks 21 | * Public or private harassment 22 | * Publishing others' private information, such as a physical or electronic address, without explicit permission 23 | * Other conduct which could reasonably be considered inappropriate in a professional setting 24 | 25 | ## Our Responsibilities 26 | 27 | Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. 28 | 29 | Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. 30 | 31 | ## Scope 32 | 33 | This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. 34 | 35 | ## Enforcement 36 | 37 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at contact@thisotherthing.co. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. 38 | 39 | Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. 40 | 41 | ## Attribution 42 | 43 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] 44 | 45 | [homepage]: http://contributor-covenant.org 46 | [version]: http://contributor-covenant.org/version/1/4/ 47 | -------------------------------------------------------------------------------- /Assets/ThisOtherThing/UI Shapes Kit/Geometry/Shapes/Sector.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEngine.UI; 3 | using System.Collections; 4 | 5 | namespace ThisOtherThing.UI.Shapes 6 | { 7 | [AddComponentMenu("UI/Shapes/Sector", 50)] 8 | public class Sector : MaskableGraphic, IShape 9 | { 10 | public GeoUtils.ShapeProperties ShapeProperties = 11 | new GeoUtils.ShapeProperties(); 12 | 13 | public ShapeUtils.Ellipses.EllipseProperties EllipseProperties = 14 | new ShapeUtils.Ellipses.EllipseProperties(); 15 | 16 | public ShapeUtils.Arcs.ArcProperties ArcProperties = 17 | new ShapeUtils.Arcs.ArcProperties(); 18 | 19 | public GeoUtils.ShadowsProperties ShadowProperties = new GeoUtils.ShadowsProperties(); 20 | 21 | public GeoUtils.AntiAliasingProperties AntiAliasingProperties = 22 | new GeoUtils.AntiAliasingProperties(); 23 | 24 | GeoUtils.UnitPositionData unitPositionData; 25 | GeoUtils.EdgeGradientData edgeGradientData; 26 | Vector2 radius = Vector2.one; 27 | 28 | Rect pixelRect; 29 | 30 | public void ForceMeshUpdate() 31 | { 32 | SetVerticesDirty(); 33 | SetMaterialDirty(); 34 | } 35 | 36 | #if UNITY_EDITOR 37 | protected override void OnValidate() 38 | { 39 | EllipseProperties.OnCheck(); 40 | AntiAliasingProperties.OnCheck(); 41 | 42 | ForceMeshUpdate(); 43 | } 44 | #endif 45 | 46 | protected override void OnPopulateMesh(VertexHelper vh) { 47 | vh.Clear(); 48 | 49 | pixelRect = RectTransformUtility.PixelAdjustRect(rectTransform, canvas); 50 | 51 | ShapeUtils.Ellipses.SetRadius( 52 | ref radius, 53 | pixelRect.width, 54 | pixelRect.height, 55 | EllipseProperties 56 | ); 57 | 58 | EllipseProperties.UpdateAdjusted(radius, 0.0f); 59 | ArcProperties.UpdateAdjusted(EllipseProperties.AdjustedResolution, EllipseProperties.BaseAngle); 60 | AntiAliasingProperties.UpdateAdjusted(canvas); 61 | ShadowProperties.UpdateAdjusted(); 62 | 63 | // shadows 64 | if (ShadowProperties.ShadowsEnabled) 65 | { 66 | for (int i = 0; i < ShadowProperties.Shadows.Length; i++) 67 | { 68 | edgeGradientData.SetActiveData( 69 | 1.0f - ShadowProperties.Shadows[i].Softness, 70 | ShadowProperties.Shadows[i].Size, 71 | AntiAliasingProperties.Adjusted 72 | ); 73 | 74 | ShapeUtils.Arcs.AddSegment( 75 | ref vh, 76 | ShadowProperties.GetCenterOffset(pixelRect.center, i), 77 | radius, 78 | EllipseProperties, 79 | ArcProperties, 80 | ShadowProperties.Shadows[i].Color, 81 | GeoUtils.ZeroV2, 82 | ref unitPositionData, 83 | edgeGradientData 84 | ); 85 | } 86 | } 87 | 88 | // fill 89 | if (ShadowProperties.ShowShape) 90 | { 91 | if (AntiAliasingProperties.Adjusted > 0.0f) 92 | { 93 | edgeGradientData.SetActiveData( 94 | 1.0f, 95 | 0.0f, 96 | AntiAliasingProperties.Adjusted 97 | ); 98 | } 99 | else 100 | { 101 | edgeGradientData.Reset(); 102 | } 103 | 104 | ShapeUtils.Arcs.AddSegment( 105 | ref vh, 106 | (Vector3)pixelRect.center, 107 | radius, 108 | EllipseProperties, 109 | ArcProperties, 110 | ShapeProperties.FillColor, 111 | GeoUtils.ZeroV2, 112 | ref unitPositionData, 113 | edgeGradientData 114 | ); 115 | } 116 | } 117 | } 118 | } 119 | -------------------------------------------------------------------------------- /Assets/ThisOtherThing/UI Shapes Kit/Geometry/Editor/MenuItems.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEngine.UI; 3 | using UnityEngine.EventSystems; 4 | 5 | using UnityEditor; 6 | 7 | using ThisOtherThing.UI.Shapes; 8 | 9 | public class MenuItems 10 | { 11 | 12 | [MenuItem("GameObject/UI/Shapes/Rectangle", false, 1)] 13 | public static void AddRectangle(MenuCommand menuCommand) 14 | { 15 | Undo.AddComponent(CreateShapeGO("Rectangle", menuCommand)); 16 | } 17 | 18 | [MenuItem("GameObject/UI/Shapes/Ellipse", false, 1)] 19 | public static void AddEllipse(MenuCommand menuCommand) 20 | { 21 | Undo.AddComponent(CreateShapeGO("Ellipse", menuCommand)); 22 | } 23 | 24 | 25 | [MenuItem("GameObject/UI/Shapes/Line", false, 30)] 26 | public static void AddLine(MenuCommand menuCommand) 27 | { 28 | Undo.AddComponent(CreateShapeGO("Line", menuCommand)); 29 | } 30 | 31 | [MenuItem("GameObject/UI/Shapes/Polygon", false, 30)] 32 | public static void AddPolygon(MenuCommand menuCommand) 33 | { 34 | Undo.AddComponent(CreateShapeGO("Polygon", menuCommand)); 35 | } 36 | 37 | 38 | [MenuItem("GameObject/UI/Shapes/Arc", false, 50)] 39 | public static void AddArc(MenuCommand menuCommand) 40 | { 41 | Undo.AddComponent(CreateShapeGO("Arc", menuCommand)); 42 | } 43 | 44 | [MenuItem("GameObject/UI/Shapes/Sector", false, 50)] 45 | public static void AddSector(MenuCommand menuCommand) 46 | { 47 | Undo.AddComponent(CreateShapeGO("Sector", menuCommand)); 48 | } 49 | 50 | 51 | [MenuItem("GameObject/UI/Shapes/Edge Gradient", false, 100)] 52 | public static void AddEdgeGradient(MenuCommand menuCommand) 53 | { 54 | Undo.AddComponent(CreateShapeGO("Edge Gradient", menuCommand)); 55 | } 56 | 57 | [MenuItem("GameObject/UI/Shapes/Pixel Line", false, 100)] 58 | public static void AddPixelLine(MenuCommand menuCommand) 59 | { 60 | Undo.AddComponent(CreateShapeGO("Pixel Line", menuCommand)); 61 | } 62 | 63 | 64 | [MenuItem("GameObject/UI/Shapes/Empty Fill Rect", false, 100)] 65 | public static void AddEmptyFillRect(MenuCommand menuCommand) 66 | { 67 | Undo.AddComponent(CreateShapeGO("Empty Fill Rect", menuCommand)); 68 | } 69 | 70 | 71 | public static GameObject CreateShapeGO(string name, MenuCommand menuCommand) 72 | { 73 | GameObject shapeGO = new GameObject(name); 74 | Undo.RegisterCreatedObjectUndo(shapeGO, "Created " + name + " shape"); 75 | 76 | GameObject parent = (GameObject)menuCommand.context; 77 | 78 | if ( 79 | parent != null && 80 | (parent.GetComponent() || parent.GetComponentInParent()) 81 | ) { 82 | Undo.SetTransformParent( 83 | shapeGO.transform, 84 | parent.transform, 85 | "Set " + name + " parent" 86 | ); 87 | 88 | Undo.RecordObject(shapeGO.transform, "centered " + name); 89 | shapeGO.transform.localPosition = Vector3.zero; 90 | shapeGO.transform.localScale = Vector3.one; 91 | } 92 | 93 | Selection.activeGameObject = shapeGO; 94 | 95 | return shapeGO; 96 | } 97 | 98 | public static GameObject CreateCanvas() 99 | { 100 | GameObject canvasGO = new GameObject("Canvas"); 101 | Undo.RegisterCreatedObjectUndo(canvasGO, "Created Canvas"); 102 | 103 | Canvas canvas = Undo.AddComponent(canvasGO); 104 | canvas.renderMode = RenderMode.ScreenSpaceOverlay; 105 | Undo.AddComponent(canvasGO); 106 | Undo.AddComponent(canvasGO); 107 | 108 | return canvasGO; 109 | } 110 | } 111 | -------------------------------------------------------------------------------- /Assets/ThisOtherThing/UI Shapes Kit/Geometry/Editor/Editors/LineEditor.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditor; 3 | using UnityEditor.UI; 4 | 5 | using Line = ThisOtherThing.UI.Shapes.Line; 6 | 7 | [CustomEditor(typeof(Line))] 8 | [CanEditMultipleObjects] 9 | public class LineEditor : GraphicEditor 10 | { 11 | Line linearLine; 12 | 13 | ThisOtherThing.UI.ShapeUtils.PointsList.PointListsProperties pointListsProperties; 14 | RectTransform rectTransform; 15 | 16 | protected SerializedProperty materialProp; 17 | protected SerializedProperty spriteProp; 18 | protected SerializedProperty raycastTargetProp; 19 | 20 | protected SerializedProperty shapePropertiesProp; 21 | protected SerializedProperty pointListPropertiesProp; 22 | protected SerializedProperty linePropertiesPropertiesProp; 23 | protected SerializedProperty outlinePropertiesProp; 24 | protected SerializedProperty shadowPropertiesProp; 25 | protected SerializedProperty antiAliasingPropertiesProp; 26 | 27 | protected override void OnEnable() 28 | { 29 | linearLine = (Line)target; 30 | 31 | rectTransform = linearLine.rectTransform; 32 | pointListsProperties = linearLine.PointListsProperties; 33 | 34 | materialProp = serializedObject.FindProperty("m_Material"); 35 | spriteProp = serializedObject.FindProperty("Sprite"); 36 | raycastTargetProp = serializedObject.FindProperty("m_RaycastTarget"); 37 | 38 | shapePropertiesProp = serializedObject.FindProperty("ShapeProperties"); 39 | pointListPropertiesProp = serializedObject.FindProperty("PointListsProperties"); 40 | linePropertiesPropertiesProp = serializedObject.FindProperty("LineProperties"); 41 | outlinePropertiesProp = serializedObject.FindProperty("OutlineProperties"); 42 | shadowPropertiesProp = serializedObject.FindProperty("ShadowProperties"); 43 | antiAliasingPropertiesProp = serializedObject.FindProperty("AntiAliasingProperties"); 44 | } 45 | 46 | protected override void OnDisable() 47 | { 48 | Tools.hidden = false; 49 | } 50 | 51 | public override void OnInspectorGUI() 52 | { 53 | serializedObject.Update(); 54 | 55 | EditorGUILayout.PropertyField(materialProp); 56 | EditorGUILayout.PropertyField(spriteProp); 57 | EditorGUILayout.PropertyField(raycastTargetProp); 58 | 59 | EditorGUILayout.Space(); 60 | 61 | EditorGUILayout.PropertyField(shapePropertiesProp, true); 62 | EditorGUILayout.PropertyField(pointListPropertiesProp, true); 63 | EditorGUILayout.PropertyField(linePropertiesPropertiesProp, true); 64 | EditorGUILayout.PropertyField(outlinePropertiesProp, true); 65 | 66 | EditorGUILayout.PropertyField(shadowPropertiesProp, true); 67 | EditorGUILayout.PropertyField(antiAliasingPropertiesProp, true); 68 | 69 | serializedObject.ApplyModifiedProperties(); 70 | } 71 | 72 | void OnSceneGUI() 73 | { 74 | Undo.RecordObject(linearLine, "LinarLine"); 75 | 76 | for (int i = 0; i < pointListsProperties.PointListProperties.Length; i++) 77 | { 78 | if ( 79 | pointListsProperties.PointListProperties[i].ShowHandles && 80 | pointListsProperties.PointListProperties[i].GeneratorData.Generator == ThisOtherThing.UI.ShapeUtils.PointsList.PointListGeneratorData.Generators.Custom 81 | ) { 82 | if (PointListDrawer.Draw( 83 | ref pointListsProperties.PointListProperties[i].Positions, 84 | rectTransform, 85 | linearLine.LineProperties.Closed, 86 | 2 87 | )) 88 | linearLine.ForceMeshUpdate(); 89 | } 90 | } 91 | 92 | 93 | // if (!Application.isPlaying && linearLine.enabled) 94 | // { 95 | // linearLine.enabled = false; 96 | // linearLine.enabled = true; 97 | // } 98 | } 99 | 100 | 101 | } 102 | -------------------------------------------------------------------------------- /Assets/ThisOtherThing/Utils/Animation/ValueSetter.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using System.Reflection; 4 | 5 | namespace ThisOtherThing.Utils.Animation 6 | { 7 | [ExecuteInEditMode] 8 | public class ValueSetter : MonoBehaviour 9 | { 10 | public static BindingFlags binding = BindingFlags.Instance | BindingFlags.Public; 11 | 12 | public int FieldType = 0; 13 | 14 | public bool IsInArray; 15 | public int ArrayItemIndex; 16 | 17 | public bool IsInClass; 18 | 19 | public string TargetTypeName; 20 | public string TargetFieldName; 21 | public string FieldName; 22 | public string ArrayFieldName; 23 | 24 | public string TargetClassFieldName; 25 | public string ClassFieldName; 26 | 27 | public float FloatValue; 28 | public Color ColorValue; 29 | 30 | float cachedFloatValue = float.NegativeInfinity; 31 | Color cachedColorValue; 32 | bool cachedBoolValue; 33 | 34 | ThisOtherThing.UI.Shapes.IShape target; 35 | System.Object targetField; 36 | FieldInfo fieldInfo; 37 | 38 | void OnValidate() 39 | { 40 | UpdateCachedReferences (); 41 | } 42 | 43 | void Start() 44 | { 45 | UpdateCachedReferences(); 46 | } 47 | 48 | // this needs to be in update, since Animation can only set public fields and not porperties :( 49 | void Update() 50 | { 51 | if ( 52 | targetField != null && 53 | fieldInfo != null && 54 | (!cachedFloatValue.Equals(FloatValue) || !cachedColorValue.Equals(ColorValue)) 55 | ) { 56 | if (FieldType == 0) 57 | { 58 | fieldInfo.SetValue(targetField, FloatValue); 59 | } 60 | else if (FieldType == 1 ) 61 | { 62 | fieldInfo.SetValue(targetField, FloatValue >= 0.99f); 63 | } 64 | else if (FieldType == 2) 65 | { 66 | fieldInfo.SetValue(targetField, (Color32)ColorValue); 67 | } 68 | 69 | target.ForceMeshUpdate(); 70 | cachedFloatValue = FloatValue; 71 | cachedColorValue = ColorValue; 72 | } 73 | } 74 | 75 | void UpdateCachedReferences() 76 | { 77 | if (TargetTypeName == null || TargetFieldName == null) 78 | return; 79 | 80 | if (target == null) 81 | { 82 | target = gameObject.GetComponent(); 83 | } 84 | 85 | targetField = target.GetType() 86 | .GetField(TargetFieldName, binding) 87 | .GetValue(target); 88 | 89 | if (IsInArray) 90 | { 91 | FieldInfo fieldNameInfo = targetField.GetType().GetField(FieldName); 92 | 93 | if (fieldNameInfo == null) 94 | return; 95 | 96 | System.Type elementType = fieldNameInfo.FieldType.GetElementType(); 97 | 98 | if (elementType != null) 99 | { 100 | fieldInfo = targetField.GetType() 101 | .GetField(FieldName, binding) 102 | .FieldType 103 | .GetElementType() 104 | .GetField(ArrayFieldName, binding); 105 | 106 | System.Array arr = (System.Array)targetField.GetType() 107 | .GetField(FieldName, binding) 108 | .GetValue(targetField); 109 | targetField = arr.GetValue(ArrayItemIndex); 110 | } 111 | } 112 | else 113 | { 114 | fieldInfo = System.Type.GetType(TargetTypeName) 115 | .GetField(FieldName, BindingFlags.Instance | BindingFlags.Public); 116 | } 117 | 118 | if (IsInClass) 119 | { 120 | if (TargetClassFieldName.Length == 0 || ClassFieldName.Length == 0) 121 | return; 122 | 123 | FieldInfo tmpTargetFieldInfo = targetField.GetType() 124 | .GetField(TargetClassFieldName, binding); 125 | 126 | if (tmpTargetFieldInfo == null) 127 | return; 128 | 129 | targetField = tmpTargetFieldInfo 130 | .GetValue(targetField); 131 | 132 | fieldInfo = targetField.GetType() 133 | .GetField(ClassFieldName, binding); 134 | } 135 | } 136 | } 137 | } -------------------------------------------------------------------------------- /Assets/ThisOtherThing/Utils/Animation/ValueSetter2.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using System.Reflection; 4 | 5 | namespace ThisOtherThing.Utils.Animation 6 | { 7 | [ExecuteInEditMode] 8 | public class ValueSetter2 : MonoBehaviour 9 | { 10 | public static BindingFlags binding = BindingFlags.Instance | BindingFlags.Public; 11 | 12 | public int FieldType = 0; 13 | 14 | public bool IsInArray; 15 | public int ArrayItemIndex; 16 | 17 | public bool IsInClass; 18 | 19 | public string TargetTypeName; 20 | public string TargetFieldName; 21 | public string FieldName; 22 | public string ArrayFieldName; 23 | 24 | public string TargetClassFieldName; 25 | public string ClassFieldName; 26 | 27 | public float FloatValue; 28 | public Color ColorValue; 29 | 30 | float cachedFloatValue = float.NegativeInfinity; 31 | Color cachedColorValue; 32 | bool cachedBoolValue; 33 | 34 | ThisOtherThing.UI.Shapes.IShape target; 35 | System.Object targetField; 36 | FieldInfo fieldInfo; 37 | 38 | void OnValidate() 39 | { 40 | UpdateCachedReferences (); 41 | } 42 | 43 | void Start() 44 | { 45 | UpdateCachedReferences(); 46 | } 47 | 48 | // this needs to be in update, since Animation can only set public fields and not porperties :( 49 | void Update() 50 | { 51 | if ( 52 | targetField != null && 53 | fieldInfo != null && 54 | (!cachedFloatValue.Equals(FloatValue) || !cachedColorValue.Equals(ColorValue)) 55 | ) { 56 | if (FieldType == 0) 57 | { 58 | fieldInfo.SetValue(targetField, FloatValue); 59 | } 60 | else if (FieldType == 1 ) 61 | { 62 | fieldInfo.SetValue(targetField, FloatValue >= 0.99f); 63 | } 64 | else if (FieldType == 2) 65 | { 66 | fieldInfo.SetValue(targetField, (Color32)ColorValue); 67 | } 68 | 69 | target.ForceMeshUpdate(); 70 | cachedFloatValue = FloatValue; 71 | cachedColorValue = ColorValue; 72 | } 73 | } 74 | 75 | void UpdateCachedReferences() 76 | { 77 | if (TargetTypeName == null || TargetFieldName == null) 78 | return; 79 | 80 | if (target == null) 81 | { 82 | target = gameObject.GetComponent(); 83 | } 84 | 85 | targetField = target.GetType() 86 | .GetField(TargetFieldName, binding) 87 | .GetValue(target); 88 | 89 | if (IsInArray) 90 | { 91 | FieldInfo fieldNameInfo = targetField.GetType().GetField(FieldName); 92 | 93 | if (fieldNameInfo == null) 94 | return; 95 | 96 | System.Type elementType = fieldNameInfo.FieldType.GetElementType(); 97 | 98 | if (elementType != null) 99 | { 100 | fieldInfo = targetField.GetType() 101 | .GetField(FieldName, binding) 102 | .FieldType 103 | .GetElementType() 104 | .GetField(ArrayFieldName, binding); 105 | 106 | System.Array arr = (System.Array)targetField.GetType() 107 | .GetField(FieldName, binding) 108 | .GetValue(targetField); 109 | targetField = arr.GetValue(ArrayItemIndex); 110 | } 111 | } 112 | else 113 | { 114 | fieldInfo = System.Type.GetType(TargetTypeName) 115 | .GetField(FieldName, BindingFlags.Instance | BindingFlags.Public); 116 | } 117 | 118 | if (IsInClass) 119 | { 120 | if (TargetClassFieldName.Length == 0 || ClassFieldName.Length == 0) 121 | return; 122 | 123 | FieldInfo tmpTargetFieldInfo = targetField.GetType() 124 | .GetField(TargetClassFieldName, binding); 125 | 126 | if (tmpTargetFieldInfo == null) 127 | return; 128 | 129 | targetField = tmpTargetFieldInfo 130 | .GetValue(targetField); 131 | 132 | fieldInfo = targetField.GetType() 133 | .GetField(ClassFieldName, binding); 134 | } 135 | } 136 | } 137 | } -------------------------------------------------------------------------------- /Assets/ThisOtherThing/UI Shapes Kit/Geometry/Editor/CustomDrawers/PolygonPropertiesDrawer.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditor; 3 | 4 | using PolygonProperties = ThisOtherThing.UI.ShapeUtils.Polygons.PolygonProperties; 5 | 6 | [CustomPropertyDrawer(typeof(PolygonProperties))] 7 | public class PolygonPropertiesDrawer : PropertyDrawer 8 | { 9 | public override void OnGUI (Rect position, SerializedProperty property, GUIContent label) 10 | { 11 | position.height = EditorGUIUtility.singleLineHeight; 12 | property.isExpanded = EditorGUI.Foldout(position, property.isExpanded, label); 13 | 14 | if (!property.isExpanded) 15 | { 16 | return; 17 | } 18 | 19 | EditorGUI.BeginProperty(position, label, property); 20 | 21 | PolygonProperties polygonProperties = 22 | (PolygonProperties)fieldInfo.GetValue(property.serializedObject.targetObject); 23 | 24 | var indent = EditorGUI.indentLevel; 25 | EditorGUI.indentLevel = 1; 26 | 27 | Rect propertyPosition = new Rect (position.x, position.y + EditorGUIUtility.singleLineHeight, position.width, EditorGUIUtility.singleLineHeight); 28 | 29 | EditorGUI.PropertyField(propertyPosition, property.FindPropertyRelative("CenterType"), new GUIContent("Center Mode")); 30 | propertyPosition.y += EditorGUIUtility.singleLineHeight * 1.25f; 31 | 32 | switch (polygonProperties.CenterType) 33 | { 34 | case PolygonProperties.CenterTypes.CustomPosition: 35 | EditorGUI.PropertyField(propertyPosition, property.FindPropertyRelative("CustomCenter"), new GUIContent("Custom Center")); 36 | break; 37 | 38 | case PolygonProperties.CenterTypes.Offset: 39 | EditorGUI.PropertyField(propertyPosition, property.FindPropertyRelative("CenterOffset"), new GUIContent("Offset")); 40 | break; 41 | 42 | case PolygonProperties.CenterTypes.Calculated: 43 | break; 44 | 45 | case PolygonProperties.CenterTypes.Cutout: 46 | EditorGUI.PropertyField(propertyPosition, property.FindPropertyRelative("CenterOffset"), new GUIContent("Offset")); 47 | propertyPosition.y += EditorGUI.GetPropertyHeight(property.FindPropertyRelative("CenterOffset")); 48 | EditorGUI.PropertyField(propertyPosition, property.FindPropertyRelative("CutoutProperties"), new GUIContent("Cutout Properties"), true); 49 | break; 50 | 51 | } 52 | 53 | EditorGUI.indentLevel = indent; 54 | EditorGUI.EndProperty(); 55 | } 56 | 57 | public override float GetPropertyHeight(SerializedProperty property, GUIContent label) 58 | { 59 | if (!property.isExpanded) 60 | { 61 | return EditorGUIUtility.singleLineHeight; 62 | } 63 | 64 | PolygonProperties polygonProperties = 65 | (PolygonProperties)fieldInfo.GetValue(property.serializedObject.targetObject); 66 | 67 | SerializedProperty centerOffsetProp = property.FindPropertyRelative("CenterOffset"); 68 | SerializedProperty customCenterProp = property.FindPropertyRelative("CustomCenter"); 69 | 70 | switch (polygonProperties.CenterType) { 71 | case PolygonProperties.CenterTypes.Calculated: 72 | return EditorGUIUtility.singleLineHeight * 2.0f; 73 | 74 | case PolygonProperties.CenterTypes.CustomPosition: 75 | return EditorGUIUtility.singleLineHeight * 2.25f + EditorGUI.GetPropertyHeight(customCenterProp); 76 | 77 | case PolygonProperties.CenterTypes.Offset: 78 | return EditorGUIUtility.singleLineHeight * 2.25f + EditorGUI.GetPropertyHeight(centerOffsetProp); 79 | 80 | case PolygonProperties.CenterTypes.Cutout: 81 | SerializedProperty cutoutProp = property.FindPropertyRelative("CutoutProperties"); 82 | 83 | if (cutoutProp.isExpanded) 84 | { 85 | return EditorGUIUtility.singleLineHeight * 2.5f + EditorGUI.GetPropertyHeight(cutoutProp) + EditorGUI.GetPropertyHeight(centerOffsetProp); 86 | } 87 | else 88 | { 89 | return EditorGUIUtility.singleLineHeight * 3.25f + EditorGUI.GetPropertyHeight(centerOffsetProp); 90 | } 91 | 92 | default: 93 | return EditorGUIUtility.singleLineHeight * 2.0f; 94 | } 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /Assets/ThisOtherThing/UI Shapes Kit/Geometry/Shapes/EdgeGradient.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEngine.UI; 3 | using System.Collections; 4 | 5 | namespace ThisOtherThing.UI.Shapes 6 | { 7 | 8 | [AddComponentMenu("UI/Shapes/Edge Gradient", 100)] 9 | public class EdgeGradient : MaskableGraphic, IShape 10 | { 11 | public enum Positions 12 | { 13 | Top, 14 | Bottom, 15 | Left, 16 | Right, 17 | 18 | OuterTop, 19 | OuterBottom, 20 | OuterLeft, 21 | OuterRight 22 | } 23 | 24 | public GradientProperty[] Properties = { new GradientProperty()}; 25 | 26 | [System.Serializable] 27 | public class GradientProperty 28 | { 29 | public float Size = 20.0f; 30 | public Color32 Color = new Color32(127, 127, 127, 255); 31 | 32 | public Positions Position = Positions.Top; 33 | } 34 | 35 | Vector3 topLeft = Vector3.zero; 36 | Color32 gradientColor = new Color32(127, 127, 127, 255); 37 | 38 | public void ForceMeshUpdate() 39 | { 40 | SetVerticesDirty(); 41 | SetMaterialDirty(); 42 | } 43 | 44 | protected override void OnPopulateMesh(VertexHelper vh) 45 | { 46 | vh.Clear(); 47 | 48 | Rect pixelRect = RectTransformUtility.PixelAdjustRect(rectTransform, canvas); 49 | 50 | for (int i = 0; i < Properties.Length; i++) 51 | { 52 | 53 | gradientColor.r = Properties[i].Color.r; 54 | gradientColor.g = Properties[i].Color.g; 55 | gradientColor.b = Properties[i].Color.b; 56 | gradientColor.a = 0; 57 | 58 | switch (Properties[i].Position) 59 | { 60 | case Positions.Top: 61 | topLeft.x = pixelRect.xMin; 62 | topLeft.y = pixelRect.yMax; 63 | 64 | ShapeUtils.Rects.AddVerticalTwoColorRect( 65 | ref vh, 66 | topLeft, 67 | Properties[i].Size, 68 | pixelRect.width, 69 | Properties[i].Color, 70 | gradientColor, 71 | GeoUtils.ZeroV2 72 | ); 73 | break; 74 | 75 | case Positions.Bottom: 76 | topLeft.x = pixelRect.xMin; 77 | topLeft.y = pixelRect.yMin + Properties[i].Size; 78 | 79 | ShapeUtils.Rects.AddVerticalTwoColorRect( 80 | ref vh, 81 | topLeft, 82 | Properties[i].Size, 83 | pixelRect.width, 84 | gradientColor, 85 | Properties[i].Color, 86 | GeoUtils.ZeroV2 87 | ); 88 | break; 89 | 90 | case Positions.Left: 91 | topLeft.x = pixelRect.xMin; 92 | topLeft.y = pixelRect.yMax; 93 | 94 | ShapeUtils.Rects.AddHorizontalTwoColorRect( 95 | ref vh, 96 | topLeft, 97 | pixelRect.height, 98 | Properties[i].Size, 99 | Properties[i].Color, 100 | gradientColor, 101 | GeoUtils.ZeroV2 102 | ); 103 | break; 104 | 105 | case Positions.Right: 106 | topLeft.x = pixelRect.xMax - Properties[i].Size; 107 | topLeft.y = pixelRect.yMax; 108 | 109 | ShapeUtils.Rects.AddHorizontalTwoColorRect( 110 | ref vh, 111 | topLeft, 112 | pixelRect.height, 113 | Properties[i].Size, 114 | gradientColor, 115 | Properties[i].Color, 116 | GeoUtils.ZeroV2 117 | ); 118 | break; 119 | 120 | case Positions.OuterTop: 121 | topLeft.x = pixelRect.xMin; 122 | topLeft.y = pixelRect.yMax + Properties[i].Size; 123 | 124 | ShapeUtils.Rects.AddVerticalTwoColorRect( 125 | ref vh, 126 | topLeft, 127 | Properties[i].Size, 128 | pixelRect.width, 129 | gradientColor, 130 | Properties[i].Color, 131 | GeoUtils.ZeroV2 132 | ); 133 | break; 134 | 135 | case Positions.OuterBottom: 136 | topLeft.x = pixelRect.xMin; 137 | topLeft.y = pixelRect.yMin; 138 | 139 | ShapeUtils.Rects.AddVerticalTwoColorRect( 140 | ref vh, 141 | topLeft, 142 | Properties[i].Size, 143 | pixelRect.width, 144 | Properties[i].Color, 145 | gradientColor, 146 | GeoUtils.ZeroV2 147 | ); 148 | break; 149 | 150 | case Positions.OuterLeft: 151 | topLeft.x = pixelRect.xMin - Properties[i].Size; 152 | topLeft.y = pixelRect.yMax; 153 | 154 | ShapeUtils.Rects.AddHorizontalTwoColorRect( 155 | ref vh, 156 | topLeft, 157 | pixelRect.height, 158 | Properties[i].Size, 159 | gradientColor, 160 | Properties[i].Color, 161 | GeoUtils.ZeroV2 162 | ); 163 | break; 164 | 165 | case Positions.OuterRight: 166 | topLeft.x = pixelRect.xMax; 167 | topLeft.y = pixelRect.yMax; 168 | 169 | ShapeUtils.Rects.AddHorizontalTwoColorRect( 170 | ref vh, 171 | topLeft, 172 | pixelRect.height, 173 | Properties[i].Size, 174 | Properties[i].Color, 175 | gradientColor, 176 | GeoUtils.ZeroV2 177 | ); 178 | break; 179 | } 180 | } 181 | } 182 | } 183 | } 184 | -------------------------------------------------------------------------------- /ProjectSettings/QualitySettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!47 &1 4 | QualitySettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 5 7 | m_CurrentQuality: 5 8 | m_QualitySettings: 9 | - serializedVersion: 2 10 | name: Fastest 11 | pixelLightCount: 0 12 | shadows: 0 13 | shadowResolution: 0 14 | shadowProjection: 1 15 | shadowCascades: 1 16 | shadowDistance: 15 17 | shadowNearPlaneOffset: 2 18 | shadowCascade2Split: 0.33333334 19 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 20 | blendWeights: 1 21 | textureQuality: 1 22 | anisotropicTextures: 0 23 | antiAliasing: 0 24 | softParticles: 0 25 | softVegetation: 0 26 | realtimeReflectionProbes: 0 27 | billboardsFaceCameraPosition: 0 28 | vSyncCount: 0 29 | lodBias: 0.3 30 | maximumLODLevel: 0 31 | particleRaycastBudget: 4 32 | asyncUploadTimeSlice: 2 33 | asyncUploadBufferSize: 4 34 | excludedTargetPlatforms: [] 35 | - serializedVersion: 2 36 | name: Fast 37 | pixelLightCount: 0 38 | shadows: 0 39 | shadowResolution: 0 40 | shadowProjection: 1 41 | shadowCascades: 1 42 | shadowDistance: 20 43 | shadowNearPlaneOffset: 2 44 | shadowCascade2Split: 0.33333334 45 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 46 | blendWeights: 2 47 | textureQuality: 0 48 | anisotropicTextures: 0 49 | antiAliasing: 0 50 | softParticles: 0 51 | softVegetation: 0 52 | realtimeReflectionProbes: 0 53 | billboardsFaceCameraPosition: 0 54 | vSyncCount: 0 55 | lodBias: 0.4 56 | maximumLODLevel: 0 57 | particleRaycastBudget: 16 58 | asyncUploadTimeSlice: 2 59 | asyncUploadBufferSize: 4 60 | excludedTargetPlatforms: [] 61 | - serializedVersion: 2 62 | name: Simple 63 | pixelLightCount: 1 64 | shadows: 1 65 | shadowResolution: 0 66 | shadowProjection: 1 67 | shadowCascades: 1 68 | shadowDistance: 20 69 | shadowNearPlaneOffset: 2 70 | shadowCascade2Split: 0.33333334 71 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 72 | blendWeights: 2 73 | textureQuality: 0 74 | anisotropicTextures: 1 75 | antiAliasing: 0 76 | softParticles: 0 77 | softVegetation: 0 78 | realtimeReflectionProbes: 0 79 | billboardsFaceCameraPosition: 0 80 | vSyncCount: 1 81 | lodBias: 0.7 82 | maximumLODLevel: 0 83 | particleRaycastBudget: 64 84 | asyncUploadTimeSlice: 2 85 | asyncUploadBufferSize: 4 86 | excludedTargetPlatforms: [] 87 | - serializedVersion: 2 88 | name: Good 89 | pixelLightCount: 2 90 | shadows: 2 91 | shadowResolution: 1 92 | shadowProjection: 1 93 | shadowCascades: 2 94 | shadowDistance: 40 95 | shadowNearPlaneOffset: 2 96 | shadowCascade2Split: 0.33333334 97 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 98 | blendWeights: 2 99 | textureQuality: 0 100 | anisotropicTextures: 1 101 | antiAliasing: 0 102 | softParticles: 0 103 | softVegetation: 1 104 | realtimeReflectionProbes: 1 105 | billboardsFaceCameraPosition: 1 106 | vSyncCount: 1 107 | lodBias: 1 108 | maximumLODLevel: 0 109 | particleRaycastBudget: 256 110 | asyncUploadTimeSlice: 2 111 | asyncUploadBufferSize: 4 112 | excludedTargetPlatforms: [] 113 | - serializedVersion: 2 114 | name: Beautiful 115 | pixelLightCount: 3 116 | shadows: 2 117 | shadowResolution: 2 118 | shadowProjection: 1 119 | shadowCascades: 2 120 | shadowDistance: 70 121 | shadowNearPlaneOffset: 2 122 | shadowCascade2Split: 0.33333334 123 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 124 | blendWeights: 4 125 | textureQuality: 0 126 | anisotropicTextures: 2 127 | antiAliasing: 2 128 | softParticles: 1 129 | softVegetation: 1 130 | realtimeReflectionProbes: 1 131 | billboardsFaceCameraPosition: 1 132 | vSyncCount: 1 133 | lodBias: 1.5 134 | maximumLODLevel: 0 135 | particleRaycastBudget: 1024 136 | asyncUploadTimeSlice: 2 137 | asyncUploadBufferSize: 4 138 | excludedTargetPlatforms: [] 139 | - serializedVersion: 2 140 | name: Fantastic 141 | pixelLightCount: 0 142 | shadows: 0 143 | shadowResolution: 0 144 | shadowProjection: 1 145 | shadowCascades: 1 146 | shadowDistance: 150 147 | shadowNearPlaneOffset: 2 148 | shadowCascade2Split: 0.33333334 149 | shadowCascade4Split: {x: 0.06666667, y: 0.19999999, z: 0.46666664} 150 | blendWeights: 1 151 | textureQuality: 0 152 | anisotropicTextures: 0 153 | antiAliasing: 0 154 | softParticles: 0 155 | softVegetation: 1 156 | realtimeReflectionProbes: 0 157 | billboardsFaceCameraPosition: 0 158 | vSyncCount: 1 159 | lodBias: 2 160 | maximumLODLevel: 0 161 | particleRaycastBudget: 4096 162 | asyncUploadTimeSlice: 2 163 | asyncUploadBufferSize: 4 164 | excludedTargetPlatforms: [] 165 | m_PerPlatformDefaultQuality: 166 | Android: 2 167 | Nintendo 3DS: 5 168 | PS3: 5 169 | PS4: 5 170 | PSM: 5 171 | PSP2: 2 172 | Samsung TV: 2 173 | Standalone: 5 174 | Tizen: 2 175 | Web: 5 176 | WebGL: 3 177 | WiiU: 5 178 | Windows Store Apps: 5 179 | XBOX360: 5 180 | XboxOne: 5 181 | iPhone: 2 182 | tvOS: 5 183 | -------------------------------------------------------------------------------- /Assets/ThisOtherThing/UI Shapes Kit/Geometry/Shapes/Polygon.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEngine.UI; 3 | using System.Collections; 4 | 5 | namespace ThisOtherThing.UI.Shapes 6 | { 7 | 8 | [AddComponentMenu("UI/Shapes/Polygon", 30)] 9 | public class Polygon : MaskableGraphic, IShape 10 | { 11 | 12 | public GeoUtils.ShapeProperties ShapeProperties = 13 | new GeoUtils.ShapeProperties(); 14 | 15 | public ShapeUtils.PointsList.PointListsProperties PointListsProperties = 16 | new ShapeUtils.PointsList.PointListsProperties(); 17 | 18 | public ShapeUtils.Polygons.PolygonProperties PolygonProperties = 19 | new ShapeUtils.Polygons.PolygonProperties(); 20 | 21 | public GeoUtils.ShadowsProperties ShadowProperties = new GeoUtils.ShadowsProperties(); 22 | 23 | public GeoUtils.AntiAliasingProperties AntiAliasingProperties = 24 | new GeoUtils.AntiAliasingProperties(); 25 | 26 | ShapeUtils.PointsList.PointsData[] pointsListData = 27 | new ThisOtherThing.UI.ShapeUtils.PointsList.PointsData[] { new ShapeUtils.PointsList.PointsData()}; 28 | GeoUtils.EdgeGradientData edgeGradientData; 29 | 30 | Rect pixelRect; 31 | 32 | public void ForceMeshUpdate() 33 | { 34 | if (pointsListData == null || pointsListData.Length != PointListsProperties.PointListProperties.Length) 35 | { 36 | System.Array.Resize(ref pointsListData, PointListsProperties.PointListProperties.Length); 37 | } 38 | 39 | for (int i = 0; i < pointsListData.Length; i++) 40 | { 41 | pointsListData[i].NeedsUpdate = true; 42 | PointListsProperties.PointListProperties[i].GeneratorData.NeedsUpdate = true; 43 | } 44 | 45 | SetVerticesDirty(); 46 | SetMaterialDirty(); 47 | } 48 | 49 | protected override void OnEnable() 50 | { 51 | for (int i = 0; i < pointsListData.Length; i++) 52 | { 53 | pointsListData[i].IsClosed = true; 54 | } 55 | 56 | base.OnEnable(); 57 | } 58 | 59 | #if UNITY_EDITOR 60 | protected override void OnValidate() 61 | { 62 | if (pointsListData == null || pointsListData.Length != PointListsProperties.PointListProperties.Length) 63 | { 64 | System.Array.Resize(ref pointsListData, PointListsProperties.PointListProperties.Length); 65 | } 66 | 67 | for (int i = 0; i < pointsListData.Length; i++) 68 | { 69 | pointsListData[i].NeedsUpdate = true; 70 | pointsListData[i].IsClosed = true; 71 | } 72 | 73 | 74 | 75 | AntiAliasingProperties.OnCheck(); 76 | 77 | ForceMeshUpdate(); 78 | } 79 | #endif 80 | 81 | protected override void OnPopulateMesh(VertexHelper vh) 82 | { 83 | vh.Clear(); 84 | 85 | if (pointsListData == null || pointsListData.Length != PointListsProperties.PointListProperties.Length) 86 | { 87 | System.Array.Resize(ref pointsListData, PointListsProperties.PointListProperties.Length); 88 | 89 | for (int i = 0; i < pointsListData.Length; i++) 90 | { 91 | pointsListData[i].NeedsUpdate = true; 92 | pointsListData[i].IsClosed = true; 93 | } 94 | } 95 | 96 | pixelRect = RectTransformUtility.PixelAdjustRect(rectTransform, canvas); 97 | 98 | AntiAliasingProperties.UpdateAdjusted(canvas); 99 | ShadowProperties.UpdateAdjusted(); 100 | 101 | for (int i = 0; i < PointListsProperties.PointListProperties.Length; i++) 102 | { 103 | PointListsProperties.PointListProperties[i].GeneratorData.SkipLastPosition = true; 104 | PointListsProperties.PointListProperties[i].SetPoints(); 105 | } 106 | 107 | for (int i = 0; i < PointListsProperties.PointListProperties.Length; i++) 108 | { 109 | if ( 110 | PointListsProperties.PointListProperties[i].Positions != null && 111 | PointListsProperties.PointListProperties[i].Positions.Length > 2 112 | ) { 113 | PolygonProperties.UpdateAdjusted(PointListsProperties.PointListProperties[i]); 114 | 115 | // shadows 116 | if (ShadowProperties.ShadowsEnabled) 117 | { 118 | for (int j = 0; j < ShadowProperties.Shadows.Length; j++) 119 | { 120 | edgeGradientData.SetActiveData( 121 | 1.0f - ShadowProperties.Shadows[j].Softness, 122 | ShadowProperties.Shadows[j].Size, 123 | AntiAliasingProperties.Adjusted 124 | ); 125 | 126 | ShapeUtils.Polygons.AddPolygon( 127 | ref vh, 128 | PolygonProperties, 129 | PointListsProperties.PointListProperties[i], 130 | ShadowProperties.GetCenterOffset(pixelRect.center, j), 131 | ShadowProperties.Shadows[j].Color, 132 | GeoUtils.ZeroV2, 133 | ref pointsListData[i], 134 | edgeGradientData 135 | ); 136 | } 137 | } 138 | } 139 | } 140 | 141 | 142 | for (int i = 0; i < PointListsProperties.PointListProperties.Length; i++) 143 | { 144 | if ( 145 | PointListsProperties.PointListProperties[i].Positions != null && 146 | PointListsProperties.PointListProperties[i].Positions.Length > 2 147 | ) { 148 | PolygonProperties.UpdateAdjusted(PointListsProperties.PointListProperties[i]); 149 | 150 | // fill 151 | if (ShadowProperties.ShowShape) 152 | { 153 | if (AntiAliasingProperties.Adjusted > 0.0f) 154 | { 155 | edgeGradientData.SetActiveData( 156 | 1.0f, 157 | 0.0f, 158 | AntiAliasingProperties.Adjusted 159 | ); 160 | } 161 | else 162 | { 163 | edgeGradientData.Reset(); 164 | } 165 | 166 | ShapeUtils.Polygons.AddPolygon( 167 | ref vh, 168 | PolygonProperties, 169 | PointListsProperties.PointListProperties[i], 170 | pixelRect.center, 171 | ShapeProperties.FillColor, 172 | GeoUtils.ZeroV2, 173 | ref pointsListData[i], 174 | edgeGradientData 175 | ); 176 | } 177 | } 178 | } 179 | 180 | 181 | } 182 | 183 | } 184 | } 185 | -------------------------------------------------------------------------------- /Assets/ThisOtherThing/UI Shapes Kit/Geometry/Shapes/Ellipse.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEngine.UI; 3 | using System.Collections; 4 | 5 | namespace ThisOtherThing.UI.Shapes 6 | { 7 | [AddComponentMenu("UI/Shapes/Ellipse", 1)] 8 | public class Ellipse : MaskableGraphic, IShape 9 | { 10 | public GeoUtils.OutlineShapeProperties ShapeProperties = 11 | new GeoUtils.OutlineShapeProperties(); 12 | 13 | public ShapeUtils.Ellipses.EllipseProperties EllipseProperties = 14 | new ShapeUtils.Ellipses.EllipseProperties(); 15 | 16 | public GeoUtils.OutlineProperties OutlineProperties = 17 | new GeoUtils.OutlineProperties(); 18 | 19 | public GeoUtils.ShadowsProperties ShadowProperties = new GeoUtils.ShadowsProperties(); 20 | 21 | public GeoUtils.AntiAliasingProperties AntiAliasingProperties = 22 | new GeoUtils.AntiAliasingProperties(); 23 | 24 | public Sprite Sprite; 25 | 26 | GeoUtils.UnitPositionData unitPositionData; 27 | GeoUtils.EdgeGradientData edgeGradientData; 28 | Vector2 radius = Vector2.one; 29 | 30 | public void ForceMeshUpdate() 31 | { 32 | SetVerticesDirty(); 33 | SetMaterialDirty(); 34 | } 35 | 36 | #if UNITY_EDITOR 37 | protected override void OnValidate() 38 | { 39 | EllipseProperties.OnCheck(); 40 | OutlineProperties.OnCheck(); 41 | 42 | AntiAliasingProperties.OnCheck(); 43 | 44 | ForceMeshUpdate(); 45 | } 46 | #endif 47 | 48 | protected override void OnPopulateMesh(VertexHelper vh) 49 | { 50 | vh.Clear(); 51 | 52 | OutlineProperties.UpdateAdjusted(); 53 | ShadowProperties.UpdateAdjusted(); 54 | 55 | Rect pixelRect = RectTransformUtility.PixelAdjustRect(rectTransform, canvas); 56 | 57 | ShapeUtils.Ellipses.SetRadius( 58 | ref radius, 59 | pixelRect.width, 60 | pixelRect.height, 61 | EllipseProperties 62 | ); 63 | 64 | EllipseProperties.UpdateAdjusted(radius, 0.0f); 65 | AntiAliasingProperties.UpdateAdjusted(canvas); 66 | 67 | 68 | // draw fill shadows 69 | if (ShadowProperties.ShadowsEnabled) 70 | { 71 | if (ShapeProperties.DrawFill && ShapeProperties.DrawFillShadow) 72 | { 73 | for (int i = 0; i < ShadowProperties.Shadows.Length; i++) 74 | { 75 | edgeGradientData.SetActiveData( 76 | 1.0f - ShadowProperties.Shadows[i].Softness, 77 | ShadowProperties.Shadows[i].Size, 78 | AntiAliasingProperties.Adjusted 79 | ); 80 | 81 | ShapeUtils.Ellipses.AddCircle( 82 | ref vh, 83 | ShadowProperties.GetCenterOffset(pixelRect.center, i), 84 | radius, 85 | EllipseProperties, 86 | ShadowProperties.Shadows[i].Color, 87 | GeoUtils.ZeroV2, 88 | ref unitPositionData, 89 | edgeGradientData 90 | ); 91 | } 92 | } 93 | } 94 | 95 | if (ShadowProperties.ShowShape && ShapeProperties.DrawFill) 96 | { 97 | if (AntiAliasingProperties.Adjusted > 0.0f) 98 | { 99 | edgeGradientData.SetActiveData( 100 | 1.0f, 101 | 0.0f, 102 | AntiAliasingProperties.Adjusted 103 | ); 104 | } 105 | else 106 | { 107 | edgeGradientData.Reset(); 108 | } 109 | 110 | ShapeUtils.Ellipses.AddCircle( 111 | ref vh, 112 | (Vector3)pixelRect.center, 113 | radius, 114 | EllipseProperties, 115 | ShapeProperties.FillColor, 116 | GeoUtils.ZeroV2, 117 | ref unitPositionData, 118 | edgeGradientData 119 | ); 120 | } 121 | 122 | if (ShadowProperties.ShadowsEnabled) 123 | { 124 | // draw outline shadows 125 | if (ShapeProperties.DrawOutline && ShapeProperties.DrawOutlineShadow) 126 | { 127 | for (int i = 0; i < ShadowProperties.Shadows.Length; i++) 128 | { 129 | edgeGradientData.SetActiveData( 130 | 1.0f - ShadowProperties.Shadows[i].Softness, 131 | ShadowProperties.Shadows[i].Size, 132 | AntiAliasingProperties.Adjusted 133 | ); 134 | 135 | ShapeUtils.Ellipses.AddRing( 136 | ref vh, 137 | ShadowProperties.GetCenterOffset(pixelRect.center, i), 138 | radius, 139 | OutlineProperties, 140 | EllipseProperties, 141 | ShadowProperties.Shadows[i].Color, 142 | GeoUtils.ZeroV2, 143 | ref unitPositionData, 144 | edgeGradientData 145 | ); 146 | } 147 | } 148 | } 149 | 150 | 151 | // fill 152 | if (ShadowProperties.ShowShape && ShapeProperties.DrawOutline) 153 | { 154 | if (AntiAliasingProperties.Adjusted > 0.0f) 155 | { 156 | edgeGradientData.SetActiveData( 157 | 1.0f, 158 | 0.0f, 159 | AntiAliasingProperties.Adjusted 160 | ); 161 | } 162 | else 163 | { 164 | edgeGradientData.Reset(); 165 | } 166 | 167 | ShapeUtils.Ellipses.AddRing( 168 | ref vh, 169 | (Vector3)pixelRect.center, 170 | radius, 171 | OutlineProperties, 172 | EllipseProperties, 173 | ShapeProperties.OutlineColor, 174 | Vector2.zero, 175 | ref unitPositionData, 176 | edgeGradientData 177 | ); 178 | } 179 | } 180 | 181 | protected override void UpdateMaterial() 182 | { 183 | base.UpdateMaterial(); 184 | 185 | // check if this sprite has an associated alpha texture (generated when splitting RGBA = RGB + A as two textures without alpha) 186 | 187 | if (Sprite == null) 188 | { 189 | canvasRenderer.SetAlphaTexture(null); 190 | return; 191 | } 192 | 193 | Texture2D alphaTex = Sprite.associatedAlphaSplitTexture; 194 | 195 | if (alphaTex != null) 196 | { 197 | canvasRenderer.SetAlphaTexture(alphaTex); 198 | } 199 | } 200 | 201 | public override Texture mainTexture 202 | { 203 | get 204 | { 205 | if (Sprite == null) 206 | { 207 | if (material != null && material.mainTexture != null) 208 | { 209 | return material.mainTexture; 210 | } 211 | return s_WhiteTexture; 212 | } 213 | 214 | return Sprite.texture; 215 | } 216 | } 217 | } 218 | } 219 | -------------------------------------------------------------------------------- /Assets/ThisOtherThing/UI Shapes Kit/Geometry/Shapes/Line.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEngine.UI; 3 | using System.Collections; 4 | 5 | namespace ThisOtherThing.UI.Shapes 6 | { 7 | [AddComponentMenu("UI/Shapes/Line", 30)] 8 | public class Line : MaskableGraphic, IShape 9 | { 10 | public GeoUtils.ShapeProperties ShapeProperties = 11 | new GeoUtils.ShapeProperties(); 12 | 13 | public ShapeUtils.PointsList.PointListsProperties PointListsProperties = 14 | new ShapeUtils.PointsList.PointListsProperties(); 15 | 16 | public ShapeUtils.Lines.LineProperties LineProperties = 17 | new ShapeUtils.Lines.LineProperties(); 18 | 19 | public GeoUtils.OutlineProperties OutlineProperties = 20 | new GeoUtils.OutlineProperties(); 21 | 22 | public GeoUtils.ShadowsProperties ShadowProperties = new GeoUtils.ShadowsProperties(); 23 | 24 | public GeoUtils.AntiAliasingProperties AntiAliasingProperties = 25 | new GeoUtils.AntiAliasingProperties(); 26 | 27 | public Sprite Sprite; 28 | 29 | ShapeUtils.PointsList.PointsData[] pointsListData = 30 | new ThisOtherThing.UI.ShapeUtils.PointsList.PointsData[] { new ShapeUtils.PointsList.PointsData()}; 31 | 32 | GeoUtils.EdgeGradientData edgeGradientData; 33 | 34 | public void ForceMeshUpdate() 35 | { 36 | if (pointsListData == null || pointsListData.Length != PointListsProperties.PointListProperties.Length) 37 | { 38 | System.Array.Resize(ref pointsListData, PointListsProperties.PointListProperties.Length); 39 | } 40 | 41 | for (int i = 0; i < pointsListData.Length; i++) 42 | { 43 | pointsListData[i].NeedsUpdate = true; 44 | PointListsProperties.PointListProperties[i].GeneratorData.NeedsUpdate = true; 45 | } 46 | 47 | SetVerticesDirty(); 48 | SetMaterialDirty(); 49 | } 50 | 51 | #if UNITY_EDITOR 52 | protected override void OnValidate() 53 | { 54 | LineProperties.OnCheck(); 55 | OutlineProperties.OnCheck(); 56 | AntiAliasingProperties.OnCheck(); 57 | 58 | ForceMeshUpdate(); 59 | } 60 | #endif 61 | 62 | protected override void OnPopulateMesh(VertexHelper vh) 63 | { 64 | vh.Clear(); 65 | 66 | OutlineProperties.UpdateAdjusted(); 67 | ShadowProperties.UpdateAdjusted(); 68 | 69 | if (pointsListData == null || pointsListData.Length != PointListsProperties.PointListProperties.Length) 70 | { 71 | System.Array.Resize(ref pointsListData, PointListsProperties.PointListProperties.Length); 72 | 73 | for (int i = 0; i < pointsListData.Length; i++) 74 | { 75 | pointsListData[i].NeedsUpdate = true; 76 | PointListsProperties.PointListProperties[i].GeneratorData.NeedsUpdate = true; 77 | } 78 | } 79 | 80 | for (int i = 0; i < PointListsProperties.PointListProperties.Length; i++) 81 | PointListsProperties.PointListProperties[i].SetPoints(); 82 | 83 | for (int i = 0; i < PointListsProperties.PointListProperties.Length; i++) 84 | { 85 | if ( 86 | PointListsProperties.PointListProperties[i].Positions != null && 87 | PointListsProperties.PointListProperties[i].Positions.Length > 1 88 | ) { 89 | AntiAliasingProperties.UpdateAdjusted(canvas); 90 | 91 | // shadows 92 | if (ShadowProperties.ShadowsEnabled) 93 | { 94 | for (int j = 0; j < ShadowProperties.Shadows.Length; j++) 95 | { 96 | edgeGradientData.SetActiveData( 97 | 1.0f - ShadowProperties.Shadows[j].Softness, 98 | ShadowProperties.Shadows[j].Size, 99 | AntiAliasingProperties.Adjusted 100 | ); 101 | 102 | ShapeUtils.Lines.AddLine( 103 | ref vh, 104 | LineProperties, 105 | PointListsProperties.PointListProperties[i], 106 | ShadowProperties.GetCenterOffset(GeoUtils.ZeroV2, j), 107 | OutlineProperties, 108 | ShadowProperties.Shadows[j].Color, 109 | GeoUtils.ZeroV2, 110 | ref pointsListData[i], 111 | edgeGradientData 112 | ); 113 | } 114 | } 115 | } 116 | } 117 | 118 | for (int i = 0; i < PointListsProperties.PointListProperties.Length; i++) 119 | { 120 | if ( 121 | PointListsProperties.PointListProperties[i].Positions != null && 122 | PointListsProperties.PointListProperties[i].Positions.Length > 1 123 | ) { 124 | // fill 125 | if (ShadowProperties.ShowShape) 126 | { 127 | if (AntiAliasingProperties.Adjusted > 0.0f) 128 | { 129 | edgeGradientData.SetActiveData( 130 | 1.0f, 131 | 0.0f, 132 | AntiAliasingProperties.Adjusted 133 | ); 134 | } 135 | else 136 | { 137 | edgeGradientData.Reset(); 138 | } 139 | 140 | ShapeUtils.Lines.AddLine( 141 | ref vh, 142 | LineProperties, 143 | PointListsProperties.PointListProperties[i], 144 | GeoUtils.ZeroV2, 145 | OutlineProperties, 146 | ShapeProperties.FillColor, 147 | GeoUtils.ZeroV2, 148 | ref pointsListData[i], 149 | edgeGradientData 150 | ); 151 | } 152 | } 153 | } 154 | 155 | 156 | } 157 | 158 | protected override void UpdateMaterial() 159 | { 160 | base.UpdateMaterial(); 161 | 162 | // check if this sprite has an associated alpha texture (generated when splitting RGBA = RGB + A as two textures without alpha) 163 | 164 | if (Sprite == null) 165 | { 166 | canvasRenderer.SetAlphaTexture(null); 167 | return; 168 | } 169 | 170 | Texture2D alphaTex = Sprite.associatedAlphaSplitTexture; 171 | 172 | if (alphaTex != null) 173 | { 174 | canvasRenderer.SetAlphaTexture(alphaTex); 175 | } 176 | } 177 | 178 | public override Texture mainTexture 179 | { 180 | get 181 | { 182 | if (Sprite == null) 183 | { 184 | if (material != null && material.mainTexture != null) 185 | { 186 | return material.mainTexture; 187 | } 188 | return s_WhiteTexture; 189 | } 190 | 191 | return Sprite.texture; 192 | } 193 | } 194 | 195 | } 196 | } 197 | -------------------------------------------------------------------------------- /Assets/ThisOtherThing/UI Shapes Kit/Geometry/Shapes/Rectangle.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEngine.UI; 3 | using System.Collections; 4 | 5 | namespace ThisOtherThing.UI.Shapes 6 | { 7 | [AddComponentMenu("UI/Shapes/Rectangle", 1)] 8 | public class Rectangle : MaskableGraphic, IShape 9 | { 10 | 11 | public GeoUtils.OutlineShapeProperties ShapeProperties = 12 | new GeoUtils.OutlineShapeProperties(); 13 | 14 | public ShapeUtils.RoundedRects.RoundedProperties RoundedProperties = 15 | new ShapeUtils.RoundedRects.RoundedProperties(); 16 | 17 | public UI.GeoUtils.OutlineProperties OutlineProperties = 18 | new UI.GeoUtils.OutlineProperties(); 19 | 20 | public GeoUtils.ShadowsProperties ShadowProperties = new GeoUtils.ShadowsProperties(); 21 | 22 | public GeoUtils.AntiAliasingProperties AntiAliasingProperties = 23 | new GeoUtils.AntiAliasingProperties(); 24 | 25 | public Sprite Sprite; 26 | 27 | ShapeUtils.RoundedRects.RoundedCornerUnitPositionData unitPositionData; 28 | UI.GeoUtils.EdgeGradientData edgeGradientData; 29 | 30 | public void ForceMeshUpdate() 31 | { 32 | SetVerticesDirty(); 33 | SetMaterialDirty(); 34 | } 35 | 36 | #if UNITY_EDITOR 37 | protected override void OnValidate() 38 | { 39 | RoundedProperties.OnCheck(rectTransform.rect); 40 | OutlineProperties.OnCheck(); 41 | AntiAliasingProperties.OnCheck(); 42 | 43 | ForceMeshUpdate(); 44 | } 45 | #endif 46 | 47 | protected override void OnPopulateMesh(VertexHelper vh) { 48 | vh.Clear(); 49 | 50 | Rect pixelRect = RectTransformUtility.PixelAdjustRect(rectTransform, canvas); 51 | 52 | RoundedProperties.UpdateAdjusted(pixelRect, 0.0f); 53 | AntiAliasingProperties.UpdateAdjusted(canvas); 54 | OutlineProperties.UpdateAdjusted(); 55 | ShadowProperties.UpdateAdjusted(); 56 | 57 | // draw fill shadows 58 | if (ShadowProperties.ShadowsEnabled) 59 | { 60 | if (ShapeProperties.DrawFill && ShapeProperties.DrawFillShadow) 61 | { 62 | for (int i = 0; i < ShadowProperties.Shadows.Length; i++) 63 | { 64 | edgeGradientData.SetActiveData( 65 | 1.0f - ShadowProperties.Shadows[i].Softness, 66 | ShadowProperties.Shadows[i].Size, 67 | AntiAliasingProperties.Adjusted 68 | ); 69 | 70 | ShapeUtils.RoundedRects.AddRoundedRect( 71 | ref vh, 72 | ShadowProperties.GetCenterOffset(pixelRect.center, i), 73 | pixelRect.width, 74 | pixelRect.height, 75 | RoundedProperties, 76 | ShadowProperties.Shadows[i].Color, 77 | GeoUtils.ZeroV2, 78 | ref unitPositionData, 79 | edgeGradientData 80 | ); 81 | } 82 | } 83 | } 84 | 85 | if (ShadowProperties.ShowShape && ShapeProperties.DrawFill) 86 | { 87 | if (AntiAliasingProperties.Adjusted > 0.0f) 88 | { 89 | edgeGradientData.SetActiveData( 90 | 1.0f, 91 | 0.0f, 92 | AntiAliasingProperties.Adjusted 93 | ); 94 | } 95 | else 96 | { 97 | edgeGradientData.Reset(); 98 | } 99 | 100 | ShapeUtils.RoundedRects.AddRoundedRect( 101 | ref vh, 102 | pixelRect.center, 103 | pixelRect.width, 104 | pixelRect.height, 105 | RoundedProperties, 106 | ShapeProperties.FillColor, 107 | GeoUtils.ZeroV2, 108 | ref unitPositionData, 109 | edgeGradientData 110 | ); 111 | } 112 | 113 | if (ShadowProperties.ShadowsEnabled) 114 | { 115 | // draw outline shadows 116 | if (ShapeProperties.DrawOutline && ShapeProperties.DrawOutlineShadow) 117 | { 118 | for (int i = 0; i < ShadowProperties.Shadows.Length; i++) 119 | { 120 | edgeGradientData.SetActiveData( 121 | 1.0f - ShadowProperties.Shadows[i].Softness, 122 | ShadowProperties.Shadows[i].Size, 123 | AntiAliasingProperties.Adjusted 124 | ); 125 | 126 | ShapeUtils.RoundedRects.AddRoundedRectLine( 127 | ref vh, 128 | ShadowProperties.GetCenterOffset(pixelRect.center, i), 129 | pixelRect.width, 130 | pixelRect.height, 131 | OutlineProperties, 132 | RoundedProperties, 133 | ShadowProperties.Shadows[i].Color, 134 | GeoUtils.ZeroV2, 135 | ref unitPositionData, 136 | edgeGradientData 137 | ); 138 | } 139 | } 140 | } 141 | 142 | // fill 143 | if (ShadowProperties.ShowShape && ShapeProperties.DrawOutline) 144 | { 145 | if (AntiAliasingProperties.Adjusted > 0.0f) 146 | { 147 | edgeGradientData.SetActiveData( 148 | 1.0f, 149 | 0.0f, 150 | AntiAliasingProperties.Adjusted 151 | ); 152 | } 153 | else 154 | { 155 | edgeGradientData.Reset(); 156 | } 157 | 158 | ShapeUtils.RoundedRects.AddRoundedRectLine( 159 | ref vh, 160 | pixelRect.center, 161 | pixelRect.width, 162 | pixelRect.height, 163 | OutlineProperties, 164 | RoundedProperties, 165 | ShapeProperties.OutlineColor, 166 | UI.GeoUtils.ZeroV2, 167 | ref unitPositionData, 168 | edgeGradientData 169 | ); 170 | } 171 | } 172 | 173 | protected override void UpdateMaterial() 174 | { 175 | base.UpdateMaterial(); 176 | 177 | // check if this sprite has an associated alpha texture (generated when splitting RGBA = RGB + A as two textures without alpha) 178 | 179 | if (Sprite == null) 180 | { 181 | canvasRenderer.SetAlphaTexture(null); 182 | return; 183 | } 184 | 185 | Texture2D alphaTex = Sprite.associatedAlphaSplitTexture; 186 | 187 | if (alphaTex != null) 188 | { 189 | canvasRenderer.SetAlphaTexture(alphaTex); 190 | } 191 | } 192 | 193 | public override Texture mainTexture 194 | { 195 | get 196 | { 197 | if (Sprite == null) 198 | { 199 | if (material != null && material.mainTexture != null) 200 | { 201 | return material.mainTexture; 202 | } 203 | return s_WhiteTexture; 204 | } 205 | 206 | return Sprite.texture; 207 | } 208 | } 209 | } 210 | } -------------------------------------------------------------------------------- /Assets/ThisOtherThing/UI Shapes Kit/Geometry/Editor/CustomDrawers/PointListDrawer.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditor; 3 | 4 | public class PointListDrawer 5 | { 6 | 7 | static Vector3 worldPosition; 8 | static Vector3 uiNormal = Vector3.forward; 9 | static Vector3 tmpUiPos = Vector3.zero; 10 | static Vector3 tmpUiPos2 = Vector3.zero; 11 | 12 | static Vector3 draggedPosition = Vector3.zero; 13 | static Vector2 offset = Vector3.zero; 14 | 15 | public static bool Draw( 16 | ref Vector2[] positions, 17 | RectTransform rectTransform, 18 | bool isClosed, 19 | int minPoints 20 | ) { 21 | bool needsUpdate = false; 22 | 23 | bool runDelete = Event.current.modifiers == EventModifiers.Control; 24 | bool axisSnapping = Event.current.modifiers == EventModifiers.Shift; 25 | 26 | if (runDelete) 27 | { 28 | needsUpdate |= DrawRemovePointPosition(ref positions, rectTransform, minPoints); 29 | } 30 | else 31 | { 32 | 33 | for (int i = 0; i < positions.Length; i++) 34 | { 35 | needsUpdate |= DrawUpdatePointPosition(ref positions[i], rectTransform, axisSnapping); 36 | } 37 | 38 | needsUpdate |= DrawInbetweenButtons(ref positions, rectTransform, isClosed); 39 | } 40 | 41 | return needsUpdate; 42 | } 43 | 44 | static bool DrawUpdatePointPosition( 45 | ref Vector2 position, 46 | RectTransform rectTransform, 47 | bool axisSnapping 48 | ) { 49 | worldPosition = rectTransform.TransformPoint(position); 50 | 51 | draggedPosition = rectTransform.InverseTransformPoint( 52 | Handles.FreeMoveHandle( 53 | worldPosition, 54 | Quaternion.identity, 55 | HandleUtility.GetHandleSize(worldPosition) * 0.1f, 56 | Vector3.zero, 57 | DrawPointHandle 58 | ) 59 | ); 60 | 61 | offset.x = draggedPosition.x - position.x; 62 | offset.y = draggedPosition.y - position.y; 63 | 64 | /// TODO snapping 65 | 66 | position.x += offset.x; 67 | position.y += offset.y; 68 | 69 | return offset.x != 0.0f || offset.y != 0.0f; 70 | } 71 | 72 | static bool DrawRemovePointPosition( 73 | ref Vector2[] positions, 74 | RectTransform rectTransform, 75 | int minPoints 76 | ) { 77 | bool removedPoint = false; 78 | 79 | for (int i = 0; i < positions.Length; i++) 80 | { 81 | worldPosition = rectTransform.TransformPoint(positions[i]); 82 | 83 | float handleSize = HandleUtility.GetHandleSize(worldPosition) * 0.1f; 84 | 85 | if ( 86 | Handles.Button(worldPosition, Quaternion.identity, handleSize, handleSize, DrawRemovePointHandle) && 87 | positions.Length > minPoints 88 | ) { 89 | // shift other points 90 | for (int j = i; j < positions.Length - 1; j++) 91 | { 92 | positions[j] = positions[j + 1]; 93 | } 94 | 95 | System.Array.Resize(ref positions, positions.Length - 1); 96 | 97 | removedPoint = true; 98 | } 99 | } 100 | 101 | return removedPoint; 102 | } 103 | 104 | static bool DrawInbetweenButtons( 105 | ref Vector2[] positions, 106 | RectTransform rectTransform, 107 | bool isClosed 108 | ) { 109 | bool addedPoint = false; 110 | 111 | Handles.color = Color.red; 112 | 113 | float handleSize; 114 | 115 | for (int i = positions.Length - 2; i >= 0; i--) 116 | { 117 | 118 | worldPosition.x = (positions[i].x + positions[i + 1].x) * 0.5f; 119 | worldPosition.y = (positions[i].y + positions[i + 1].y) * 0.5f; 120 | worldPosition.z = 0.0f; 121 | 122 | worldPosition = rectTransform.TransformPoint(worldPosition); 123 | 124 | handleSize = HandleUtility.GetHandleSize(worldPosition) * 0.08f; 125 | 126 | if ( 127 | Handles.Button(worldPosition, Quaternion.identity, handleSize, handleSize, DrawAddPointHandle) 128 | ) { 129 | System.Array.Resize(ref positions, positions.Length + 1); 130 | 131 | // shift other points 132 | for (int j = positions.Length - 1; j > i; j--) 133 | { 134 | positions[j] = positions[j - 1]; 135 | } 136 | 137 | positions[i+1] = rectTransform.InverseTransformPoint(worldPosition); 138 | 139 | addedPoint = true; 140 | } 141 | } 142 | 143 | if (isClosed) 144 | { 145 | worldPosition.x = (positions[0].x + positions[positions.Length - 1].x) * 0.5f; 146 | worldPosition.y = (positions[0].y + positions[positions.Length - 1].y) * 0.5f; 147 | worldPosition.z = 0.0f; 148 | 149 | worldPosition = rectTransform.TransformPoint(worldPosition); 150 | 151 | handleSize = HandleUtility.GetHandleSize(worldPosition) * 0.08f; 152 | 153 | if ( 154 | Handles.Button(worldPosition, Quaternion.identity, handleSize, handleSize, DrawAddPointHandle) 155 | ) { 156 | System.Array.Resize(ref positions, positions.Length + 1); 157 | 158 | positions[positions.Length - 1] = rectTransform.InverseTransformPoint(worldPosition); 159 | 160 | // slightly offset positionif there is a closed loop and the new point is right between the two other points 161 | if (isClosed && positions.Length == 3) 162 | { 163 | positions[positions.Length - 1].y += 0.1f; 164 | } 165 | 166 | addedPoint = true; 167 | } 168 | } 169 | 170 | return addedPoint; 171 | } 172 | 173 | static void DrawPointHandle(int controlId, Vector3 position, Quaternion rotation, float size, EventType eventType){ 174 | Handles.color = Color.black; 175 | 176 | Handles.DrawSolidDisc(position, uiNormal, size * 1.4f); 177 | 178 | Handles.color = Color.white; 179 | Handles.DrawSolidDisc(position, uiNormal, size); 180 | Handles.CircleHandleCap(controlId, position, rotation, size, eventType); 181 | 182 | Handles.color = Color.black; 183 | Handles.DrawSolidDisc(position, uiNormal, size * 0.8f); 184 | } 185 | 186 | static void DrawRemovePointHandle(int controlId, Vector3 position, Quaternion rotation, float size, EventType eventType){ 187 | Handles.color = Color.black; 188 | 189 | Handles.DrawSolidDisc(position, uiNormal, size * 1.4f); 190 | Handles.CircleHandleCap(controlId, position, rotation, size * 1.4f, eventType); 191 | 192 | Handles.color = Color.red; 193 | Handles.DrawSolidDisc(position, uiNormal, size); 194 | 195 | Handles.color = Color.black; 196 | Handles.DrawSolidDisc(position, uiNormal, size * 0.8f); 197 | } 198 | 199 | static void DrawAddPointHandle(int controlId, Vector3 position, Quaternion rotation, float size, EventType eventType){ 200 | Handles.color = Color.black; 201 | Handles.CircleHandleCap(controlId, position, rotation, size, eventType); 202 | Handles.DrawSolidDisc(position, uiNormal, size); 203 | 204 | Handles.color = Color.white; 205 | Handles.DrawSolidDisc(position, uiNormal, size * 0.2f); 206 | 207 | } 208 | 209 | static void DrawPlus(Vector3 position, float size) 210 | { 211 | tmpUiPos.x = position.x - size * 0.5f; 212 | tmpUiPos.y = position.y; 213 | tmpUiPos.z = position.z; 214 | 215 | tmpUiPos2.x = position.x + size * 0.5f; 216 | tmpUiPos2.y = position.y; 217 | tmpUiPos2.z = position.z; 218 | 219 | Handles.DrawLine(tmpUiPos, tmpUiPos2); 220 | 221 | tmpUiPos.x = position.x; 222 | tmpUiPos.y = position.y - size * 0.5f; 223 | 224 | tmpUiPos2.x = position.x; 225 | tmpUiPos2.y = position.y + size * 0.5f; 226 | 227 | Handles.DrawLine(tmpUiPos, tmpUiPos2); 228 | } 229 | } 230 | -------------------------------------------------------------------------------- /Assets/ThisOtherThing/UI Shapes Kit/Geometry/Editor/CustomDrawers/ShadowsPropertiesDrawer.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditor; 3 | 4 | using ShadowsProperties = ThisOtherThing.UI.GeoUtils.ShadowsProperties; 5 | using ShadowProperties = ThisOtherThing.UI.GeoUtils.ShadowProperties; 6 | 7 | [CustomPropertyDrawer(typeof(ShadowsProperties))] 8 | public class ShadowsPropertiesDrawer : PropertyDrawer 9 | { 10 | 11 | public override void OnGUI (Rect position, SerializedProperty property, GUIContent label) 12 | { 13 | position.height = EditorGUIUtility.singleLineHeight; 14 | property.isExpanded = EditorGUI.Foldout(position, property.isExpanded, label); 15 | 16 | if (!property.isExpanded) 17 | return; 18 | 19 | EditorGUI.BeginProperty(position, label, property); 20 | 21 | ShadowsProperties shadowProperties = 22 | (ShadowsProperties)fieldInfo.GetValue(property.serializedObject.targetObject); 23 | 24 | var indent = EditorGUI.indentLevel; 25 | EditorGUI.indentLevel = 1; 26 | 27 | Rect propertyPosition = new Rect (position.x, position.y + EditorGUIUtility.singleLineHeight, position.width, EditorGUIUtility.singleLineHeight); 28 | 29 | EditorGUI.PropertyField(propertyPosition, property.FindPropertyRelative("ShowShape"), new GUIContent("Shape")); 30 | propertyPosition.y += EditorGUIUtility.singleLineHeight; 31 | 32 | EditorGUI.PropertyField(propertyPosition, property.FindPropertyRelative("ShowShadows"), new GUIContent("Shadows")); 33 | propertyPosition.y += EditorGUIUtility.singleLineHeight * 1.5f; 34 | 35 | if (!shadowProperties.ShowShadows) 36 | { 37 | EditorGUI.indentLevel = indent; 38 | return; 39 | } 40 | 41 | EditorGUI.LabelField(propertyPosition, new GUIContent("Position Offset")); 42 | propertyPosition.y += EditorGUIUtility.singleLineHeight; 43 | 44 | EditorGUI.PropertyField(propertyPosition, property.FindPropertyRelative("Angle"), new GUIContent("Angle")); 45 | propertyPosition.y += EditorGUIUtility.singleLineHeight; 46 | 47 | EditorGUI.PropertyField(propertyPosition, property.FindPropertyRelative("Distance"), new GUIContent("Distance")); 48 | propertyPosition.y += EditorGUIUtility.singleLineHeight * 1.5f; 49 | 50 | 51 | SerializedProperty shadowsProp = property.FindPropertyRelative("Shadows"); 52 | 53 | EditorGUI.PropertyField(propertyPosition, shadowsProp, new GUIContent("Shadows")); 54 | propertyPosition.y += EditorGUIUtility.singleLineHeight; 55 | 56 | EditorGUI.indentLevel++; 57 | 58 | SerializedProperty singleShadowProp; 59 | 60 | if (shadowsProp.isExpanded && shadowProperties.Shadows != null) 61 | { 62 | for (int i = 0; i < shadowProperties.Shadows.Length; i++) 63 | { 64 | singleShadowProp = shadowsProp.GetArrayElementAtIndex(i); 65 | 66 | bool delete = DrawSingleShadowButtons(singleShadowProp, shadowsProp, propertyPosition, i, shadowProperties.Shadows.Length-1); 67 | EditorGUI.PropertyField(propertyPosition, singleShadowProp, new GUIContent("Shadow"), true); 68 | propertyPosition.y += EditorGUI.GetPropertyHeight(singleShadowProp) + EditorGUIUtility.singleLineHeight * (singleShadowProp.isExpanded ? 0.75f : 0.25f); 69 | 70 | if (delete) 71 | { 72 | // shift isExpanded downwards, since the delete messes it up otherwise 73 | for (int j = i; j < shadowProperties.Shadows.Length-1; j++) 74 | { 75 | shadowsProp.GetArrayElementAtIndex(j).isExpanded = shadowsProp.GetArrayElementAtIndex(j+1).isExpanded; 76 | } 77 | 78 | shadowsProp.DeleteArrayElementAtIndex(i); 79 | break; 80 | } 81 | } 82 | } 83 | 84 | propertyPosition.x += 20.0f; 85 | propertyPosition.width -= 60.0f; 86 | if ( 87 | shadowsProp.isExpanded && 88 | ( 89 | shadowProperties.Shadows == null || 90 | (shadowProperties.Shadows != null && shadowProperties.Shadows.Length == 0) 91 | ) && 92 | GUI.Button(propertyPosition, "add shadow") 93 | ) { 94 | Object targetObject = shadowsProp.serializedObject.targetObject; 95 | 96 | // register undo, since InsertArrayElementAtIndex doesn't set default values 97 | Undo.RecordObject(targetObject , "added shadow"); 98 | 99 | shadowProperties.Shadows = new ShadowProperties[1]; 100 | shadowProperties.Shadows[0] = new ShadowProperties(); 101 | 102 | // toogle graphic off and on to force the graphic to be updated 103 | ((UnityEngine.UI.Graphic)targetObject).enabled = false; 104 | ((UnityEngine.UI.Graphic)targetObject).enabled = true; 105 | } 106 | 107 | EditorGUI.indentLevel--; 108 | 109 | EditorGUI.indentLevel = indent; 110 | EditorGUI.EndProperty(); 111 | } 112 | 113 | public override float GetPropertyHeight(SerializedProperty property, GUIContent label) 114 | { 115 | if (!property.isExpanded) 116 | { 117 | return EditorGUIUtility.singleLineHeight; 118 | } 119 | 120 | float height = EditorGUIUtility.singleLineHeight * 5.75f; 121 | 122 | ShadowsProperties shadowProperties = 123 | (ShadowsProperties)fieldInfo.GetValue(property.serializedObject.targetObject); 124 | 125 | if (!shadowProperties.ShowShadows) 126 | { 127 | return EditorGUIUtility.singleLineHeight * 3.0f; 128 | } 129 | 130 | height += EditorGUIUtility.singleLineHeight; 131 | height += EditorGUI.GetPropertyHeight(property.FindPropertyRelative("Shadows")); 132 | 133 | 134 | // remove height for hidden size field 135 | SerializedProperty shadowsProp = property.FindPropertyRelative("Shadows"); 136 | if (shadowsProp.isExpanded && shadowProperties.Shadows != null && shadowProperties.Shadows.Length > 0) 137 | { 138 | height -= EditorGUIUtility.singleLineHeight; 139 | 140 | // add shadow buttons spacing 141 | SerializedProperty singleShadowProp; 142 | for (int i = 0; i < shadowProperties.Shadows.Length - 1; i++) 143 | { 144 | singleShadowProp = shadowsProp.GetArrayElementAtIndex(i); 145 | height += EditorGUIUtility.singleLineHeight * (singleShadowProp.isExpanded ? 0.75f : 0.25f); 146 | } 147 | } 148 | 149 | return height; 150 | } 151 | 152 | float buttonWidth = 20.0f; 153 | bool DrawSingleShadowButtons( 154 | SerializedProperty singleShadowProp, 155 | SerializedProperty shadowsProp, 156 | Rect position, 157 | int index, 158 | int maxIndex 159 | ) { 160 | GUI.depth--; 161 | 162 | position.x += 100.0f; 163 | position.width = buttonWidth; 164 | 165 | if (GUI.Button(position, "▼", EditorStyles.miniButtonLeft)) 166 | { 167 | int newIndex = Mathf.Min(index+1, maxIndex); 168 | 169 | shadowsProp.GetArrayElementAtIndex(newIndex).isExpanded = true; 170 | shadowsProp.MoveArrayElement(index, newIndex); 171 | } 172 | 173 | position.x += buttonWidth; 174 | if (GUI.Button(position, "▲", EditorStyles.miniButtonRight)) 175 | { 176 | int newIndex = Mathf.Max(index-1, 0); 177 | 178 | shadowsProp.GetArrayElementAtIndex(newIndex).isExpanded = true; 179 | shadowsProp.MoveArrayElement(index, newIndex); 180 | } 181 | 182 | position.x += buttonWidth; 183 | if (GUI.Button(position, "-", EditorStyles.miniButtonLeft)) 184 | { 185 | return true; 186 | } 187 | 188 | position.x += buttonWidth; 189 | if (GUI.Button(position, "+", EditorStyles.miniButtonRight)) 190 | { 191 | shadowsProp.InsertArrayElementAtIndex(index); 192 | } 193 | 194 | return false; 195 | } 196 | } 197 | -------------------------------------------------------------------------------- /ProjectSettings/InputManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!13 &1 4 | InputManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Axes: 8 | - serializedVersion: 3 9 | m_Name: Horizontal 10 | descriptiveName: 11 | descriptiveNegativeName: 12 | negativeButton: left 13 | positiveButton: right 14 | altNegativeButton: a 15 | altPositiveButton: d 16 | gravity: 3 17 | dead: 0.001 18 | sensitivity: 3 19 | snap: 1 20 | invert: 0 21 | type: 0 22 | axis: 0 23 | joyNum: 0 24 | - serializedVersion: 3 25 | m_Name: Vertical 26 | descriptiveName: 27 | descriptiveNegativeName: 28 | negativeButton: down 29 | positiveButton: up 30 | altNegativeButton: s 31 | altPositiveButton: w 32 | gravity: 3 33 | dead: 0.001 34 | sensitivity: 3 35 | snap: 1 36 | invert: 0 37 | type: 0 38 | axis: 0 39 | joyNum: 0 40 | - serializedVersion: 3 41 | m_Name: Fire1 42 | descriptiveName: 43 | descriptiveNegativeName: 44 | negativeButton: 45 | positiveButton: left ctrl 46 | altNegativeButton: 47 | altPositiveButton: mouse 0 48 | gravity: 1000 49 | dead: 0.001 50 | sensitivity: 1000 51 | snap: 0 52 | invert: 0 53 | type: 0 54 | axis: 0 55 | joyNum: 0 56 | - serializedVersion: 3 57 | m_Name: Fire2 58 | descriptiveName: 59 | descriptiveNegativeName: 60 | negativeButton: 61 | positiveButton: left alt 62 | altNegativeButton: 63 | altPositiveButton: mouse 1 64 | gravity: 1000 65 | dead: 0.001 66 | sensitivity: 1000 67 | snap: 0 68 | invert: 0 69 | type: 0 70 | axis: 0 71 | joyNum: 0 72 | - serializedVersion: 3 73 | m_Name: Fire3 74 | descriptiveName: 75 | descriptiveNegativeName: 76 | negativeButton: 77 | positiveButton: left shift 78 | altNegativeButton: 79 | altPositiveButton: mouse 2 80 | gravity: 1000 81 | dead: 0.001 82 | sensitivity: 1000 83 | snap: 0 84 | invert: 0 85 | type: 0 86 | axis: 0 87 | joyNum: 0 88 | - serializedVersion: 3 89 | m_Name: Jump 90 | descriptiveName: 91 | descriptiveNegativeName: 92 | negativeButton: 93 | positiveButton: space 94 | altNegativeButton: 95 | altPositiveButton: 96 | gravity: 1000 97 | dead: 0.001 98 | sensitivity: 1000 99 | snap: 0 100 | invert: 0 101 | type: 0 102 | axis: 0 103 | joyNum: 0 104 | - serializedVersion: 3 105 | m_Name: Mouse X 106 | descriptiveName: 107 | descriptiveNegativeName: 108 | negativeButton: 109 | positiveButton: 110 | altNegativeButton: 111 | altPositiveButton: 112 | gravity: 0 113 | dead: 0 114 | sensitivity: 0.1 115 | snap: 0 116 | invert: 0 117 | type: 1 118 | axis: 0 119 | joyNum: 0 120 | - serializedVersion: 3 121 | m_Name: Mouse Y 122 | descriptiveName: 123 | descriptiveNegativeName: 124 | negativeButton: 125 | positiveButton: 126 | altNegativeButton: 127 | altPositiveButton: 128 | gravity: 0 129 | dead: 0 130 | sensitivity: 0.1 131 | snap: 0 132 | invert: 0 133 | type: 1 134 | axis: 1 135 | joyNum: 0 136 | - serializedVersion: 3 137 | m_Name: Mouse ScrollWheel 138 | descriptiveName: 139 | descriptiveNegativeName: 140 | negativeButton: 141 | positiveButton: 142 | altNegativeButton: 143 | altPositiveButton: 144 | gravity: 0 145 | dead: 0 146 | sensitivity: 0.1 147 | snap: 0 148 | invert: 0 149 | type: 1 150 | axis: 2 151 | joyNum: 0 152 | - serializedVersion: 3 153 | m_Name: Horizontal 154 | descriptiveName: 155 | descriptiveNegativeName: 156 | negativeButton: 157 | positiveButton: 158 | altNegativeButton: 159 | altPositiveButton: 160 | gravity: 0 161 | dead: 0.19 162 | sensitivity: 1 163 | snap: 0 164 | invert: 0 165 | type: 2 166 | axis: 0 167 | joyNum: 0 168 | - serializedVersion: 3 169 | m_Name: Vertical 170 | descriptiveName: 171 | descriptiveNegativeName: 172 | negativeButton: 173 | positiveButton: 174 | altNegativeButton: 175 | altPositiveButton: 176 | gravity: 0 177 | dead: 0.19 178 | sensitivity: 1 179 | snap: 0 180 | invert: 1 181 | type: 2 182 | axis: 1 183 | joyNum: 0 184 | - serializedVersion: 3 185 | m_Name: Fire1 186 | descriptiveName: 187 | descriptiveNegativeName: 188 | negativeButton: 189 | positiveButton: joystick button 0 190 | altNegativeButton: 191 | altPositiveButton: 192 | gravity: 1000 193 | dead: 0.001 194 | sensitivity: 1000 195 | snap: 0 196 | invert: 0 197 | type: 0 198 | axis: 0 199 | joyNum: 0 200 | - serializedVersion: 3 201 | m_Name: Fire2 202 | descriptiveName: 203 | descriptiveNegativeName: 204 | negativeButton: 205 | positiveButton: joystick button 1 206 | altNegativeButton: 207 | altPositiveButton: 208 | gravity: 1000 209 | dead: 0.001 210 | sensitivity: 1000 211 | snap: 0 212 | invert: 0 213 | type: 0 214 | axis: 0 215 | joyNum: 0 216 | - serializedVersion: 3 217 | m_Name: Fire3 218 | descriptiveName: 219 | descriptiveNegativeName: 220 | negativeButton: 221 | positiveButton: joystick button 2 222 | altNegativeButton: 223 | altPositiveButton: 224 | gravity: 1000 225 | dead: 0.001 226 | sensitivity: 1000 227 | snap: 0 228 | invert: 0 229 | type: 0 230 | axis: 0 231 | joyNum: 0 232 | - serializedVersion: 3 233 | m_Name: Jump 234 | descriptiveName: 235 | descriptiveNegativeName: 236 | negativeButton: 237 | positiveButton: joystick button 3 238 | altNegativeButton: 239 | altPositiveButton: 240 | gravity: 1000 241 | dead: 0.001 242 | sensitivity: 1000 243 | snap: 0 244 | invert: 0 245 | type: 0 246 | axis: 0 247 | joyNum: 0 248 | - serializedVersion: 3 249 | m_Name: Submit 250 | descriptiveName: 251 | descriptiveNegativeName: 252 | negativeButton: 253 | positiveButton: return 254 | altNegativeButton: 255 | altPositiveButton: joystick button 0 256 | gravity: 1000 257 | dead: 0.001 258 | sensitivity: 1000 259 | snap: 0 260 | invert: 0 261 | type: 0 262 | axis: 0 263 | joyNum: 0 264 | - serializedVersion: 3 265 | m_Name: Submit 266 | descriptiveName: 267 | descriptiveNegativeName: 268 | negativeButton: 269 | positiveButton: enter 270 | altNegativeButton: 271 | altPositiveButton: space 272 | gravity: 1000 273 | dead: 0.001 274 | sensitivity: 1000 275 | snap: 0 276 | invert: 0 277 | type: 0 278 | axis: 0 279 | joyNum: 0 280 | - serializedVersion: 3 281 | m_Name: Cancel 282 | descriptiveName: 283 | descriptiveNegativeName: 284 | negativeButton: 285 | positiveButton: escape 286 | altNegativeButton: 287 | altPositiveButton: joystick button 1 288 | gravity: 1000 289 | dead: 0.001 290 | sensitivity: 1000 291 | snap: 0 292 | invert: 0 293 | type: 0 294 | axis: 0 295 | joyNum: 0 296 | -------------------------------------------------------------------------------- /Assets/ThisOtherThing/Utils/Animation/Editor/ValueSetterEditor2.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditor; 3 | using System.Linq; 4 | using System.Collections; 5 | using System.Reflection; 6 | using System; 7 | 8 | [CustomEditor(typeof(ThisOtherThing.Utils.Animation.ValueSetter2))] 9 | public class FunctionDemoEditor2 : Editor 10 | { 11 | static FieldInfo[] targetFields; 12 | static string[] targetFieldNames; 13 | static string[] fieldNames; 14 | 15 | SerializedProperty floatValueProp; 16 | SerializedProperty colorValueProp; 17 | // SerializedProperty boolValueProp; 18 | 19 | SerializedProperty isInArrayProp; 20 | SerializedProperty arrayItemIndexProp; 21 | SerializedProperty isInClassInArrayProp; 22 | 23 | 24 | string[] fieldTypes = new string[] { 25 | "Float", 26 | "Bool", 27 | "Color" 28 | }; 29 | 30 | void OnEnable() 31 | { 32 | floatValueProp = serializedObject.FindProperty("FloatValue"); 33 | colorValueProp = serializedObject.FindProperty("ColorValue"); 34 | // boolValueProp = serializedObject.FindProperty("BoolValue"); 35 | 36 | isInArrayProp = serializedObject.FindProperty("IsInArray"); 37 | arrayItemIndexProp = serializedObject.FindProperty("ArrayItemIndex"); 38 | isInClassInArrayProp = serializedObject.FindProperty("IsInClass"); 39 | } 40 | 41 | public override void OnInspectorGUI() 42 | { 43 | // DrawDefaultInspector(); 44 | 45 | ThisOtherThing.Utils.Animation.ValueSetter2 obj = target as ThisOtherThing.Utils.Animation.ValueSetter2; 46 | var targetType = obj.gameObject.GetComponent().GetType (); 47 | 48 | obj.FieldType = EditorGUILayout.Popup(obj.FieldType, fieldTypes); 49 | 50 | EditorGUILayout.PropertyField(isInArrayProp); 51 | 52 | if (obj.IsInArray) 53 | { 54 | EditorGUILayout.PropertyField(arrayItemIndexProp); 55 | } 56 | 57 | EditorGUILayout.PropertyField(isInClassInArrayProp); 58 | 59 | EditorGUILayout.Space(); 60 | 61 | Type fieldType; 62 | switch (obj.FieldType) 63 | { 64 | case 0: 65 | fieldType = typeof(float); 66 | break; 67 | case 1: 68 | fieldType = typeof(bool); 69 | break; 70 | case 2: 71 | fieldType = typeof(Color); 72 | break; 73 | default: 74 | fieldType = typeof(float); 75 | break; 76 | } 77 | 78 | var targetFieldInfos = targetType 79 | .GetFields(ThisOtherThing.Utils.Animation.ValueSetter.binding); 80 | 81 | targetFieldNames = targetFieldInfos 82 | .Where(x => x.FieldType.Namespace.StartsWith("ThisOtherThing")) 83 | .Select(x => x.Name.ToString()) 84 | .ToArray(); 85 | 86 | if (obj != null) 87 | { 88 | int fieldIndex; 89 | 90 | int targetFieldIndex = GetIndexInNameArray(targetFieldNames, obj.TargetFieldName); 91 | 92 | targetFieldIndex = EditorGUILayout.Popup(targetFieldIndex, targetFieldNames); 93 | 94 | obj.TargetTypeName = targetFieldInfos[targetFieldIndex].FieldType.ToString(); 95 | obj.TargetFieldName = targetFieldNames[targetFieldIndex]; 96 | 97 | 98 | // set field data 99 | var fields = targetFieldInfos[targetFieldIndex].FieldType 100 | .GetFields (ThisOtherThing.Utils.Animation.ValueSetter.binding) // Instance methods, both public and private/protected 101 | .Where (x => !x.Name.Contains ("Adjusted")); 102 | 103 | if (obj.IsInArray) 104 | { 105 | fields = fields.Where (x => x.FieldType.IsArray); 106 | } 107 | else 108 | { 109 | fields = fields.Where (x => x.FieldType == fieldType); 110 | } 111 | 112 | 113 | fieldNames = fields 114 | .Select(x => x.Name) 115 | .ToArray(); 116 | 117 | fieldIndex = GetIndexInNameArray(fieldNames, obj.FieldName); 118 | 119 | if (fieldNames != null && fieldNames.Length > 0) 120 | { 121 | obj.FieldName = fieldNames[EditorGUILayout.Popup(fieldIndex, fieldNames)]; 122 | } 123 | 124 | if (obj.IsInArray) 125 | { 126 | FieldInfo fieldNameInfo = targetFieldInfos[targetFieldIndex].FieldType.GetField(obj.FieldName); 127 | 128 | if (fieldNameInfo == null) 129 | { 130 | serializedObject.ApplyModifiedProperties(); 131 | return; 132 | } 133 | 134 | Type arrayFieldType = fieldNameInfo.FieldType.GetElementType(); 135 | 136 | string[] arrayFieldNames = arrayFieldType 137 | .GetFields(ThisOtherThing.Utils.Animation.ValueSetter.binding) 138 | .Where (x => x.FieldType == fieldType) 139 | .Select(x => x.Name) 140 | .ToArray(); 141 | 142 | int arrayFieldIndex = GetIndexInNameArray(arrayFieldNames, obj.ArrayFieldName); 143 | 144 | if (!obj.IsInClass) 145 | { 146 | if (arrayFieldNames != null && arrayFieldNames.Length > 0) 147 | { 148 | obj.ArrayFieldName = arrayFieldNames[EditorGUILayout.Popup(arrayFieldIndex, arrayFieldNames)]; 149 | } 150 | } 151 | else 152 | { 153 | int targetClassFieldIndex = 0; 154 | 155 | var targetClassFields = arrayFieldType 156 | .GetFields(ThisOtherThing.Utils.Animation.ValueSetter.binding) 157 | .Where (x => x.FieldType.IsClass) 158 | .Where (x => x.FieldType.Namespace.StartsWith("ThisOtherThing")); 159 | 160 | string[] targetClassFieldNames = targetClassFields 161 | .Select(x => x.Name) 162 | .ToArray(); 163 | 164 | if (targetClassFieldNames.Length > 0) 165 | { 166 | targetClassFieldIndex = GetIndexInNameArray(targetClassFieldNames, obj.TargetClassFieldName); 167 | 168 | obj.TargetClassFieldName = targetClassFieldNames[EditorGUILayout.Popup(targetClassFieldIndex, targetClassFieldNames)]; 169 | 170 | var classFieldNames = arrayFieldType. 171 | GetField(obj.TargetClassFieldName, ThisOtherThing.Utils.Animation.ValueSetter.binding) 172 | .FieldType 173 | .GetFields(ThisOtherThing.Utils.Animation.ValueSetter.binding) 174 | .Where (x => x.FieldType == fieldType) 175 | .Select(x => x.Name) 176 | .ToArray(); 177 | 178 | int classFieldIndex = GetIndexInNameArray(classFieldNames, obj.ClassFieldName); 179 | 180 | if (classFieldNames.Length > 0) 181 | { 182 | obj.ClassFieldName = classFieldNames[EditorGUILayout.Popup(classFieldIndex, classFieldNames)]; 183 | } 184 | } 185 | } 186 | } 187 | else if (obj.IsInClass) 188 | { 189 | Type targetFieldType = targetFieldInfos[targetFieldIndex].FieldType; 190 | 191 | var fieldNames = targetFieldType 192 | .GetFields(ThisOtherThing.Utils.Animation.ValueSetter.binding) 193 | .Where (x => x.FieldType.IsClass) 194 | .Where (x => x.FieldType.Namespace.StartsWith("ThisOtherThing")) 195 | .Select(x => x.Name) 196 | .ToArray(); 197 | 198 | if (fieldNames.Length == 0) 199 | return; 200 | 201 | int index = GetIndexInNameArray(fieldNames, obj.TargetClassFieldName); 202 | 203 | obj.TargetClassFieldName = fieldNames[EditorGUILayout.Popup(index, fieldNames)]; 204 | 205 | fieldNames = targetFieldInfos[targetFieldIndex].FieldType 206 | .GetField(obj.TargetClassFieldName, ThisOtherThing.Utils.Animation.ValueSetter.binding) 207 | .FieldType 208 | .GetFields(ThisOtherThing.Utils.Animation.ValueSetter.binding) 209 | .Where (x => x.FieldType == fieldType) 210 | .Select(x => x.Name) 211 | .ToArray(); 212 | 213 | if (fieldNames.Length == 0) 214 | return; 215 | 216 | index = GetIndexInNameArray(fieldNames, obj.ClassFieldName); 217 | obj.ClassFieldName = fieldNames[EditorGUILayout.Popup(index, fieldNames)]; 218 | } 219 | 220 | EditorGUILayout.Space(); 221 | 222 | if (obj.FieldType == 0 || obj.FieldType == 1) 223 | { 224 | EditorGUILayout.PropertyField(floatValueProp); 225 | } 226 | else if (obj.FieldType == 2) 227 | { 228 | EditorGUILayout.PropertyField(colorValueProp); 229 | } 230 | 231 | serializedObject.ApplyModifiedProperties(); 232 | } 233 | } 234 | 235 | int GetIndexInNameArray(string[] names, string name) 236 | { 237 | try 238 | { 239 | return names 240 | .Select((v, i) => new { Name = v, Index = i }) 241 | .First(x => x.Name == name) 242 | .Index; 243 | } 244 | catch 245 | { 246 | return 0; 247 | } 248 | } 249 | } -------------------------------------------------------------------------------- /Assets/ThisOtherThing/Utils/Animation/Editor/ValueSetterEditor.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditor; 3 | using System.Linq; 4 | using System.Collections; 5 | using System.Reflection; 6 | using System; 7 | 8 | [CustomEditor(typeof(ThisOtherThing.Utils.Animation.ValueSetter))] 9 | public class FunctionDemoEditor : Editor 10 | { 11 | static FieldInfo[] targetFields; 12 | static string[] targetFieldNames; 13 | static string[] fieldNames; 14 | 15 | SerializedProperty floatValueProp; 16 | SerializedProperty colorValueProp; 17 | // SerializedProperty boolValueProp; 18 | 19 | SerializedProperty isInArrayProp; 20 | SerializedProperty arrayItemIndexProp; 21 | SerializedProperty isInClassInArrayProp; 22 | 23 | 24 | string[] fieldTypes = new string[] { 25 | "Float", 26 | "Bool", 27 | "Color" 28 | }; 29 | 30 | void OnEnable() 31 | { 32 | floatValueProp = serializedObject.FindProperty("FloatValue"); 33 | colorValueProp = serializedObject.FindProperty("ColorValue"); 34 | // boolValueProp = serializedObject.FindProperty("BoolValue"); 35 | 36 | isInArrayProp = serializedObject.FindProperty("IsInArray"); 37 | arrayItemIndexProp = serializedObject.FindProperty("ArrayItemIndex"); 38 | isInClassInArrayProp = serializedObject.FindProperty("IsInClass"); 39 | } 40 | 41 | public override void OnInspectorGUI() 42 | { 43 | // DrawDefaultInspector(); 44 | 45 | ThisOtherThing.Utils.Animation.ValueSetter obj = target as ThisOtherThing.Utils.Animation.ValueSetter; 46 | var targetType = obj.gameObject.GetComponent().GetType (); 47 | 48 | obj.FieldType = EditorGUILayout.Popup(obj.FieldType, fieldTypes); 49 | 50 | EditorGUILayout.PropertyField(isInArrayProp); 51 | 52 | if (obj.IsInArray) 53 | { 54 | EditorGUILayout.PropertyField(arrayItemIndexProp); 55 | } 56 | 57 | EditorGUILayout.PropertyField(isInClassInArrayProp); 58 | 59 | EditorGUILayout.Space(); 60 | 61 | Type fieldType; 62 | switch (obj.FieldType) 63 | { 64 | case 0: 65 | fieldType = typeof(float); 66 | break; 67 | case 1: 68 | fieldType = typeof(bool); 69 | break; 70 | case 2: 71 | fieldType = typeof(Color); 72 | break; 73 | default: 74 | fieldType = typeof(float); 75 | break; 76 | } 77 | 78 | var targetFieldInfos = targetType 79 | .GetFields(ThisOtherThing.Utils.Animation.ValueSetter.binding); 80 | 81 | targetFieldNames = targetFieldInfos 82 | .Where(x => x.FieldType.Namespace.StartsWith("ThisOtherThing")) 83 | .Select(x => x.Name.ToString()) 84 | .ToArray(); 85 | 86 | if (obj != null) 87 | { 88 | int fieldIndex; 89 | 90 | int targetFieldIndex = GetIndexInNameArray(targetFieldNames, obj.TargetFieldName); 91 | 92 | targetFieldIndex = EditorGUILayout.Popup(targetFieldIndex, targetFieldNames); 93 | 94 | obj.TargetTypeName = targetFieldInfos[targetFieldIndex].FieldType.ToString(); 95 | obj.TargetFieldName = targetFieldNames[targetFieldIndex]; 96 | 97 | 98 | // set field data 99 | var fields = targetFieldInfos[targetFieldIndex].FieldType 100 | .GetFields (ThisOtherThing.Utils.Animation.ValueSetter.binding) // Instance methods, both public and private/protected 101 | .Where (x => !x.Name.Contains ("Adjusted")); 102 | 103 | if (obj.IsInArray) 104 | { 105 | fields = fields.Where (x => x.FieldType.IsArray); 106 | } 107 | else 108 | { 109 | fields = fields.Where (x => x.FieldType == fieldType); 110 | } 111 | 112 | 113 | fieldNames = fields 114 | .Select(x => x.Name) 115 | .ToArray(); 116 | 117 | fieldIndex = GetIndexInNameArray(fieldNames, obj.FieldName); 118 | 119 | if (fieldNames != null && fieldNames.Length > 0) 120 | { 121 | obj.FieldName = fieldNames[EditorGUILayout.Popup(fieldIndex, fieldNames)]; 122 | } 123 | 124 | if (obj.IsInArray) 125 | { 126 | FieldInfo fieldNameInfo = targetFieldInfos[targetFieldIndex].FieldType.GetField(obj.FieldName); 127 | 128 | if (fieldNameInfo == null) 129 | { 130 | serializedObject.ApplyModifiedProperties(); 131 | return; 132 | } 133 | 134 | Type arrayFieldType = fieldNameInfo.FieldType.GetElementType(); 135 | 136 | string[] arrayFieldNames = arrayFieldType 137 | .GetFields(ThisOtherThing.Utils.Animation.ValueSetter.binding) 138 | .Where (x => x.FieldType == fieldType) 139 | .Select(x => x.Name) 140 | .ToArray(); 141 | 142 | int arrayFieldIndex = GetIndexInNameArray(arrayFieldNames, obj.ArrayFieldName); 143 | 144 | if (!obj.IsInClass) 145 | { 146 | if (arrayFieldNames != null && arrayFieldNames.Length > 0) 147 | { 148 | obj.ArrayFieldName = arrayFieldNames[EditorGUILayout.Popup(arrayFieldIndex, arrayFieldNames)]; 149 | } 150 | } 151 | else 152 | { 153 | int targetClassFieldIndex = 0; 154 | 155 | var targetClassFields = arrayFieldType 156 | .GetFields(ThisOtherThing.Utils.Animation.ValueSetter.binding) 157 | .Where (x => x.FieldType.IsClass) 158 | .Where (x => x.FieldType.Namespace.StartsWith("ThisOtherThing")); 159 | 160 | string[] targetClassFieldNames = targetClassFields 161 | .Select(x => x.Name) 162 | .ToArray(); 163 | 164 | if (targetClassFieldNames.Length > 0) 165 | { 166 | targetClassFieldIndex = GetIndexInNameArray(targetClassFieldNames, obj.TargetClassFieldName); 167 | 168 | obj.TargetClassFieldName = targetClassFieldNames[EditorGUILayout.Popup(targetClassFieldIndex, targetClassFieldNames)]; 169 | 170 | var classFieldNames = arrayFieldType. 171 | GetField(obj.TargetClassFieldName, ThisOtherThing.Utils.Animation.ValueSetter.binding) 172 | .FieldType 173 | .GetFields(ThisOtherThing.Utils.Animation.ValueSetter.binding) 174 | .Where (x => x.FieldType == fieldType) 175 | .Select(x => x.Name) 176 | .ToArray(); 177 | 178 | int classFieldIndex = GetIndexInNameArray(classFieldNames, obj.ClassFieldName); 179 | 180 | if (classFieldNames.Length > 0) 181 | { 182 | obj.ClassFieldName = classFieldNames[EditorGUILayout.Popup(classFieldIndex, classFieldNames)]; 183 | } 184 | } 185 | } 186 | } 187 | else if (obj.IsInClass) 188 | { 189 | Type targetFieldType = targetFieldInfos[targetFieldIndex].FieldType; 190 | 191 | var fieldNames = targetFieldType 192 | .GetFields(ThisOtherThing.Utils.Animation.ValueSetter.binding) 193 | .Where (x => x.FieldType.IsClass) 194 | .Where (x => x.FieldType.Namespace.StartsWith("ThisOtherThing")) 195 | .Select(x => x.Name) 196 | .ToArray(); 197 | 198 | if (fieldNames.Length == 0) 199 | return; 200 | 201 | int index = GetIndexInNameArray(fieldNames, obj.TargetClassFieldName); 202 | 203 | obj.TargetClassFieldName = fieldNames[EditorGUILayout.Popup(index, fieldNames)]; 204 | 205 | fieldNames = targetFieldInfos[targetFieldIndex].FieldType 206 | .GetField(obj.TargetClassFieldName, ThisOtherThing.Utils.Animation.ValueSetter.binding) 207 | .FieldType 208 | .GetFields(ThisOtherThing.Utils.Animation.ValueSetter.binding) 209 | .Where (x => x.FieldType == fieldType) 210 | .Select(x => x.Name) 211 | .ToArray(); 212 | 213 | if (fieldNames.Length == 0) 214 | return; 215 | 216 | index = GetIndexInNameArray(fieldNames, obj.ClassFieldName); 217 | obj.ClassFieldName = fieldNames[EditorGUILayout.Popup(index, fieldNames)]; 218 | } 219 | 220 | EditorGUILayout.Space(); 221 | 222 | if (obj.FieldType == 0 || obj.FieldType == 1) 223 | { 224 | EditorGUILayout.PropertyField(floatValueProp); 225 | } 226 | else if (obj.FieldType == 2) 227 | { 228 | EditorGUILayout.PropertyField(colorValueProp); 229 | } 230 | 231 | serializedObject.ApplyModifiedProperties(); 232 | } 233 | } 234 | 235 | int GetIndexInNameArray(string[] names, string name) 236 | { 237 | try 238 | { 239 | return names 240 | .Select((v, i) => new { Name = v, Index = i }) 241 | .First(x => x.Name == name) 242 | .Index; 243 | } 244 | catch 245 | { 246 | return 0; 247 | } 248 | } 249 | } --------------------------------------------------------------------------------