├── patchnode.md ├── .vscode ├── extensions.json ├── launch.json └── settings.json ├── ProjectSettings ├── ProjectVersion.txt ├── ClusterInputManager.asset ├── PresetManager.asset ├── NetworkManager.asset ├── MultiplayerManager.asset ├── VersionControlSettings.asset ├── TimeManager.asset ├── EditorBuildSettings.asset ├── AudioManager.asset ├── EditorSettings.asset ├── VFXManager.asset ├── TagManager.asset ├── DynamicsManager.asset ├── UnityConnectSettings.asset ├── PackageManagerSettings.asset ├── Physics2DSettings.asset ├── NavMeshAreas.asset ├── GraphicsSettings.asset ├── NavMeshLayers.asset └── SceneTemplateSettings.json ├── Assets ├── DataRenderer2D │ ├── Example │ │ ├── polygon example.unity.meta │ │ ├── line animation example.unity.meta │ │ ├── drag example.unity.meta │ │ ├── Stuff │ │ │ ├── line 1.controller.meta │ │ │ ├── lineanimation.anim.meta │ │ │ ├── hole.anim.meta │ │ │ ├── hole.controller.meta │ │ │ ├── Text.controller.meta │ │ │ ├── hexagon.anim.meta │ │ │ ├── line.controller.meta │ │ │ ├── mainLine.anim.meta │ │ │ ├── textAnimator.anim.meta │ │ │ ├── BackGroundMaterial.mat.meta │ │ │ ├── UIPolygon (2).controller.meta │ │ │ ├── hole.controller │ │ │ ├── line.controller │ │ │ ├── Text.controller │ │ │ ├── UIPolygon (2).controller │ │ │ ├── line 1.controller │ │ │ └── BackGroundMaterial.mat │ │ ├── Stuff.meta │ │ ├── Symbol.prefab.meta │ │ ├── Scripts.meta │ │ └── Scripts │ │ │ ├── DragAddPoint.cs.meta │ │ │ ├── DragExample.cs.meta │ │ │ ├── MonobehaviourExtension.cs.meta │ │ │ ├── DragMove.cs.meta │ │ │ ├── ScriptScenario.cs.meta │ │ │ ├── DragExample.cs │ │ │ ├── DragMove.cs │ │ │ ├── DragAddPoint.cs │ │ │ ├── ScriptScenario.cs │ │ │ └── MonobehaviourExtension.cs │ ├── Hole │ │ ├── h.unity.meta │ │ ├── Editor.meta │ │ ├── HoleInfo.cs.meta │ │ ├── UIHole.cs.meta │ │ ├── HoleDrawer.cs.meta │ │ ├── Editor │ │ │ ├── HoleEditor.cs.meta │ │ │ ├── MenuExtender.cs.meta │ │ │ ├── HoleEditor.cs │ │ │ └── MenuExtender.cs │ │ ├── UIHole.cs │ │ └── HoleInfo.cs │ ├── Readme.txt.meta │ ├── Core.meta │ ├── Hole.meta │ ├── Signal.meta │ ├── Line │ │ ├── Editor.meta │ │ ├── Scripts.meta │ │ ├── Editor │ │ │ ├── Test.meta │ │ │ ├── EditorSetting.asset.meta │ │ │ ├── LineEditor.cs.meta │ │ │ ├── EditorSetting.cs.meta │ │ │ ├── MenuExtender.cs.meta │ │ │ ├── PointHandler.cs.meta │ │ │ ├── UILineEditor.cs.meta │ │ │ ├── LineInpectorHandler.cs.meta │ │ │ ├── PointPropertyDrawer.cs.meta │ │ │ ├── SplinePropertyDrawer.cs.meta │ │ │ ├── Test │ │ │ │ ├── BezierLengthTest.cs.meta │ │ │ │ ├── MeshDataTest.cs.meta │ │ │ │ ├── MeshDataTest.cs │ │ │ │ └── BezierLengthTest.cs │ │ │ ├── EditorSetting.asset │ │ │ ├── LineInpectorHandler.cs │ │ │ ├── EditorSetting.cs │ │ │ ├── UILineEditor.cs │ │ │ ├── LineEditor.cs │ │ │ ├── MenuExtender.cs │ │ │ ├── SplinePropertyDrawer.cs │ │ │ └── PointPropertyDrawer.cs │ │ └── Scripts │ │ │ ├── Data.meta │ │ │ ├── Component.meta │ │ │ ├── Process.meta │ │ │ ├── Process │ │ │ ├── Static.meta │ │ │ ├── MeshBuilder.meta │ │ │ ├── Static │ │ │ │ ├── Curve.cs.meta │ │ │ │ ├── CurveLength.cs.meta │ │ │ │ ├── CurveLength.cs │ │ │ │ └── Curve.cs │ │ │ └── MeshBuilder │ │ │ │ ├── InterfaceDraw.cs.meta │ │ │ │ ├── LineBuilder.cs.meta │ │ │ │ ├── RoundCapDrawer.cs.meta │ │ │ │ ├── IntersectJointDrawer.cs.meta │ │ │ │ ├── NormalBezierDrawer.cs.meta │ │ │ │ ├── NormalJointDrawer.cs.meta │ │ │ │ ├── InterfaceDraw.cs │ │ │ │ ├── NormalJointDrawer.cs │ │ │ │ ├── RoundCapDrawer.cs │ │ │ │ ├── NormalBezierDrawer.cs │ │ │ │ ├── LineBuilder.cs │ │ │ │ └── IntersectJointDrawer.cs │ │ │ ├── Data │ │ │ ├── Line.cs.meta │ │ │ ├── Point.cs.meta │ │ │ ├── ISpline.cs.meta │ │ │ ├── Line.Editor.cs.meta │ │ │ ├── Line.Pair.cs.meta │ │ │ ├── LineOption.cs.meta │ │ │ ├── Line.Triple.cs.meta │ │ │ ├── ISpline.cs │ │ │ ├── LineOption.cs │ │ │ ├── Point.cs │ │ │ ├── Line.Editor.cs │ │ │ ├── Line.Triple.cs │ │ │ └── Line.Pair.cs │ │ │ └── Component │ │ │ ├── GizmoLine.cs.meta │ │ │ ├── UILine.cs.meta │ │ │ ├── WorldLine.cs.meta │ │ │ ├── WorldLine.cs │ │ │ ├── UILine.cs │ │ │ └── GizmoLine.cs │ ├── Polygon │ │ ├── Editor.meta │ │ ├── Scripts.meta │ │ ├── Scripts │ │ │ ├── Component.meta │ │ │ ├── Drawer.meta │ │ │ ├── PolygonData.cs.meta │ │ │ ├── CircleCalculator.cs.meta │ │ │ ├── PolygonFactory.cs.meta │ │ │ ├── Component │ │ │ │ ├── UIPolygon.cs.meta │ │ │ │ ├── WorldPolygon.cs.meta │ │ │ │ ├── WorldPolygon.cs │ │ │ │ └── UIPolygon.cs │ │ │ ├── Drawer │ │ │ │ ├── HolePolygon.cs.meta │ │ │ │ ├── ZigZagPolygon.cs.meta │ │ │ │ ├── ZigZagPolygon.cs │ │ │ │ └── HolePolygon.cs │ │ │ ├── PolygonDrawManager.cs.meta │ │ │ ├── PolygonFactory.cs │ │ │ ├── PolygonDrawManager.cs │ │ │ ├── PolygonData.cs │ │ │ └── CircleCalculator.cs │ │ └── Editor │ │ │ ├── PolygonEditor.cs.meta │ │ │ ├── MeneExtender.cs.meta │ │ │ ├── PolygonPropertyDrawer.cs.meta │ │ │ ├── PolygonEditor.cs │ │ │ ├── MeneExtender.cs │ │ │ └── PolygonPropertyDrawer.cs │ ├── Line.meta │ ├── Example.meta │ ├── Signal │ │ ├── Editor.meta │ │ ├── Scripts.meta │ │ ├── Scripts │ │ │ ├── Builder.meta │ │ │ ├── Component.meta │ │ │ ├── Component │ │ │ │ ├── UISignal.cs.meta │ │ │ │ └── UISignal.cs │ │ │ ├── Signal.cs.meta │ │ │ ├── Builder │ │ │ │ ├── SignalBuilder.cs.meta │ │ │ │ └── SignalBuilder.cs │ │ │ └── Signal.cs │ │ └── Editor │ │ │ ├── MenuExtender.cs.meta │ │ │ └── MenuExtender.cs │ ├── Polygon.meta │ ├── Core │ │ ├── Vertex.cs.meta │ │ ├── UIDataMesh.cs.meta │ │ ├── WorldDataMesh.cs.meta │ │ ├── Quad.cs.meta │ │ ├── Interfaces.cs.meta │ │ ├── MeshMath.cs.meta │ │ ├── Triangle.cs.meta │ │ ├── Interfaces.cs │ │ ├── Vertex.cs │ │ ├── Triangle.cs │ │ ├── Quad.cs │ │ ├── UIDataMesh.cs │ │ ├── MeshMath.cs │ │ └── WorldDataMesh.cs │ └── Readme.txt └── DataRenderer2D.meta ├── UserSettings ├── Search.index ├── EditorUserSettings.asset └── Search.settings ├── .gitattributes ├── LICENSE ├── Packages └── manifest.json ├── .gitignore └── README.md /patchnode.md: -------------------------------------------------------------------------------- 1 | # Patch note 2 | -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "visualstudiotoolsforunity.vstuc" 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 6000.0.10f1 2 | m_EditorVersionWithRevision: 6000.0.10f1 (413673acabac) 3 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/MultiplayerManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!655991488 &1 4 | MultiplayerManager: 5 | m_ObjectHideFlags: 0 6 | m_EnableMultiplayerRoles: 0 7 | m_StrippingTypes: {} 8 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "configurations": [ 4 | { 5 | "name": "Attach to Unity", 6 | "type": "vstuc", 7 | "request": "attach" 8 | } 9 | ] 10 | } -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Example/polygon example.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 10ed087f85f9a594eb65b36dbd084eb9 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Example/line animation example.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e4023a6bcd761e0408a5af15c7d8cbd3 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Hole/h.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4a298da31ecfecf45a825c54242f0956 3 | timeCreated: 1529568020 4 | licenseType: Free 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Readme.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 94552a4af761a9c44b6a8b7061dfbb57 3 | timeCreated: 1517440545 4 | licenseType: Free 5 | TextScriptImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /ProjectSettings/VersionControlSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!890905787 &1 4 | VersionControlSettings: 5 | m_ObjectHideFlags: 0 6 | m_Mode: Visible Meta Files 7 | m_TrackPackagesOutsideProject: 0 8 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Example/drag example.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 243440f4e988ad848a500187312e2370 3 | timeCreated: 1537460845 4 | licenseType: Free 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8bdc56e55096e9b4eb6482e0b5e41507 3 | folderAsset: yes 4 | timeCreated: 1511796429 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Core.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 62ce5cfc77f163e47840fc6d45e822c3 3 | folderAsset: yes 4 | timeCreated: 1511797354 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Hole.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 20c59a69139f6f8409fbe79801f5bf74 3 | folderAsset: yes 4 | timeCreated: 1529381882 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Signal.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 740c565b18f8db04b88b92643ddb1ce7 3 | folderAsset: yes 4 | timeCreated: 1520546020 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Example/Stuff/line 1.controller.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: aaaf5782477e0264388e35e44d567968 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 9100000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Hole/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 93222a15affe11c44ae58e45ea382d81 3 | folderAsset: yes 4 | timeCreated: 1529383112 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Line/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6ee0dd6598a7a5547879a577507db4b0 3 | folderAsset: yes 4 | timeCreated: 1506700826 5 | licenseType: Store 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Line/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f5fb7b44cadd4b3428e97182356572ee 3 | folderAsset: yes 4 | timeCreated: 1506700821 5 | licenseType: Store 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Example/Stuff.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 953580d758c2f2646bb051470c249d05 3 | folderAsset: yes 4 | timeCreated: 1509684945 5 | licenseType: Store 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Example/Stuff/lineanimation.anim.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a59bbd11a13f2e54fa46f80d7f53890e 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 7400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Line/Editor/Test.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3bc0c909aa0678f45ad719016c5e43e6 3 | folderAsset: yes 4 | timeCreated: 1507100818 5 | licenseType: Store 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Line/Scripts/Data.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 45e17d57a0f5b8147b90fe0dffc4d98b 3 | folderAsset: yes 4 | timeCreated: 1506705358 5 | licenseType: Store 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Polygon/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d6d1403d631736043ac0cb86dcf71f9f 3 | folderAsset: yes 4 | timeCreated: 1510068945 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Polygon/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: aca437dcb698a6141a100fd7ff7f4e20 3 | folderAsset: yes 4 | timeCreated: 1510130882 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /ProjectSettings/TimeManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!5 &1 4 | TimeManager: 5 | m_ObjectHideFlags: 0 6 | Fixed Timestep: 0.02 7 | Maximum Allowed Timestep: 0.33333334 8 | m_TimeScale: 1 9 | Maximum Particle Timestep: 0.03 10 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Line/Scripts/Component.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1d4d9c7cd551dda41aeea4c0ae9b2bf4 3 | folderAsset: yes 4 | timeCreated: 1506705366 5 | licenseType: Store 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Line/Scripts/Process.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c8839e2f9e6db024f85eab9573eca3db 3 | folderAsset: yes 4 | timeCreated: 1506908148 5 | licenseType: Store 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Line/Scripts/Process/Static.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 451f6ed68a01b154d859f53c75d85952 3 | folderAsset: yes 4 | timeCreated: 1507629603 5 | licenseType: Store 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Example/Symbol.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 00d55dac87eea5442912ed1ab8cd50f7 3 | timeCreated: 1531209775 4 | licenseType: Free 5 | NativeFormatImporter: 6 | mainObjectFileID: -1 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Line.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1ea0f86c85663484ead60cfff6c83cf1 3 | folderAsset: yes 4 | timeCreated: 1522155297 5 | licenseType: Free 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Line/Scripts/Process/MeshBuilder.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 51226f1d5d6e0e84ca335db372786ce2 3 | folderAsset: yes 4 | timeCreated: 1507411140 5 | licenseType: Store 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Example.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7115f75ea55ee10448fe4a2528e0160b 3 | folderAsset: yes 4 | timeCreated: 1522153619 5 | licenseType: Free 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Example/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e95a2cda9df966f42a92f723efc05f8a 3 | folderAsset: yes 4 | timeCreated: 1522156131 5 | licenseType: Free 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Example/Stuff/hole.anim.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0e295b52ad9e635459cfdd0164eaf43f 3 | timeCreated: 1529568561 4 | licenseType: Free 5 | NativeFormatImporter: 6 | mainObjectFileID: 7400000 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Signal/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f347ee05062cb2a46b6cfe8b1a25b693 3 | folderAsset: yes 4 | timeCreated: 1522333780 5 | licenseType: Free 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Signal/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cca7cf87b24082d4a83fe50f9a5d6b93 3 | folderAsset: yes 4 | timeCreated: 1522245710 5 | licenseType: Free 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Example/Stuff/hole.controller.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 11298fbfb445e504da2e899801197301 3 | timeCreated: 1529568561 4 | licenseType: Free 5 | NativeFormatImporter: 6 | mainObjectFileID: 9100000 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Line/Editor/EditorSetting.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 904c5170da217d4488942684ba606842 3 | timeCreated: 1508810855 4 | licenseType: Store 5 | NativeFormatImporter: 6 | mainObjectFileID: 11400000 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Polygon/Scripts/Component.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a2da1ba0873816748b25126ecba7e11f 3 | folderAsset: yes 4 | timeCreated: 1514842056 5 | licenseType: Free 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Polygon/Scripts/Drawer.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fb29fc6d221907449b16c80d81acfd7e 3 | folderAsset: yes 4 | timeCreated: 1514499727 5 | licenseType: Free 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Signal/Scripts/Builder.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f8f79f89146d89a44bffe9ade5e04b2b 3 | folderAsset: yes 4 | timeCreated: 1522146496 5 | licenseType: Free 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Signal/Scripts/Component.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4132f369a6a5a404c91a1d2b781f8f5a 3 | folderAsset: yes 4 | timeCreated: 1522248563 5 | licenseType: Free 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Polygon.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0e2acb59b89d09649b96a3f553060aa6 3 | labels: 4 | - Polygon 5 | folderAsset: yes 6 | timeCreated: 1510062596 7 | licenseType: Free 8 | DefaultImporter: 9 | externalObjects: {} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Example/Stuff/Text.controller.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c4f0841ec9146ec4aa2545daf94267e7 3 | timeCreated: 1522005351 4 | licenseType: Free 5 | NativeFormatImporter: 6 | externalObjects: {} 7 | mainObjectFileID: 9100000 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Example/Stuff/hexagon.anim.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6b0be7fd7ead6894c96970b7e6ad552d 3 | timeCreated: 1522248419 4 | licenseType: Free 5 | NativeFormatImporter: 6 | externalObjects: {} 7 | mainObjectFileID: 7400000 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Example/Stuff/line.controller.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 88870f690bc2e934f8a551fc924a34f9 3 | timeCreated: 1522154502 4 | licenseType: Free 5 | NativeFormatImporter: 6 | externalObjects: {} 7 | mainObjectFileID: 9100000 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Example/Stuff/mainLine.anim.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5498f4d2c285c3647b840b2bb7ff45d8 3 | timeCreated: 1522154502 4 | licenseType: Free 5 | NativeFormatImporter: 6 | externalObjects: {} 7 | mainObjectFileID: 7400000 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Example/Stuff/textAnimator.anim.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1bfb7c6e3d7abc94aabd2c03a48effab 3 | timeCreated: 1522005351 4 | licenseType: Free 5 | NativeFormatImporter: 6 | externalObjects: {} 7 | mainObjectFileID: 7400000 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Example/Stuff/BackGroundMaterial.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 051f21edbe7d811419c4fe77e327b0c0 3 | timeCreated: 1522147457 4 | licenseType: Free 5 | NativeFormatImporter: 6 | externalObjects: {} 7 | mainObjectFileID: 2100000 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Example/Stuff/UIPolygon (2).controller.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b1f532f616aa62b4a9bdd3ecec4337bc 3 | timeCreated: 1522248419 4 | licenseType: Free 5 | NativeFormatImporter: 6 | externalObjects: {} 7 | mainObjectFileID: 9100000 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /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 | - enabled: 1 9 | path: Assets/DataRenderer2D/Example/ExampleScene.unity 10 | guid: b86361717004f9e4a9a3836a38c25354 11 | -------------------------------------------------------------------------------- /UserSettings/Search.index: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Assets", 3 | "roots": ["Assets"], 4 | "includes": [], 5 | "excludes": ["Assets/Temp/", "Assets/External/"], 6 | "options": { 7 | "types": true, 8 | "properties": true, 9 | "extended": false, 10 | "dependencies": true 11 | }, 12 | "baseScore": 999 13 | } -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Core/Vertex.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1a500e117a559a641ac4a1a1018530a2 3 | timeCreated: 1506909730 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Hole/HoleInfo.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a7bd61527dd448241914f1386fc534ff 3 | timeCreated: 1529381906 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Hole/UIHole.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d6de8c7c3477a0f4b8ec587e457d22ad 3 | timeCreated: 1529382437 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Core/UIDataMesh.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ce4c0c38d79a3674486b7c1ab771ebd0 3 | timeCreated: 1512264772 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Core/WorldDataMesh.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d28e296610fec0a478d8d51766aebf18 3 | timeCreated: 1512265066 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Hole/HoleDrawer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c8d43b5f1163c7a4496fd71bfdf146de 3 | timeCreated: 1529383252 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Hole/Editor/HoleEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dcc3fac7c3eb3144f86f8f974f0daa45 3 | timeCreated: 1529516437 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Hole/Editor/MenuExtender.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ee7b670e1f2e6ab42a2530fc6bf4d7cf 3 | timeCreated: 1529383118 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Line/Editor/LineEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 88ec1c6b5b9a9774190bda6b9cb0e06e 3 | timeCreated: 1506785629 4 | licenseType: Store 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Line/Scripts/Data/Line.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: db575d30e83da214d9283eef0106907d 3 | timeCreated: 1506701827 4 | licenseType: Store 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Line/Scripts/Data/Point.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5efe5373db670dd44826e925f45cd388 3 | timeCreated: 1506701502 4 | licenseType: Store 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Example/Scripts/DragAddPoint.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 501de143b53ccaf44966e0845aa92c84 3 | timeCreated: 1537460929 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Example/Scripts/DragExample.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3dda7ccec462705469348ccbb7f93523 3 | timeCreated: 1537452373 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Line/Editor/EditorSetting.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 30943c56159c82343b070cad006f5ad8 3 | timeCreated: 1508810779 4 | licenseType: Store 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Line/Editor/MenuExtender.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a5000318cfdea4b48829180af0b5d2ea 3 | timeCreated: 1507623973 4 | licenseType: Store 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Line/Editor/PointHandler.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a2ccbb4662219f44ca150e383f092b66 3 | timeCreated: 1506911731 4 | licenseType: Store 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Line/Editor/UILineEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a688cfc497760ad458c0c92f3ad6bbe7 3 | timeCreated: 1515342506 4 | licenseType: Store 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Line/Scripts/Data/ISpline.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f91dd9d5a72a9124687b7082e93a5067 3 | timeCreated: 1507664992 4 | licenseType: Store 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Line/Scripts/Data/Line.Editor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: efa9284c9306ff3468c60d6c21a8c563 3 | timeCreated: 1521785563 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Line/Scripts/Data/Line.Pair.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 306850e3d17932b4c94a663a76efb410 3 | timeCreated: 1507505008 4 | licenseType: Store 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Line/Scripts/Data/LineOption.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f96cdaaec92bab445ba719256cdd2d12 3 | timeCreated: 1508802911 4 | licenseType: Store 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Polygon/Editor/PolygonEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 88a928d10dbc8c249ac8071a23e86747 3 | timeCreated: 1510068954 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Polygon/Scripts/PolygonData.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 084eeb3308c73da4b87ea4e19dc88057 3 | timeCreated: 1510214863 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Line/Editor/LineInpectorHandler.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 208935ff53b11dd4fbc618a478b1e83b 3 | timeCreated: 1508814955 4 | licenseType: Store 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Line/Editor/PointPropertyDrawer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3880ef2814249e643b996c76a474e945 3 | timeCreated: 1507947783 4 | licenseType: Store 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Line/Editor/SplinePropertyDrawer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dc44df45daf42e64a8abe4242e06145e 3 | timeCreated: 1515363364 4 | licenseType: Store 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Line/Editor/Test/BezierLengthTest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0d982e4f55729554b8d41c6ec24bc78f 3 | timeCreated: 1507100806 4 | licenseType: Store 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Line/Editor/Test/MeshDataTest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a5764dbee5b83444183479836515be75 3 | timeCreated: 1507401525 4 | licenseType: Store 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Line/Scripts/Component/GizmoLine.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 671416d9c558e56428a918a932d3e442 3 | timeCreated: 1507008461 4 | licenseType: Store 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Line/Scripts/Component/UILine.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 58bf958ce20785440b0449396397bfcc 3 | timeCreated: 1506701959 4 | licenseType: Store 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Line/Scripts/Component/WorldLine.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d2173be6ee493314f9d0941bc9dbf73e 3 | timeCreated: 1506705387 4 | licenseType: Store 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Line/Scripts/Data/Line.Triple.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c23a879443309d74d9fa0a4138a30195 3 | timeCreated: 1507505347 4 | licenseType: Store 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Line/Scripts/Process/Static/Curve.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8ec75c6fbda9ab04e9e1e50ae8c9777d 3 | timeCreated: 1506908170 4 | licenseType: Store 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Polygon/Scripts/CircleCalculator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3548610613b050940a2a1d959d274004 3 | timeCreated: 1510423976 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Signal/Scripts/Component/UISignal.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c798b9324ba603a4d830f5ba78368d4c 3 | timeCreated: 1520546039 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Core/Quad.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 31a9f36a71553724eafbdb93a0ba47cb 3 | timeCreated: 1514066885 4 | licenseType: Free 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Example/Scripts/MonobehaviourExtension.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ef3a8bfa44bdc744f89b61009f628ce7 3 | timeCreated: 1509865867 4 | licenseType: Store 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Core/Interfaces.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 57b055556df452c488cab2e63adbca38 3 | timeCreated: 1513724647 4 | licenseType: Free 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Core/MeshMath.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 50a47abd1c9a989489401a5f63cdfb24 3 | timeCreated: 1515090004 4 | licenseType: Free 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Core/Triangle.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3c41f9c430a0b894980fb6c7b91edbe0 3 | timeCreated: 1514067422 4 | licenseType: Free 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Line/Scripts/Data/ISpline.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace geniikw.DataRenderer2D 6 | { 7 | public interface ISpline 8 | { 9 | Spline Line { get; } 10 | } 11 | 12 | public interface ISplineOption 13 | { 14 | LineOption Option { get; } 15 | } 16 | } -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Line/Scripts/Process/Static/CurveLength.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 09889cdc47060fd498444dd2aea4ef3b 3 | timeCreated: 1507106190 4 | licenseType: Store 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Line/Scripts/Process/MeshBuilder/InterfaceDraw.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a2625741e986094458e44b5994c662f3 3 | timeCreated: 1507229162 4 | licenseType: Store 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Line/Scripts/Process/MeshBuilder/LineBuilder.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2bd6cf4934407724f9d35dd32fbe5066 3 | timeCreated: 1507229423 4 | licenseType: Store 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Line/Scripts/Process/MeshBuilder/RoundCapDrawer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 51b8fb77b160c4644a4a796664bd3df9 3 | timeCreated: 1507659613 4 | licenseType: Store 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Signal/Scripts/Signal.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2191f1c1fda324d4d9db66503ffe5824 3 | timeCreated: 1522248602 4 | licenseType: Free 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Example/Scripts/DragMove.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e2890b1f2588521469219cdc348e4fe8 3 | timeCreated: 1522210687 4 | licenseType: Free 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Line/Scripts/Process/MeshBuilder/IntersectJointDrawer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 68ef68029efe4234fbb52f59a1b43226 3 | timeCreated: 1515360830 4 | licenseType: Store 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Line/Scripts/Process/MeshBuilder/NormalBezierDrawer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 24a2d01dc61fdb64b80ab01678aaf227 3 | timeCreated: 1507411428 4 | licenseType: Store 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Line/Scripts/Process/MeshBuilder/NormalJointDrawer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c6b6383b7e11d73459f3f33d827fb5b7 3 | timeCreated: 1507507135 4 | licenseType: Store 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Polygon/Editor/MeneExtender.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3b894fd03811f2b4784897f6865aed88 3 | timeCreated: 1515153615 4 | licenseType: Free 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Signal/Editor/MenuExtender.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9bc1a596bc0a1d840a4116077f852ba2 3 | timeCreated: 1522336032 4 | licenseType: Free 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Example/Scripts/ScriptScenario.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 157801cb93b14c4419ecaf1ef88c93c6 3 | timeCreated: 1522183327 4 | licenseType: Free 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Polygon/Scripts/PolygonFactory.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 86513b113009e89458949a14bdfbf724 3 | timeCreated: 1514842183 4 | licenseType: Free 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Polygon/Editor/PolygonPropertyDrawer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d2d55f79c5a27be42b01dbda90887b8e 3 | timeCreated: 1515153603 4 | licenseType: Free 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Polygon/Scripts/Component/UIPolygon.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a9d8ffd304d903143b0934836459c597 3 | timeCreated: 1514255179 4 | licenseType: Free 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Polygon/Scripts/Drawer/HolePolygon.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 50d0bf27255406246b435874f437615e 3 | timeCreated: 1515036724 4 | licenseType: Free 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Polygon/Scripts/Drawer/ZigZagPolygon.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3f8f3660bcf9108428c87b43cccaa4c6 3 | timeCreated: 1514507229 4 | licenseType: Free 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Polygon/Scripts/PolygonDrawManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7b78a23fc939e8b4fbfe550d8e1eb02e 3 | timeCreated: 1514263756 4 | licenseType: Free 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Signal/Scripts/Builder/SignalBuilder.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: af3f7bc68728b9947b3b8c120a38a9f0 3 | timeCreated: 1522250763 4 | licenseType: Free 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Polygon/Scripts/Component/WorldPolygon.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 26f623508a915d64da6d4f43268e3f6f 3 | timeCreated: 1514842106 4 | licenseType: Free 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /ProjectSettings/AudioManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!11 &1 4 | AudioManager: 5 | m_ObjectHideFlags: 0 6 | m_Volume: 1 7 | Rolloff Scale: 1 8 | Doppler Factor: 1 9 | Default Speaker Mode: 2 10 | m_SampleRate: 0 11 | m_DSPBufferSize: 0 12 | m_VirtualVoiceCount: 512 13 | m_RealVoiceCount: 32 14 | m_SpatializerPlugin: 15 | m_AmbisonicDecoderPlugin: 16 | m_DisableAudio: 0 17 | m_VirtualizeEffects: 1 18 | -------------------------------------------------------------------------------- /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: 4 7 | m_ExternalVersionControlSupport: Visible Meta Files 8 | m_SerializationMode: 2 9 | m_DefaultBehaviorMode: 1 10 | m_SpritePackerMode: 4 11 | m_SpritePackerPaddingPower: 1 12 | m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd 13 | m_ProjectGenerationRootNamespace: 14 | m_UserGeneratedProjectSuffix: 15 | m_CollabEditorSettings: 16 | inProgressEnabled: 1 17 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Core/Interfaces.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEngine.EventSystems; 5 | 6 | namespace geniikw.DataRenderer2D 7 | { 8 | public interface IUnitSize 9 | { 10 | Vector2 Size { get; } 11 | } 12 | 13 | public interface IMesh 14 | { 15 | IEnumerable Vertices { get; } 16 | IEnumerable Triangles { get; } 17 | } 18 | 19 | public interface IMeshDrawer 20 | { 21 | IEnumerable Draw(); 22 | } 23 | } -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | *.sln merge=union 7 | *.csproj merge=union 8 | *.vbproj merge=union 9 | *.fsproj merge=union 10 | *.dbproj merge=union 11 | 12 | # Standard to msysgit 13 | *.doc diff=astextplain 14 | *.DOC diff=astextplain 15 | *.docx diff=astextplain 16 | *.DOCX diff=astextplain 17 | *.dot diff=astextplain 18 | *.DOT diff=astextplain 19 | *.pdf diff=astextplain 20 | *.PDF diff=astextplain 21 | *.rtf diff=astextplain 22 | *.RTF diff=astextplain 23 | -------------------------------------------------------------------------------- /ProjectSettings/VFXManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!937362698 &1 4 | VFXManager: 5 | m_ObjectHideFlags: 0 6 | m_IndirectShader: {fileID: 0} 7 | m_CopyBufferShader: {fileID: 0} 8 | m_SortShader: {fileID: 0} 9 | m_StripUpdateShader: {fileID: 0} 10 | m_EmptyShader: {fileID: 0} 11 | m_RenderPipeSettingsPath: 12 | m_FixedTimeStep: 0.016666668 13 | m_MaxDeltaTime: 0.05 14 | m_MaxScrubTime: 30 15 | m_MaxCapacity: 100000000 16 | m_CompiledVersion: 0 17 | m_RuntimeVersion: 0 18 | m_RuntimeResources: {fileID: 0} 19 | m_BatchEmptyLifetime: 300 20 | -------------------------------------------------------------------------------- /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/DataRenderer2D/Line/Scripts/Process/MeshBuilder/InterfaceDraw.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace geniikw.DataRenderer2D { 6 | 7 | public interface IJointBuilder 8 | { 9 | IEnumerable Build(Spline.Triple triple); 10 | } 11 | 12 | public interface IBezierBuilder 13 | { 14 | IEnumerable Build(Spline.LinePair pair); 15 | } 16 | 17 | public interface ICapBuilder 18 | { 19 | IEnumerable Build(Spline.LinePair pair, bool isEnd); 20 | } 21 | 22 | 23 | } -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Line/Editor/EditorSetting.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_PrefabParentObject: {fileID: 0} 7 | m_PrefabInternal: {fileID: 0} 8 | m_GameObject: {fileID: 0} 9 | m_Enabled: 1 10 | m_EditorHideFlags: 0 11 | m_Script: {fileID: 11500000, guid: 30943c56159c82343b070cad006f5ad8, type: 3} 12 | m_Name: EditorSetting 13 | m_EditorClassIdentifier: 14 | onlyViewWidth: 0 15 | PS: 16 | AddButtonSize: 1 17 | DeleteButtonSize: 1 18 | AddButtonDistance: 10 19 | AddInitialDistance: 5 20 | DeleteButtonDistance: 20 21 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Polygon/Scripts/PolygonFactory.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace geniikw.DataRenderer2D.Polygon { 6 | public static class PolygonFactory { 7 | 8 | public static IEnumerable Create(IUnitSize unit, IPolygon target) 9 | { 10 | var circle = new CircleCalculator(target, unit); 11 | var normal = new ZigZagPolygon(circle, target); 12 | var hole = new HolePolygon(circle, target); 13 | var manager = new PolygonDrawerManager(target, normal, hole); 14 | return manager.Draw(); 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Readme.txt: -------------------------------------------------------------------------------- 1 | creator 2 | Kim giwon (https://github.com/geniikw) ,(geniikw@gmail.com) 3 | 4 | This asset include these menu. 5 | 6 | ## line 7 | 1.GameObject/2D Object/DataRenderer/WorldLine 8 | 2.GameObject/2D Object/DataRenderer/UILine 9 | 3.GameObject/2D Object/DataRenderer/GizmoLine 10 | 11 | ## polygon 12 | 1.GameObject/2D Object/DataRenderer/WorldPolygon 13 | 2.GameObject/2D Object/DataRenderer/UIPolygon 14 | *Canvas must be in the upper transform of UIPolygon. 15 | 16 | ## sin 17 | 1. GameObject/2D Object/DataRenderer/UISignal 18 | 19 | ## hole 20 | 1. GameObject/2D Object/DataRenderer/UIHole 21 | 22 | * Components that start with 'UI' must be children of Canvas. 23 | 24 | ## reference 25 | https://github.com/HTD/FastBezier 26 | https://en.wikipedia.org/wiki/Bezier_curve -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Hole/Editor/HoleEditor.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEditor; 5 | using UnityEditor.UI; 6 | namespace geniikw.DataRenderer2D.Hole 7 | { 8 | [CustomEditor(typeof(UIHole), true)] 9 | public class HoleEditor : ImageEditor 10 | { 11 | SerializedProperty m_holeInfo; 12 | 13 | protected override void OnEnable() 14 | { 15 | base.OnEnable(); 16 | m_holeInfo = serializedObject.FindProperty("hole"); 17 | } 18 | 19 | 20 | public override void OnInspectorGUI() 21 | { 22 | EditorGUILayout.PropertyField(m_holeInfo,true); 23 | serializedObject.ApplyModifiedProperties(); 24 | base.OnInspectorGUI(); 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Core/Vertex.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace geniikw.DataRenderer2D 6 | { 7 | public struct Vertex 8 | { 9 | public Vector3 position; 10 | public Vector2 uv; 11 | public Color color; 12 | 13 | public Vertex(Vector3 pos, Vector2 u, Color c) 14 | { 15 | position = pos; 16 | uv = u; 17 | color = c; 18 | } 19 | public static Vertex New(Vector3 pos, Vector2 uv, Color color) 20 | { 21 | return new Vertex(pos, uv, color); 22 | } 23 | public static Vertex New(float x, float y, float z, float u, float v, Color color) 24 | { 25 | return new Vertex(new Vector3(x,y,z), new Vector2(u,v), color); 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Example/Scripts/DragExample.cs: -------------------------------------------------------------------------------- 1 | using geniikw.DataRenderer2D; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using UnityEngine; 5 | 6 | namespace geniikw.DataRenderer2D.Example 7 | { 8 | 9 | public class DragExample : MonoBehaviour 10 | { 11 | 12 | public UILine line; 13 | public Gradient grad; 14 | public Gradient red; 15 | private bool isGrad = false; 16 | 17 | public void Clear() 18 | { 19 | line.line.Clear(); 20 | 21 | } 22 | 23 | public void ColorToggle() 24 | { 25 | if (isGrad) 26 | line.line.option.color = grad; 27 | else 28 | line.line.option.color = red; 29 | isGrad = !isGrad; 30 | 31 | line.GeometyUpdateFlagUp(); 32 | } 33 | 34 | } 35 | } -------------------------------------------------------------------------------- /ProjectSettings/DynamicsManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!55 &1 4 | PhysicsManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 3 7 | m_Gravity: {x: 0, y: -9.81, z: 0} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_BounceThreshold: 2 10 | m_SleepThreshold: 0.005 11 | m_DefaultContactOffset: 0.01 12 | m_DefaultSolverIterations: 6 13 | m_DefaultSolverVelocityIterations: 1 14 | m_QueriesHitBackfaces: 0 15 | m_QueriesHitTriggers: 1 16 | m_EnableAdaptiveForce: 0 17 | m_EnablePCM: 1 18 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 19 | m_AutoSimulation: 1 20 | m_AutoSyncTransforms: 1 21 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Polygon/Scripts/Component/WorldPolygon.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace geniikw.DataRenderer2D.Polygon 6 | { 7 | public class WorldPolygon : WorldDataMesh, IPolygon, IUnitSize 8 | { 9 | public PolygonData data; 10 | 11 | public Vector2 Size 12 | { 13 | get 14 | { 15 | return Vector2.one ; 16 | } 17 | } 18 | 19 | public PolygonData Polygon 20 | { 21 | get 22 | { 23 | return data; 24 | } 25 | } 26 | 27 | protected override IEnumerable MeshFactory 28 | { 29 | get 30 | { 31 | return PolygonFactory.Create(this, this); 32 | } 33 | } 34 | 35 | } 36 | } -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Polygon/Editor/PolygonEditor.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEditor; 5 | using UnityEditor.UI; 6 | 7 | namespace geniikw.DataRenderer2D.Polygon.Editors 8 | { 9 | [CustomEditor(typeof(UIPolygon))] 10 | public class PolygonEditor : ImageEditor 11 | { 12 | private SerializedProperty m_data; 13 | 14 | protected override void OnEnable() 15 | { 16 | base.OnEnable(); 17 | m_data = serializedObject.FindProperty("data"); 18 | 19 | } 20 | public override void OnInspectorGUI() 21 | { 22 | base.OnInspectorGUI(); 23 | 24 | serializedObject.Update(); 25 | EditorGUILayout.PropertyField(m_data, true); 26 | 27 | serializedObject.ApplyModifiedProperties(); 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /ProjectSettings/UnityConnectSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!310 &1 4 | UnityConnectSettings: 5 | m_ObjectHideFlags: 0 6 | m_Enabled: 0 7 | m_TestMode: 0 8 | m_TestEventUrl: 9 | m_TestConfigUrl: 10 | m_TestInitMode: 0 11 | CrashReportingSettings: 12 | m_EventUrl: https://perf-events.cloud.unity3d.com/api/events/crashes 13 | m_Enabled: 0 14 | m_CaptureEditorExceptions: 1 15 | UnityPurchasingSettings: 16 | m_Enabled: 0 17 | m_TestMode: 0 18 | UnityAnalyticsSettings: 19 | m_Enabled: 0 20 | m_InitializeOnStartup: 1 21 | m_TestMode: 0 22 | m_TestEventUrl: 23 | m_TestConfigUrl: 24 | UnityAdsSettings: 25 | m_Enabled: 0 26 | m_InitializeOnStartup: 1 27 | m_TestMode: 0 28 | m_EnabledPlatforms: 4294967295 29 | m_IosGameId: 30 | m_AndroidGameId: 31 | PerformanceReportingSettings: 32 | m_Enabled: 0 33 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Polygon/Scripts/Component/UIPolygon.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace geniikw.DataRenderer2D.Polygon 6 | { 7 | public class UIPolygon : UIDataMesh, IPolygon, IUnitSize 8 | { 9 | public PolygonData data; 10 | 11 | public PolygonData Polygon 12 | { 13 | get 14 | { 15 | return data; 16 | } 17 | } 18 | 19 | public Vector2 Size 20 | { 21 | get 22 | { 23 | return new Vector2(rectTransform.rect.width , rectTransform.rect.height); 24 | } 25 | } 26 | 27 | protected override IEnumerable DrawerFactory 28 | { 29 | get 30 | { 31 | return PolygonFactory.Create(this,this); 32 | } 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Line/Editor/Test/MeshDataTest.cs: -------------------------------------------------------------------------------- 1 | #if TEST_ENABLE 2 | using UnityEngine; 3 | using UnityEditor; 4 | using UnityEngine.TestTools; 5 | using NUnit.Framework; 6 | using System.Collections; 7 | using System.Collections.Generic; 8 | using System.Linq; 9 | 10 | namespace geniikw.UIMeshLab.Test 11 | { 12 | 13 | public class MeshDataTest { 14 | 15 | [Test] 16 | public void AddTest() 17 | { 18 | var A = MeshData.Quad(Vertex.New(0, 0, 0, 0, 0, Color.white), 19 | Vertex.New(0, 1, 0, 0, 1, Color.white), 20 | Vertex.New(1, 1, 0, 1, 1, Color.white), 21 | Vertex.New(1, 0, 0, 1, 0, Color.white)); 22 | 23 | var A2 = A + A; 24 | 25 | Assert.AreEqual(12, A2.triangles.Count); 26 | Assert.AreEqual(8, A2.vertexes.Count); 27 | } 28 | 29 | 30 | } 31 | } 32 | #endif -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Line/Editor/LineInpectorHandler.cs: -------------------------------------------------------------------------------- 1 | //using System.Collections; 2 | //using System.Collections.Generic; 3 | //using UnityEngine; 4 | //using UnityEditor; 5 | 6 | //public class LineInpectorHandler { 7 | 8 | // readonly SerializedProperty _p0; 9 | // readonly SerializedProperty _p1; 10 | // readonly SerializedProperty _points; 11 | // readonly SerializedProperty _option; 12 | // readonly SerializedProperty _mat; 13 | 14 | // readonly SerializedProperty _useLinePoints; 15 | 16 | // public LineInpectorHandler(SerializedObject target) 17 | // { 18 | // _mat = target.FindProperty("m_Material"); 19 | // } 20 | 21 | // public void OnInspector() 22 | // { 23 | // EditorGUI.BeginChangeCheck(); 24 | // EditorGUILayout.PropertyField(_mat); 25 | // if (EditorGUI.EndChangeCheck()) 26 | // { 27 | // _mat.serializedObject.ApplyModifiedProperties(); 28 | // } 29 | // } 30 | //} 31 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Core/Triangle.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | 6 | namespace geniikw.DataRenderer2D 7 | { 8 | public struct Triangle : IMesh 9 | { 10 | Vertex _p0; 11 | Vertex _p1; 12 | Vertex _p2; 13 | public Triangle(Vertex p0, Vertex p1, Vertex p2) 14 | { 15 | _p0 = p0; 16 | _p1 = p1; 17 | _p2 = p2; 18 | } 19 | public IEnumerable Vertices 20 | { 21 | get 22 | { 23 | yield return _p0; 24 | yield return _p1; 25 | yield return _p2; 26 | } 27 | } 28 | 29 | public IEnumerable Triangles 30 | { 31 | get 32 | { 33 | var list = new int[] { 0, 2, 1 }; 34 | foreach (var number in list) 35 | yield return number; 36 | } 37 | } 38 | } 39 | } -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Line/Scripts/Component/WorldLine.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using UnityEngine; 5 | 6 | namespace geniikw.DataRenderer2D 7 | { 8 | public class WorldLine : WorldDataMesh , ISpline 9 | { 10 | public Spline line; 11 | 12 | Spline ISpline.Line 13 | { 14 | get 15 | { 16 | return line; 17 | } 18 | } 19 | 20 | public bool useUpdate = false; 21 | 22 | IMeshDrawer m_builder; 23 | 24 | protected override IEnumerable MeshFactory 25 | { 26 | get 27 | { 28 | return (m_builder ?? (m_builder = LineBuilder.Factory.Normal(this, transform))).Draw(); 29 | } 30 | } 31 | 32 | protected override void Awake() 33 | { 34 | base.Awake(); 35 | line.EditCallBack += GeometyUpdateFlagUp; 36 | line.owner = this; 37 | } 38 | } 39 | } -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Line/Editor/EditorSetting.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEditor; 5 | 6 | namespace geniikw.DataRenderer2D.Editors 7 | { 8 | public class EditorSetting : ScriptableObject 9 | { 10 | [Header("if you want to edit position in inspector, set false")] 11 | public bool onlyViewWidth = true; 12 | 13 | public static EditorSetting m_instance; 14 | public static EditorSetting Get 15 | { 16 | get 17 | { 18 | if (m_instance == null) 19 | { 20 | var find = AssetDatabase.FindAssets("t:EditorSetting", null); 21 | 22 | if (find.Length == 0) 23 | throw new System.Exception("Can't find setting file"); 24 | 25 | m_instance = AssetDatabase.LoadAssetAtPath(AssetDatabase.GUIDToAssetPath(find[0])); 26 | } 27 | 28 | return m_instance; 29 | } 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Kim giwon 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 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Signal/Editor/MenuExtender.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEditor; 5 | namespace geniikw.DataRenderer2D.Signal.Editors 6 | { 7 | public static class MenuExtender 8 | { 9 | //[ContextMenu()] 10 | [MenuItem("GameObject/2D Object/DataRenderer/UISignal")] 11 | public static void CreateUILine() 12 | { 13 | var canvas = Object.FindFirstObjectByType(); 14 | if (canvas == null) 15 | { 16 | var canvasGo = new GameObject("Canvas"); 17 | canvas = canvasGo.AddComponent(); 18 | canvas.renderMode = RenderMode.ScreenSpaceOverlay; 19 | } 20 | 21 | var linego = new GameObject("UISignal"); 22 | var uiline = linego.AddComponent(); 23 | uiline.signal = SignalData.Default; 24 | 25 | uiline.transform.SetParent(canvas.transform); 26 | uiline.GetComponent().anchoredPosition = Vector3.zero; 27 | 28 | Selection.activeObject = linego; 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /ProjectSettings/PackageManagerSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &1 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 53 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 13964, guid: 0000000000000000e000000000000000, type: 0} 13 | m_Name: 14 | m_EditorClassIdentifier: 15 | m_EnablePreReleasePackages: 0 16 | m_AdvancedSettingsExpanded: 1 17 | m_ScopedRegistriesSettingsExpanded: 1 18 | m_SeeAllPackageVersions: 0 19 | m_DismissPreviewPackagesInUse: 0 20 | oneTimeWarningShown: 0 21 | oneTimeDeprecatedPopUpShown: 0 22 | m_Registries: 23 | - m_Id: main 24 | m_Name: 25 | m_Url: https://packages.unity.com 26 | m_Scopes: [] 27 | m_IsDefault: 1 28 | m_Capabilities: 7 29 | m_ConfigSource: 0 30 | m_UserSelectedRegistryName: 31 | m_UserAddingNewScopedRegistry: 0 32 | m_RegistryInfoDraft: 33 | m_Modified: 0 34 | m_ErrorMessage: 35 | m_UserModificationsInstanceId: -874 36 | m_OriginalInstanceId: -876 37 | m_LoadAssets: 0 38 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Line/Editor/UILineEditor.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEditor.UI; 5 | using UnityEditor; 6 | 7 | namespace geniikw.DataRenderer2D.Editors 8 | { 9 | [CustomEditor(typeof(UILine))] 10 | public class UILineEditor : ImageEditor 11 | { 12 | PointHandler _pointHandler; 13 | private MonoBehaviour _owner; 14 | 15 | private SerializedProperty _SplineData; 16 | 17 | protected override void OnEnable() 18 | { 19 | base.OnEnable(); 20 | _owner = target as MonoBehaviour; 21 | _SplineData = serializedObject.FindProperty("line"); 22 | 23 | _pointHandler = new PointHandler(_owner, serializedObject); 24 | } 25 | 26 | private void OnSceneGUI() 27 | { 28 | _pointHandler.OnSceneGUI(); 29 | } 30 | 31 | public override void OnInspectorGUI() 32 | { 33 | serializedObject.Update(); 34 | EditorGUILayout.PropertyField(_SplineData,true); 35 | 36 | base.OnInspectorGUI(); 37 | serializedObject.ApplyModifiedProperties(); 38 | } 39 | } 40 | } -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Hole/UIHole.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using UnityEngine; 5 | 6 | 7 | namespace geniikw.DataRenderer2D.Hole 8 | { 9 | public interface IHole 10 | { 11 | HoleInfo Hole { get; } 12 | } 13 | 14 | public class UIHole : UIDataMesh, IUnitSize, IHole 15 | { 16 | public HoleInfo hole; 17 | 18 | IMeshDrawer m_holeDrawer; 19 | 20 | protected override void Start() 21 | { 22 | hole.editCallback += GeometyUpdateFlagUp; 23 | } 24 | 25 | 26 | public Vector2 Size 27 | { 28 | get 29 | { 30 | return new Vector2(rectTransform.rect.width, rectTransform.rect.height); 31 | } 32 | } 33 | 34 | public HoleInfo Hole 35 | { 36 | get 37 | { 38 | return hole; 39 | } 40 | } 41 | 42 | protected override IEnumerable DrawerFactory 43 | { 44 | get 45 | { 46 | var h = m_holeDrawer ?? (m_holeDrawer = new HoleDrawer(this, this)); 47 | return h.Draw(); 48 | } 49 | } 50 | } 51 | } -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Polygon/Scripts/PolygonDrawManager.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace geniikw.DataRenderer2D.Polygon 6 | { 7 | public class PolygonDrawerManager 8 | { 9 | IPolygon _target; 10 | IMeshDrawer _normal; 11 | IMeshDrawer _hole; 12 | 13 | public PolygonDrawerManager(IPolygon target , 14 | IMeshDrawer normal, IMeshDrawer hole) 15 | { 16 | _target = target; 17 | _normal = normal; 18 | _hole = hole; 19 | } 20 | 21 | public IEnumerable Draw() 22 | { 23 | var polyGon = _target.Polygon; 24 | 25 | if (polyGon.count < 3) 26 | yield break; 27 | 28 | //var cc = polyGon.startAngle == 0 && polyGon.endAngle == 1; 29 | 30 | if (polyGon.type == PolygonType.ZigZag) 31 | foreach (var m in _normal.Draw()) 32 | yield return m; 33 | 34 | else if (polyGon.type >= PolygonType.Hole) 35 | foreach (var m in _hole.Draw()) 36 | yield return m; 37 | 38 | yield break; 39 | } 40 | 41 | } 42 | } -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Hole/Editor/MenuExtender.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEditor; 5 | 6 | namespace geniikw.DataRenderer2D.Hole.Editor 7 | { 8 | public static class MenuExtender 9 | { 10 | [MenuItem("GameObject/2D Object/DataRenderer/UIHole")] 11 | public static void CreateUILine() 12 | { 13 | 14 | var canvas = Object.FindFirstObjectByType(); 15 | if (canvas == null) 16 | { 17 | var canvasGo = new GameObject("Canvas"); 18 | canvas = canvasGo.AddComponent(); 19 | canvas.renderMode = RenderMode.ScreenSpaceOverlay; 20 | } 21 | 22 | var linego = new GameObject("hole"); 23 | var uiline = linego.AddComponent(); 24 | 25 | uiline.hole.SizeX = 0.5f; 26 | uiline.hole.SizeY = 0.5f; 27 | uiline.hole.Color = Color.white; 28 | uiline.hole.Inner = 3; 29 | 30 | 31 | uiline.transform.SetParent(canvas.transform); 32 | uiline.GetComponent().anchoredPosition = Vector3.zero; 33 | 34 | Selection.activeObject = linego; 35 | } 36 | 37 | } 38 | } -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Line/Editor/LineEditor.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEditor; 5 | using UnityEditor.UI; 6 | 7 | namespace geniikw.DataRenderer2D.Editors { 8 | 9 | public class LineEditor : Editor 10 | { 11 | private PointHandler _pointHandler; 12 | //private LineInpectorHandler _inspector; 13 | private MonoBehaviour _owner; 14 | 15 | protected void OnEnable() 16 | { 17 | _owner = target as MonoBehaviour; 18 | 19 | _pointHandler = new PointHandler(_owner,serializedObject); 20 | //_inspector = new LineInpectorHandler(serializedObject); 21 | } 22 | protected void OnSceneGUI() 23 | { 24 | _pointHandler.OnSceneGUI(); 25 | } 26 | 27 | } 28 | 29 | [CustomEditor(typeof(WorldLine))] 30 | public class WorldLineEditor : LineEditor { 31 | 32 | public override void OnInspectorGUI() 33 | { 34 | base.OnInspectorGUI(); 35 | if (GUILayout.Button("MakeNewMesh")) 36 | { 37 | ((WorldLine)target).MakeNewMesh(); 38 | } 39 | } 40 | } 41 | 42 | [CustomEditor(typeof(GizmoLine))] 43 | public class NoRenderLineEditor : LineEditor { } 44 | 45 | } 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /UserSettings/EditorUserSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!162 &1 4 | EditorUserSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 4 7 | m_ConfigSettings: 8 | RecentlyUsedSceneGuid-0: 9 | value: 0109025553045e0a5a5e5c76167a5a44174e1979747b70317e711e61b7b3616c 10 | flags: 0 11 | RecentlyUsedSceneGuid-1: 12 | value: 5750065f5d5108085c0b0f241520594443164078792b73647f7d4f35b2b9616e 13 | flags: 0 14 | RecentlyUsedSceneGuid-2: 15 | value: 5105075251050f0f0857547a112707444e164d7a7c797e677e784f36b0b36368 16 | flags: 0 17 | RecentlyUsedSceneGuid-3: 18 | value: 0605045456545f590e0a5b7441260f44464f197f2d2e77652e7e196be1e2306b 19 | flags: 0 20 | vcSharedLogLevel: 21 | value: 0d5e400f0650 22 | flags: 0 23 | m_VCAutomaticAdd: 1 24 | m_VCDebugCom: 0 25 | m_VCDebugCmd: 0 26 | m_VCDebugOut: 0 27 | m_SemanticMergeMode: 2 28 | m_DesiredImportWorkerCount: 3 29 | m_StandbyImportWorkerCount: 2 30 | m_IdleImportWorkerShutdownDelay: 60000 31 | m_VCShowFailedCheckout: 1 32 | m_VCOverwriteFailedCheckoutAssets: 1 33 | m_VCProjectOverlayIcons: 1 34 | m_VCHierarchyOverlayIcons: 1 35 | m_VCOtherOverlayIcons: 1 36 | m_VCAllowAsyncUpdate: 1 37 | m_VCScanLocalPackagesOnConnect: 1 38 | m_ArtifactGarbageCollection: 1 39 | m_CompressAssetsOnImport: 1 40 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Example/Scripts/DragMove.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEngine.EventSystems; 5 | 6 | namespace geniikw.DataRenderer2D.Example 7 | { 8 | [RequireComponent(typeof(RectTransform))] 9 | public class DragMove : MonoBehaviour, IDragHandler, IPointerDownHandler, IPointerUpHandler 10 | { 11 | public RectTransform Rect { get { return GetComponent(); } } 12 | public RectTransform ClampArea; 13 | 14 | public void OnDrag(PointerEventData eventData) 15 | { 16 | var pos = ClampArea.InverseTransformPoint( eventData.position); 17 | 18 | var xmin = (ClampArea.rect.xMin + Rect.rect.width / 2f) ; 19 | var xmax = (ClampArea.rect.xMax - Rect.rect.width / 2f) ; 20 | var ymin = (ClampArea.rect.yMin + Rect.rect.height / 2f); 21 | var ymax = (ClampArea.rect.yMax - Rect.rect.height / 2f); 22 | 23 | pos.x = Mathf.Clamp(pos.x, xmin, xmax); 24 | pos.y = Mathf.Clamp(pos.y, ymin, ymax); 25 | transform.localPosition = pos; 26 | } 27 | 28 | public void OnPointerDown(PointerEventData eventData) 29 | { 30 | 31 | } 32 | 33 | public void OnPointerUp(PointerEventData eventData) 34 | { 35 | 36 | } 37 | 38 | } 39 | } -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Example/Scripts/DragAddPoint.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEngine.EventSystems; 5 | using UnityEngine.UI; 6 | 7 | namespace geniikw.DataRenderer2D.Example 8 | { 9 | public class DragAddPoint : MonoBehaviour, IDragHandler,IPointerDownHandler 10 | { 11 | 12 | public bool modeToggle = false; 13 | 14 | public float addDistance = 3f; 15 | 16 | UILine m_line; 17 | Vector3 m_prevPos; 18 | 19 | public Text text; 20 | 21 | private void Start() 22 | { 23 | m_line = GetComponent(); 24 | } 25 | 26 | public void OnDrag(PointerEventData eventData) 27 | { 28 | if (modeToggle && Vector3.Distance(m_prevPos, eventData.position) > addDistance) 29 | { 30 | m_line.line.Push(); 31 | m_prevPos = eventData.position; 32 | } 33 | 34 | m_line.line.EditPoint(eventData.position); 35 | } 36 | 37 | public void OnPointerDown(PointerEventData eventData) 38 | { 39 | m_line.line.Push(); 40 | m_line.line.EditPoint(eventData.position); 41 | } 42 | 43 | public void Toggle() 44 | { 45 | modeToggle = !modeToggle; 46 | text.text = modeToggle ? "Drag!" : "Click!"; 47 | } 48 | } 49 | } -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Polygon/Scripts/Drawer/ZigZagPolygon.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace geniikw.DataRenderer2D.Polygon 6 | { 7 | public class ZigZagPolygon : IMeshDrawer 8 | { 9 | CircleCalculator _circle; 10 | IPolygon _target; 11 | 12 | public ZigZagPolygon(CircleCalculator cc, IPolygon target) 13 | { 14 | _circle = cc; 15 | _target = target; 16 | } 17 | 18 | public IEnumerable Draw() 19 | { 20 | List buffer = new List(); 21 | for (int i = 0; i < _target.Polygon.count; i++) 22 | { 23 | var angle = 360f / _target.Polygon.count * i; 24 | buffer.Add(_circle.CalculateVertex(angle)); 25 | } 26 | 27 | int[] v = new int[3] { 0, 1, _target.Polygon.count - 1 }; 28 | int n = 0; 29 | while(n < _target.Polygon.count - 2) 30 | { 31 | if (n % 2 == 1) 32 | yield return new Triangle(buffer[v[0]], buffer[v[2]], buffer[v[1]]); 33 | else 34 | yield return new Triangle(buffer[v[0]], buffer[v[1]], buffer[v[2]]); 35 | 36 | v[n % 3] += (v[n % 3] == 0) ? 2 : (_target.Polygon.count - 2 - n) * (n % 2 == 1 ? 1 : -1); 37 | n++; 38 | } 39 | } 40 | } 41 | } -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Polygon/Scripts/PolygonData.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using UnityEngine; 5 | 6 | namespace geniikw.DataRenderer2D.Polygon 7 | { 8 | public interface IPolygon 9 | { 10 | PolygonData Polygon{ get; } 11 | } 12 | 13 | [Serializable] 14 | public struct PolygonData 15 | { 16 | public PolygonType type; 17 | [Range(0, 1.414f)] 18 | public float sinCft;//coefficient 19 | [Range(0, 1.414f)] 20 | public float cosCft; 21 | [Range(0, 1)] 22 | public float startAngle; 23 | [Range(0, 1)] 24 | public float endAngle; 25 | public int count; 26 | [Range(0, 1)] 27 | public float innerRatio; 28 | public Color centerColor; 29 | 30 | public Gradient outerColor; 31 | 32 | public AnimationCurve curve; 33 | 34 | private Action m_onEditCollback; 35 | public Action OnEditCollback 36 | { 37 | get 38 | { 39 | return m_onEditCollback; 40 | } 41 | set 42 | { 43 | m_onEditCollback = value; 44 | } 45 | } 46 | } 47 | 48 | public enum PolygonType 49 | { 50 | ZigZag, 51 | Hole, 52 | HoleCurve, 53 | HoleHalf, 54 | HoleCenterColor, 55 | HoleHalfCenterColor, 56 | 57 | } 58 | } -------------------------------------------------------------------------------- /ProjectSettings/Physics2DSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!19 &1 4 | Physics2DSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 3 7 | m_Gravity: {x: 0, y: -9.81} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_VelocityIterations: 8 10 | m_PositionIterations: 3 11 | m_VelocityThreshold: 1 12 | m_MaxLinearCorrection: 0.2 13 | m_MaxAngularCorrection: 8 14 | m_MaxTranslationSpeed: 100 15 | m_MaxRotationSpeed: 360 16 | m_BaumgarteScale: 0.2 17 | m_BaumgarteTimeOfImpactScale: 0.75 18 | m_TimeToSleep: 0.5 19 | m_LinearSleepTolerance: 0.01 20 | m_AngularSleepTolerance: 2 21 | m_DefaultContactOffset: 0.01 22 | m_AutoSimulation: 1 23 | m_QueriesHitTriggers: 1 24 | m_QueriesStartInColliders: 1 25 | m_ChangeStopsCallbacks: 0 26 | m_CallbacksOnDisable: 1 27 | m_AutoSyncTransforms: 1 28 | m_AlwaysShowColliders: 0 29 | m_ShowColliderSleep: 1 30 | m_ShowColliderContacts: 0 31 | m_ShowColliderAABB: 0 32 | m_ContactArrowScale: 0.2 33 | m_ColliderAwakeColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.7529412} 34 | m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432} 35 | m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745} 36 | m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804} 37 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 38 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Core/Quad.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | 6 | namespace geniikw.DataRenderer2D 7 | { 8 | public struct Quad : IMesh 9 | { 10 | Vertex _p0; 11 | Vertex _p1; 12 | Vertex _p2; 13 | Vertex _p3; 14 | 15 | 16 | public Quad(Vertex p0, Vertex p1, Vertex p2, Vertex p3) 17 | { 18 | _p0 = p0; 19 | _p1 = p1; 20 | _p2 = p2; 21 | _p3 = p3; 22 | } 23 | 24 | public Quad(Vector2 size, Vector2 center, Color color) 25 | { 26 | _p0 = Vertex.New(center - new Vector2(-size.x, -size.y) / 2f, new Vector2(0, 0), color); 27 | _p1 = Vertex.New(center - new Vector2(size.x, -size.y) / 2f, new Vector2(0, 0), color); 28 | _p2 = Vertex.New(center - new Vector2(-size.x, size.y) / 2f, new Vector2(0, 0), color); 29 | _p3 = Vertex.New(center - new Vector2(size.x, size.y) / 2f, new Vector2(0, 0), color); 30 | } 31 | 32 | public IEnumerable Vertices 33 | { 34 | get 35 | { 36 | yield return _p0; 37 | yield return _p1; 38 | yield return _p2; 39 | yield return _p3; 40 | 41 | } 42 | } 43 | 44 | public IEnumerable Triangles 45 | { 46 | get 47 | { 48 | var list = new int[] { 0, 2, 1, 1, 2, 3 }; 49 | foreach (var number in list) 50 | yield return number; 51 | } 52 | } 53 | } 54 | } -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Line/Scripts/Component/UILine.cs: -------------------------------------------------------------------------------- 1 | using geniikw.DataRenderer2D; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using UnityEngine; 5 | using UnityEngine.UI; 6 | 7 | namespace geniikw.DataRenderer2D 8 | { 9 | /// 10 | /// draw mesh in canvas 11 | /// 12 | public partial class UILine : UIDataMesh , ISpline 13 | { 14 | public Spline line; 15 | 16 | /// 17 | /// hard copy. 18 | /// 19 | Spline ISpline.Line 20 | { 21 | get 22 | { 23 | return line; 24 | } 25 | } 26 | 27 | IEnumerable m_Drawer = null; 28 | protected override IEnumerable DrawerFactory 29 | { 30 | get 31 | { 32 | return m_Drawer ?? (m_Drawer = LineBuilder.Factory.Normal(this, transform).Draw()); 33 | } 34 | } 35 | 36 | protected override void Start() 37 | { 38 | base.Start(); 39 | line.owner = this; 40 | line.EditCallBack += GeometyUpdateFlagUp; 41 | } 42 | 43 | public static UILine CreateLine(Transform parent = null) 44 | { 45 | var go = new GameObject("UILine"); 46 | if (parent != null) 47 | go.transform.SetParent(parent); 48 | go.transform.localPosition = Vector3.zero; 49 | 50 | var line = go.AddComponent(); 51 | line.line = Spline.Default; 52 | line.Start(); 53 | return line; 54 | } 55 | } 56 | 57 | } -------------------------------------------------------------------------------- /Packages/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "com.unity.ide.visualstudio": "2.0.22", 4 | "com.unity.ugui": "2.0.0", 5 | "com.unity.modules.accessibility": "1.0.0", 6 | "com.unity.modules.ai": "1.0.0", 7 | "com.unity.modules.androidjni": "1.0.0", 8 | "com.unity.modules.animation": "1.0.0", 9 | "com.unity.modules.assetbundle": "1.0.0", 10 | "com.unity.modules.audio": "1.0.0", 11 | "com.unity.modules.cloth": "1.0.0", 12 | "com.unity.modules.director": "1.0.0", 13 | "com.unity.modules.imageconversion": "1.0.0", 14 | "com.unity.modules.imgui": "1.0.0", 15 | "com.unity.modules.jsonserialize": "1.0.0", 16 | "com.unity.modules.particlesystem": "1.0.0", 17 | "com.unity.modules.physics": "1.0.0", 18 | "com.unity.modules.physics2d": "1.0.0", 19 | "com.unity.modules.screencapture": "1.0.0", 20 | "com.unity.modules.terrain": "1.0.0", 21 | "com.unity.modules.terrainphysics": "1.0.0", 22 | "com.unity.modules.tilemap": "1.0.0", 23 | "com.unity.modules.ui": "1.0.0", 24 | "com.unity.modules.uielements": "1.0.0", 25 | "com.unity.modules.umbra": "1.0.0", 26 | "com.unity.modules.unityanalytics": "1.0.0", 27 | "com.unity.modules.unitywebrequest": "1.0.0", 28 | "com.unity.modules.unitywebrequestassetbundle": "1.0.0", 29 | "com.unity.modules.unitywebrequestaudio": "1.0.0", 30 | "com.unity.modules.unitywebrequesttexture": "1.0.0", 31 | "com.unity.modules.unitywebrequestwww": "1.0.0", 32 | "com.unity.modules.vehicles": "1.0.0", 33 | "com.unity.modules.video": "1.0.0", 34 | "com.unity.modules.vr": "1.0.0", 35 | "com.unity.modules.wind": "1.0.0", 36 | "com.unity.modules.xr": "1.0.0" 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /ProjectSettings/NavMeshAreas.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!126 &1 4 | NavMeshProjectSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | areas: 8 | - name: Walkable 9 | cost: 1 10 | - name: Not Walkable 11 | cost: 1 12 | - name: Jump 13 | cost: 2 14 | - name: 15 | cost: 1 16 | - name: 17 | cost: 1 18 | - name: 19 | cost: 1 20 | - name: 21 | cost: 1 22 | - name: 23 | cost: 1 24 | - name: 25 | cost: 1 26 | - name: 27 | cost: 1 28 | - name: 29 | cost: 1 30 | - name: 31 | cost: 1 32 | - name: 33 | cost: 1 34 | - name: 35 | cost: 1 36 | - name: 37 | cost: 1 38 | - name: 39 | cost: 1 40 | - name: 41 | cost: 1 42 | - name: 43 | cost: 1 44 | - name: 45 | cost: 1 46 | - name: 47 | cost: 1 48 | - name: 49 | cost: 1 50 | - name: 51 | cost: 1 52 | - name: 53 | cost: 1 54 | - name: 55 | cost: 1 56 | - name: 57 | cost: 1 58 | - name: 59 | cost: 1 60 | - name: 61 | cost: 1 62 | - name: 63 | cost: 1 64 | - name: 65 | cost: 1 66 | - name: 67 | cost: 1 68 | - name: 69 | cost: 1 70 | - name: 71 | cost: 1 72 | m_LastAgentTypeID: -887442657 73 | m_Settings: 74 | - serializedVersion: 2 75 | agentTypeID: 0 76 | agentRadius: 0.5 77 | agentHeight: 2 78 | agentSlope: 45 79 | agentClimb: 0.75 80 | ledgeDropHeight: 0 81 | maxJumpAcrossDistance: 0 82 | minRegionArea: 2 83 | manualCellSize: 0 84 | cellSize: 0.16666667 85 | manualTileSize: 0 86 | tileSize: 256 87 | accuratePlacement: 0 88 | m_SettingNames: 89 | - Humanoid 90 | -------------------------------------------------------------------------------- /UserSettings/Search.settings: -------------------------------------------------------------------------------- 1 | trackSelection = true 2 | refreshSearchWindowsInPlayMode = false 3 | pickerAdvancedUI = false 4 | fetchPreview = true 5 | defaultFlags = 0 6 | keepOpen = false 7 | queryFolder = "Assets" 8 | onBoardingDoNotAskAgain = true 9 | showPackageIndexes = false 10 | showStatusBar = false 11 | scopes = { 12 | } 13 | providers = { 14 | find = { 15 | active = true 16 | priority = 25 17 | defaultAction = null 18 | } 19 | log = { 20 | active = false 21 | priority = 210 22 | defaultAction = null 23 | } 24 | asset = { 25 | active = true 26 | priority = 25 27 | defaultAction = null 28 | } 29 | performance = { 30 | active = false 31 | priority = 100 32 | defaultAction = null 33 | } 34 | store = { 35 | active = false 36 | priority = 100 37 | defaultAction = null 38 | } 39 | packages = { 40 | active = false 41 | priority = 90 42 | defaultAction = null 43 | } 44 | adb = { 45 | active = false 46 | priority = 2500 47 | defaultAction = null 48 | } 49 | scene = { 50 | active = true 51 | priority = 50 52 | defaultAction = null 53 | } 54 | profilermarkers = { 55 | active = false 56 | priority = 100 57 | defaultAction = null 58 | } 59 | presets_provider = { 60 | active = false 61 | priority = -10 62 | defaultAction = null 63 | } 64 | } 65 | objectSelectors = { 66 | } 67 | recentSearches = [ 68 | ] 69 | searchItemFavorites = [ 70 | ] 71 | savedSearchesSortOrder = 0 72 | showSavedSearchPanel = false 73 | hideTabs = false 74 | expandedQueries = [ 75 | ] 76 | queryBuilder = true 77 | ignoredProperties = "id;name;classname;imagecontentshash" 78 | helperWidgetCurrentArea = "all" 79 | disabledIndexers = "" 80 | minIndexVariations = 2 81 | findProviderIndexHelper = true -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Line/Scripts/Data/LineOption.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using System; 5 | 6 | namespace geniikw.DataRenderer2D 7 | { 8 | [Serializable] 9 | public struct LineOption 10 | { 11 | 12 | public enum Mode 13 | { 14 | Noraml = 0, 15 | Loop = 1, 16 | RoundEdge = 2 17 | } 18 | 19 | public enum LineJointOption 20 | { 21 | round, 22 | intersect 23 | } 24 | 25 | [Range(0, 1)] 26 | public float startRatio; 27 | [Range(0, 1)] 28 | public float endRatio; 29 | public Mode mode; 30 | [Range(0.1f, 100f)] 31 | public float divideLength; 32 | [Range(5, 180)] 33 | public float divideAngle; 34 | 35 | public Gradient color;//class reference type; 36 | 37 | public LineJointOption jointOption; 38 | 39 | public float DivideAngle 40 | { 41 | get { return Mathf.Clamp(divideAngle, 5, 180); } 42 | } 43 | public float DivideLength 44 | { 45 | get { return Mathf.Clamp(divideLength, 0.1f, 100); } 46 | } 47 | 48 | public static LineOption Default 49 | { 50 | get 51 | { 52 | return new LineOption() 53 | { 54 | startRatio = 0f, 55 | endRatio = 1f, 56 | mode = Mode.Noraml, 57 | divideLength = 1f, 58 | divideAngle = 10f, 59 | color = new Gradient() 60 | }; 61 | } 62 | } 63 | 64 | } 65 | } -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Line/Scripts/Data/Point.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using System; 5 | 6 | namespace geniikw.DataRenderer2D 7 | { 8 | /// 9 | /// define each point 10 | /// 11 | [Serializable] 12 | public struct Point 13 | { 14 | public Vector3 position; 15 | public Vector3 previousControlOffset; 16 | public Vector3 nextControlOffset; 17 | [Range(0,100)] 18 | public float width; 19 | [Range(-90, 90)] 20 | public float forwardAngle; 21 | [Range(-90, 90)] 22 | public float backAngle; 23 | //todo : move normalVector from LineOption to Point. 24 | //public float normal; 25 | 26 | public Point(Vector3 pos, Vector3 next, Vector3 prev, float width = 2,float angle = 0, float endAngle = 0) 27 | { 28 | position = pos; 29 | previousControlOffset = prev; 30 | nextControlOffset = next; 31 | this.forwardAngle = angle; 32 | this.width = width; 33 | this.backAngle = endAngle; 34 | } 35 | 36 | public Vector3 PreviousControlPoisition 37 | { 38 | get 39 | { 40 | return previousControlOffset + position; 41 | } 42 | } 43 | public Vector3 NextControlPosition 44 | { 45 | get 46 | { 47 | return nextControlOffset + position; 48 | } 49 | } 50 | 51 | public static Point Zero 52 | { 53 | get 54 | { 55 | return new Point(Vector3.zero, Vector3.zero, Vector3.zero); 56 | } 57 | } 58 | } 59 | } -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Example/Scripts/ScriptScenario.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace geniikw.DataRenderer2D.Example { 6 | public class ScriptScenario : MonoBehaviour { 7 | 8 | public List list = new List(); 9 | UILine m_line; 10 | // Use this for initialization 11 | public void Start() 12 | { 13 | StartCoroutine(StartRoutine()); 14 | } 15 | 16 | IEnumerator StartRoutine() { 17 | m_line = UILine.CreateLine(transform); 18 | m_line.transform.SetAsFirstSibling(); 19 | m_line.line.option.divideLength = 100; 20 | while(m_line.line.Count < list.Count) 21 | m_line.line.Push(); 22 | 23 | while (true) 24 | { 25 | float t = 0f; 26 | m_line.line.option.startRatio = 0; 27 | m_line.line.option.endRatio = 0; 28 | while (t < 1f) 29 | { 30 | t += Time.deltaTime; 31 | m_line.line.option.endRatio = t; 32 | yield return null; 33 | } 34 | t = 0f; 35 | while (t < 1f) 36 | { 37 | t += Time.deltaTime; 38 | m_line.line.option.startRatio = t; 39 | yield return null; 40 | } 41 | } 42 | } 43 | 44 | // Update is called once per frame 45 | void Update() { 46 | for (int i = 0; i < list.Count; i++) 47 | { 48 | m_line.line.EditPoint(i, list[i].position, 2f); 49 | } 50 | 51 | } 52 | } 53 | } -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "files.exclude": { 3 | "**/.DS_Store": true, 4 | "**/.git": true, 5 | "**/.vs": true, 6 | "**/.gitmodules": true, 7 | "**/.vsconfig": true, 8 | "**/*.booproj": true, 9 | "**/*.pidb": true, 10 | "**/*.suo": true, 11 | "**/*.user": true, 12 | "**/*.userprefs": true, 13 | "**/*.unityproj": true, 14 | "**/*.dll": true, 15 | "**/*.exe": true, 16 | "**/*.pdf": true, 17 | "**/*.mid": true, 18 | "**/*.midi": true, 19 | "**/*.wav": true, 20 | "**/*.gif": true, 21 | "**/*.ico": true, 22 | "**/*.jpg": true, 23 | "**/*.jpeg": true, 24 | "**/*.png": true, 25 | "**/*.psd": true, 26 | "**/*.tga": true, 27 | "**/*.tif": true, 28 | "**/*.tiff": true, 29 | "**/*.3ds": true, 30 | "**/*.3DS": true, 31 | "**/*.fbx": true, 32 | "**/*.FBX": true, 33 | "**/*.lxo": true, 34 | "**/*.LXO": true, 35 | "**/*.ma": true, 36 | "**/*.MA": true, 37 | "**/*.obj": true, 38 | "**/*.OBJ": true, 39 | "**/*.asset": true, 40 | "**/*.cubemap": true, 41 | "**/*.flare": true, 42 | "**/*.mat": true, 43 | "**/*.meta": true, 44 | "**/*.prefab": true, 45 | "**/*.unity": true, 46 | "build/": true, 47 | "Build/": true, 48 | "Library/": true, 49 | "library/": true, 50 | "obj/": true, 51 | "Obj/": true, 52 | "Logs/": true, 53 | "logs/": true, 54 | "ProjectSettings/": true, 55 | "UserSettings/": true, 56 | "temp/": true, 57 | "Temp/": true 58 | }, 59 | "dotnet.defaultSolution": "DataRenderer2D.sln" 60 | } -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Line/Scripts/Component/GizmoLine.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace geniikw.DataRenderer2D 6 | { 7 | /// 8 | /// no render line. 9 | /// 10 | public class GizmoLine : MonoBehaviour 11 | { 12 | public Spline line; 13 | public Color color = Color.white; 14 | 15 | public bool isOnlyViewSelected = true; 16 | 17 | public bool debugColor = false; 18 | 19 | private void OnDrawGizmos() 20 | { 21 | if (isOnlyViewSelected) 22 | return; 23 | DrawLine(); 24 | } 25 | 26 | private void OnDrawGizmosSelected() 27 | { 28 | if (!isOnlyViewSelected) 29 | return; 30 | DrawLine(); 31 | } 32 | 33 | public Vector3 GetPosition(float r) 34 | { 35 | return transform.TransformPoint( line.GetPosition(r)); 36 | } 37 | public Vector3 GetDirection(float r) 38 | { 39 | return line.GetDirection(r); 40 | } 41 | 42 | private void DrawLine() 43 | { 44 | var colorStore = Gizmos.color; 45 | foreach (var pair in line.TargetPairList) 46 | { 47 | var dt = pair.GetDT(line.option.DivideLength); 48 | for (float t = pair.start; t < pair.end; t+=dt) 49 | { 50 | var p0 = transform.TransformPoint(Curve.Auto(pair.n0, pair.n1, t)); 51 | var p1 = transform.TransformPoint(Curve.Auto(pair.n0, pair.n1, t+dt)); 52 | if (debugColor) 53 | Gizmos.color = new Color(Random.Range(0f, 1f), Random.Range(0f, 1f), Random.Range(0f, 1f)); 54 | else 55 | Gizmos.color = color; 56 | 57 | Gizmos.DrawLine(p0,p1); 58 | } 59 | } 60 | Gizmos.color = colorStore; 61 | } 62 | } 63 | } -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Line/Editor/MenuExtender.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEditor; 5 | namespace geniikw.DataRenderer2D.Editors 6 | { 7 | public static class MenuExtender 8 | { 9 | //[ContextMenu()] 10 | [MenuItem("GameObject/2D Object/DataRenderer/UILine")] 11 | public static void CreateUILine() 12 | { 13 | var canvas = Object.FindFirstObjectByType(); 14 | if(canvas == null) 15 | { 16 | var canvasGo = new GameObject("Canvas"); 17 | canvas = canvasGo.AddComponent(); 18 | canvas.renderMode = RenderMode.ScreenSpaceOverlay; 19 | } 20 | 21 | var linego = new GameObject("line"); 22 | var uiline =linego.AddComponent(); 23 | uiline.line.Initialize(); 24 | 25 | uiline.transform.SetParent(canvas.transform); 26 | uiline.GetComponent().anchoredPosition = Vector3.zero; 27 | 28 | Selection.activeObject = linego; 29 | } 30 | 31 | //[ContextMenu()] 32 | [MenuItem("GameObject/2D Object/DataRenderer/GizmoLine")] 33 | public static void CreateNoRenderLine() 34 | { 35 | var linego = new GameObject("line"); 36 | var gizmoLine = linego.AddComponent(); 37 | gizmoLine.line = Spline.Default; 38 | 39 | Selection.activeObject = linego; 40 | } 41 | 42 | [MenuItem("GameObject/2D Object/DataRenderer/WorldLine")] 43 | public static void CreateWorldLine() 44 | { 45 | var linego = new GameObject("line"); 46 | var worldLine = linego.AddComponent(); 47 | worldLine.GetComponent().material = new Material(Shader.Find("Diffuse")); 48 | worldLine.line.Initialize(); 49 | 50 | Selection.activeObject = linego; 51 | } 52 | 53 | 54 | } 55 | } -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Core/UIDataMesh.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using UnityEngine; 5 | using UnityEngine.UI; 6 | 7 | namespace geniikw.DataRenderer2D 8 | { 9 | public abstract class UIDataMesh : Image, IMeshModifier 10 | { 11 | bool m_geometryUpdateFlag = false; 12 | 13 | IEnumerable _mesh; 14 | IEnumerable Mesh 15 | { 16 | get { return _mesh ?? (_mesh = DrawerFactory); } 17 | } 18 | protected abstract IEnumerable DrawerFactory { get; } 19 | 20 | protected override void Awake() 21 | { 22 | base.Awake(); 23 | } 24 | 25 | public void GeometyUpdateFlagUp() 26 | { 27 | m_geometryUpdateFlag = true; 28 | } 29 | 30 | public void LateUpdate() 31 | { 32 | if (m_geometryUpdateFlag) 33 | { 34 | UpdateGeometry(); 35 | m_geometryUpdateFlag = false; 36 | } 37 | } 38 | 39 | public void ModifyMesh(Mesh mesh) 40 | { 41 | using (var vh = new VertexHelper(mesh)) 42 | { 43 | ModifyMesh(vh); 44 | vh.FillMesh(mesh); 45 | } 46 | } 47 | 48 | public void ModifyMesh(VertexHelper verts) 49 | { 50 | verts.Clear(); 51 | 52 | Queue buffer = new Queue(); 53 | 54 | foreach (var m in Mesh) 55 | { 56 | 57 | foreach (var t in m.Triangles) 58 | { 59 | buffer.Enqueue(t); 60 | if (buffer.Count == 3) 61 | { 62 | var c = verts.currentVertCount; 63 | verts.AddTriangle(c + buffer.Dequeue(), c + buffer.Dequeue(), c + buffer.Dequeue()); 64 | } 65 | } 66 | foreach (var v in m.Vertices) 67 | verts.AddVert(v.position, v.color, v.uv); 68 | 69 | } 70 | 71 | } 72 | 73 | } 74 | 75 | } -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Example/Stuff/hole.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: hole 9 | serializedVersion: 5 10 | m_AnimatorParameters: [] 11 | m_AnimatorLayers: 12 | - serializedVersion: 5 13 | m_Name: Base Layer 14 | m_StateMachine: {fileID: 1107340825192846882} 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 &1102660804277627098 25 | AnimatorState: 26 | serializedVersion: 5 27 | m_ObjectHideFlags: 1 28 | m_PrefabParentObject: {fileID: 0} 29 | m_PrefabInternal: {fileID: 0} 30 | m_Name: hole 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: 0e295b52ad9e635459cfdd0164eaf43f, type: 2} 43 | m_Tag: 44 | m_SpeedParameter: 45 | m_MirrorParameter: 46 | m_CycleOffsetParameter: 47 | --- !u!1107 &1107340825192846882 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: 1102660804277627098} 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: 1102660804277627098} 68 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Polygon/Scripts/CircleCalculator.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace geniikw.DataRenderer2D.Polygon 6 | { 7 | public class CircleCalculator { 8 | readonly IPolygon _target; 9 | readonly IUnitSize _unit; 10 | 11 | public CircleCalculator(IPolygon target, IUnitSize size) 12 | { 13 | _target = target; 14 | _unit = size; 15 | } 16 | 17 | private Vector3 Calculate(float angle) 18 | { 19 | var factor = _target.Polygon.type == PolygonType.HoleCurve ? _target.Polygon.curve.Evaluate(angle / 360f) : 1f; 20 | angle *= Mathf.Deg2Rad; 21 | return _target.Polygon.cosCft * Mathf.Cos(angle) * Vector3.right * _unit.Size.x * 0.5f* factor 22 | + _target.Polygon.sinCft * Mathf.Sin(angle) * Vector3.up * _unit.Size.y * 0.5f* factor; 23 | } 24 | 25 | private Vector2 CalculateUV(float angle) 26 | { 27 | return new Vector2(Mathf.Cos(angle * Mathf.Deg2Rad) * 0.5f + 0.5f, Mathf.Sin(angle * Mathf.Deg2Rad) * 0.5f + 0.5f); 28 | } 29 | 30 | private Vector2 CalculateInnerUV(float angle) 31 | { 32 | return new Vector2( 33 | Mathf.Cos(angle * Mathf.Deg2Rad) * 0.5f * _target.Polygon.innerRatio + 0.5f, 34 | Mathf.Sin(angle * Mathf.Deg2Rad) * 0.5f * _target.Polygon.innerRatio + 0.5f); 35 | } 36 | 37 | public Vertex CalculateVertex(float angle) 38 | { 39 | return Vertex.New( 40 | Calculate(angle), 41 | CalculateUV(angle), 42 | _target.Polygon.outerColor.Evaluate(angle / 360f)); 43 | } 44 | 45 | public Vertex CalculateInnerVertex(float angle) 46 | { 47 | return Vertex.New( 48 | Calculate(angle) * _target.Polygon.innerRatio, 49 | CalculateInnerUV(angle), 50 | _target.Polygon.type >= PolygonType.HoleCenterColor? _target.Polygon.centerColor: _target.Polygon.outerColor.Evaluate(angle / 360f)); 51 | } 52 | 53 | 54 | } 55 | } -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Example/Stuff/line.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: line 9 | serializedVersion: 5 10 | m_AnimatorParameters: [] 11 | m_AnimatorLayers: 12 | - serializedVersion: 5 13 | m_Name: Base Layer 14 | m_StateMachine: {fileID: 1107980968952814062} 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 &1102388131735979030 25 | AnimatorState: 26 | serializedVersion: 5 27 | m_ObjectHideFlags: 1 28 | m_PrefabParentObject: {fileID: 0} 29 | m_PrefabInternal: {fileID: 0} 30 | m_Name: mainLine 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_TimeParameterActive: 0 43 | m_Motion: {fileID: 7400000, guid: 5498f4d2c285c3647b840b2bb7ff45d8, type: 2} 44 | m_Tag: 45 | m_SpeedParameter: 46 | m_MirrorParameter: 47 | m_CycleOffsetParameter: 48 | m_TimeParameter: 49 | --- !u!1107 &1107980968952814062 50 | AnimatorStateMachine: 51 | serializedVersion: 5 52 | m_ObjectHideFlags: 1 53 | m_PrefabParentObject: {fileID: 0} 54 | m_PrefabInternal: {fileID: 0} 55 | m_Name: Base Layer 56 | m_ChildStates: 57 | - serializedVersion: 1 58 | m_State: {fileID: 1102388131735979030} 59 | m_Position: {x: 200, y: 0, z: 0} 60 | m_ChildStateMachines: [] 61 | m_AnyStateTransitions: [] 62 | m_EntryTransitions: [] 63 | m_StateMachineTransitions: {} 64 | m_StateMachineBehaviours: [] 65 | m_AnyStatePosition: {x: 50, y: 20, z: 0} 66 | m_EntryPosition: {x: 50, y: 120, z: 0} 67 | m_ExitPosition: {x: 800, y: 120, z: 0} 68 | m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} 69 | m_DefaultState: {fileID: 1102388131735979030} 70 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Example/Stuff/Text.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: Text 9 | serializedVersion: 5 10 | m_AnimatorParameters: [] 11 | m_AnimatorLayers: 12 | - serializedVersion: 5 13 | m_Name: Base Layer 14 | m_StateMachine: {fileID: 1107219234393031104} 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 &1102380893515089838 25 | AnimatorState: 26 | serializedVersion: 5 27 | m_ObjectHideFlags: 1 28 | m_PrefabParentObject: {fileID: 0} 29 | m_PrefabInternal: {fileID: 0} 30 | m_Name: textAnimator 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_TimeParameterActive: 0 43 | m_Motion: {fileID: 7400000, guid: 1bfb7c6e3d7abc94aabd2c03a48effab, type: 2} 44 | m_Tag: 45 | m_SpeedParameter: 46 | m_MirrorParameter: 47 | m_CycleOffsetParameter: 48 | m_TimeParameter: 49 | --- !u!1107 &1107219234393031104 50 | AnimatorStateMachine: 51 | serializedVersion: 5 52 | m_ObjectHideFlags: 1 53 | m_PrefabParentObject: {fileID: 0} 54 | m_PrefabInternal: {fileID: 0} 55 | m_Name: Base Layer 56 | m_ChildStates: 57 | - serializedVersion: 1 58 | m_State: {fileID: 1102380893515089838} 59 | m_Position: {x: 200, y: 0, z: 0} 60 | m_ChildStateMachines: [] 61 | m_AnyStateTransitions: [] 62 | m_EntryTransitions: [] 63 | m_StateMachineTransitions: {} 64 | m_StateMachineBehaviours: [] 65 | m_AnyStatePosition: {x: 50, y: 20, z: 0} 66 | m_EntryPosition: {x: 50, y: 120, z: 0} 67 | m_ExitPosition: {x: 800, y: 120, z: 0} 68 | m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} 69 | m_DefaultState: {fileID: 1102380893515089838} 70 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Example/Stuff/UIPolygon (2).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: UIPolygon (2) 9 | serializedVersion: 5 10 | m_AnimatorParameters: [] 11 | m_AnimatorLayers: 12 | - serializedVersion: 5 13 | m_Name: Base Layer 14 | m_StateMachine: {fileID: 1107228391819993792} 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 &1102162565482869826 25 | AnimatorState: 26 | serializedVersion: 5 27 | m_ObjectHideFlags: 1 28 | m_PrefabParentObject: {fileID: 0} 29 | m_PrefabInternal: {fileID: 0} 30 | m_Name: hexagon 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_TimeParameterActive: 0 43 | m_Motion: {fileID: 7400000, guid: 6b0be7fd7ead6894c96970b7e6ad552d, type: 2} 44 | m_Tag: 45 | m_SpeedParameter: 46 | m_MirrorParameter: 47 | m_CycleOffsetParameter: 48 | m_TimeParameter: 49 | --- !u!1107 &1107228391819993792 50 | AnimatorStateMachine: 51 | serializedVersion: 5 52 | m_ObjectHideFlags: 1 53 | m_PrefabParentObject: {fileID: 0} 54 | m_PrefabInternal: {fileID: 0} 55 | m_Name: Base Layer 56 | m_ChildStates: 57 | - serializedVersion: 1 58 | m_State: {fileID: 1102162565482869826} 59 | m_Position: {x: 200, y: 0, z: 0} 60 | m_ChildStateMachines: [] 61 | m_AnyStateTransitions: [] 62 | m_EntryTransitions: [] 63 | m_StateMachineTransitions: {} 64 | m_StateMachineBehaviours: [] 65 | m_AnyStatePosition: {x: 50, y: 20, z: 0} 66 | m_EntryPosition: {x: 50, y: 120, z: 0} 67 | m_ExitPosition: {x: 800, y: 120, z: 0} 68 | m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} 69 | m_DefaultState: {fileID: 1102162565482869826} 70 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Polygon/Editor/MeneExtender.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEditor; 5 | 6 | namespace geniikw.DataRenderer2D.Polygon.Editors 7 | { 8 | public static class MeneExtender 9 | { 10 | [MenuItem("GameObject/2D Object/DataRenderer/WorldPolygon")] 11 | public static void WorldPolygon() 12 | { 13 | var go = new GameObject("WorldPolygon"); 14 | go.transform.SetParent(Selection.activeTransform); 15 | var p = go.AddComponent(); 16 | go.GetComponent().material = new Material(Shader.Find("Diffuse")); 17 | p.data = Defulat(); 18 | 19 | } 20 | [MenuItem("GameObject/2D Object/DataRenderer/UIPolygon")] 21 | public static void UIPolygon() 22 | { 23 | var parent = Selection.activeTransform; 24 | if (parent == null || !CheckCanvas(parent)) 25 | { 26 | Debug.LogError("there is no canvas"); 27 | return; 28 | } 29 | 30 | var go = new GameObject("UIPolygon"); 31 | go.transform.SetParent(Selection.activeTransform); 32 | var p = go.AddComponent(); 33 | p.rectTransform.anchoredPosition = Vector3.zero; 34 | p.data = Defulat(); 35 | } 36 | 37 | public static bool CheckCanvas(Transform t) 38 | { 39 | if(t.parent != null) 40 | return CheckCanvas(t.parent); 41 | 42 | if (t.GetComponent() == null) 43 | return false; 44 | return true; 45 | } 46 | 47 | private static PolygonData Defulat() 48 | { 49 | return new PolygonData 50 | { 51 | curve = AnimationCurve.Linear(0, 1, 1, 1), 52 | outerColor = new Gradient(), 53 | endAngle = 1f, 54 | sinCft = 1f, 55 | cosCft = 1f, 56 | centerColor = Color.white, 57 | count = 3, 58 | innerRatio = 0f, 59 | startAngle = 0f, 60 | type = PolygonType.ZigZag 61 | }; 62 | } 63 | } 64 | } -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Example/Scripts/MonobehaviourExtension.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEngine.UI; 5 | 6 | namespace geniikw.DataRenderer2D.Example 7 | { 8 | public static class MonobehaviourExtension 9 | { 10 | public static Coroutine TweenMove(this MonoBehaviour owner, Vector3 end, float t) 11 | { 12 | return owner.StartCoroutine(MoveRoutine(owner.transform, end, t)); 13 | } 14 | 15 | public static Coroutine TweenScale(this MonoBehaviour owner, Vector3 end, float t) 16 | { 17 | return owner.StartCoroutine(ScalerRoutine(owner.transform, end, t)); 18 | } 19 | 20 | public static Coroutine TweenColor(this MonoBehaviour owner, Color end, float t) 21 | { 22 | var image = owner.GetComponent(); 23 | if (image == null) 24 | return null ; 25 | return owner.StartCoroutine(ImageColorTween(image, end, t)); 26 | } 27 | 28 | static IEnumerator ScalerRoutine(Transform owner, Vector3 end, float time) 29 | { 30 | float t = 0f; 31 | Vector3 start = owner.localScale; 32 | while (t < 1f) 33 | { 34 | t += Time.deltaTime / time; 35 | owner.localScale = Vector3.Lerp(start, end, t); 36 | yield return null; 37 | } 38 | } 39 | 40 | static IEnumerator MoveRoutine(Transform owner, Vector3 end, float time) 41 | { 42 | float t = 0f; 43 | Vector3 start = owner.position; 44 | while (t < 1f) 45 | { 46 | t += Time.deltaTime / time; 47 | owner.position = Vector3.Lerp(start, end, t); 48 | yield return null; 49 | } 50 | } 51 | 52 | static IEnumerator ImageColorTween(Image target, Color end, float time) 53 | { 54 | float t = 0f; 55 | var start = target.color; 56 | while (t < 1f) 57 | { 58 | t += Time.deltaTime / time; 59 | target.color = Color.Lerp(start, end, t); 60 | yield return null; 61 | } 62 | } 63 | 64 | 65 | 66 | } 67 | } -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Example/Stuff/line 1.controller: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1102 &-2837452429741462213 4 | AnimatorState: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 1 7 | m_CorrespondingSourceObject: {fileID: 0} 8 | m_PrefabInstance: {fileID: 0} 9 | m_PrefabAsset: {fileID: 0} 10 | m_Name: lineanimation 11 | m_Speed: 1 12 | m_CycleOffset: 0 13 | m_Transitions: [] 14 | m_StateMachineBehaviours: [] 15 | m_Position: {x: 50, y: 50, z: 0} 16 | m_IKOnFeet: 0 17 | m_WriteDefaultValues: 1 18 | m_Mirror: 0 19 | m_SpeedParameterActive: 0 20 | m_MirrorParameterActive: 0 21 | m_CycleOffsetParameterActive: 0 22 | m_TimeParameterActive: 0 23 | m_Motion: {fileID: 7400000, guid: a59bbd11a13f2e54fa46f80d7f53890e, type: 2} 24 | m_Tag: 25 | m_SpeedParameter: 26 | m_MirrorParameter: 27 | m_CycleOffsetParameter: 28 | m_TimeParameter: 29 | --- !u!91 &9100000 30 | AnimatorController: 31 | m_ObjectHideFlags: 0 32 | m_CorrespondingSourceObject: {fileID: 0} 33 | m_PrefabInstance: {fileID: 0} 34 | m_PrefabAsset: {fileID: 0} 35 | m_Name: line 1 36 | serializedVersion: 5 37 | m_AnimatorParameters: [] 38 | m_AnimatorLayers: 39 | - serializedVersion: 5 40 | m_Name: Base Layer 41 | m_StateMachine: {fileID: 6810242219007155327} 42 | m_Mask: {fileID: 0} 43 | m_Motions: [] 44 | m_Behaviours: [] 45 | m_BlendingMode: 0 46 | m_SyncedLayerIndex: -1 47 | m_DefaultWeight: 0 48 | m_IKPass: 0 49 | m_SyncedLayerAffectsTiming: 0 50 | m_Controller: {fileID: 9100000} 51 | --- !u!1107 &6810242219007155327 52 | AnimatorStateMachine: 53 | serializedVersion: 6 54 | m_ObjectHideFlags: 1 55 | m_CorrespondingSourceObject: {fileID: 0} 56 | m_PrefabInstance: {fileID: 0} 57 | m_PrefabAsset: {fileID: 0} 58 | m_Name: Base Layer 59 | m_ChildStates: 60 | - serializedVersion: 1 61 | m_State: {fileID: -2837452429741462213} 62 | m_Position: {x: 200, y: 0, z: 0} 63 | m_ChildStateMachines: [] 64 | m_AnyStateTransitions: [] 65 | m_EntryTransitions: [] 66 | m_StateMachineTransitions: {} 67 | m_StateMachineBehaviours: [] 68 | m_AnyStatePosition: {x: 50, y: 20, z: 0} 69 | m_EntryPosition: {x: 50, y: 120, z: 0} 70 | m_ExitPosition: {x: 800, y: 120, z: 0} 71 | m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} 72 | m_DefaultState: {fileID: -2837452429741462213} 73 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Line/Editor/Test/BezierLengthTest.cs: -------------------------------------------------------------------------------- 1 | #if TEST_ENABLE 2 | using UnityEngine; 3 | using UnityEditor; 4 | using UnityEngine.TestTools; 5 | using NUnit.Framework; 6 | using System.Collections; 7 | using System.Collections.Generic; 8 | using System.Linq; 9 | 10 | namespace geniikw.UIMeshLab.Test 11 | { 12 | public class BezierLengthTest 13 | { 14 | Spline testLine; 15 | 16 | [SetUp] 17 | public void Init() 18 | { 19 | testLine = new Spline(); 20 | testLine.points.Add(new Point(Vector3.zero, Vector3.zero, Vector3.zero)); 21 | testLine.points.Add(new Point(Vector3.one, Vector3.left, Vector3.right * 2)); 22 | testLine.points.Add(new Point(Vector3.one * 2, Vector3.zero, Vector3.down)); 23 | 24 | } 25 | 26 | [Test] 27 | public void QuadraticBezierLengthTest() 28 | { 29 | var slow = CurveLength.SumDirections(testLine.points[0], testLine.points[1]); 30 | var fast = CurveLength.Auto(testLine.points[0], testLine.points[1]); 31 | 32 | Debug.Log(slow); 33 | Debug.Log(fast); 34 | var accurate = slow / fast; 35 | 36 | Assert.True(accurate < 1.01f && accurate > 0.99f); 37 | } 38 | 39 | [Test] 40 | public void CubicBezierLengthTest() 41 | { 42 | var testCase = 100; 43 | var testAccuracy = 0.05f; 44 | var results = new List(); 45 | for (int i = 0; i < testCase; i++) 46 | { 47 | var A = new Vector3(0, 0, 0); 48 | var B = new Vector3(Random.Range(0f, 100f), Random.Range(0f, 100f), Random.Range(0f, 100f)); 49 | var C = new Vector3(Random.Range(0f, 100f), Random.Range(0f, 100f), Random.Range(0f, 100f)); 50 | var D = new Vector3(Random.Range(0f, 100f), Random.Range(0f, 100f), Random.Range(0f, 100f)); 51 | 52 | var slow = CurveLength.SumDirections(A, B, C, D); 53 | var fast = CurveLength.Auto(A, B, C, D); 54 | 55 | var accurate = slow / fast; 56 | 57 | results.Add(accurate); 58 | } 59 | Assert.True(results.Average() > 1f - testAccuracy && results.Average() < 1f + testAccuracy); 60 | Debug.Log("Avg accuracy : " + results.Average()); 61 | 62 | } 63 | 64 | 65 | } 66 | } 67 | #endif -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Line/Scripts/Process/MeshBuilder/NormalJointDrawer.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEngine.UI; 5 | 6 | namespace geniikw.DataRenderer2D 7 | { 8 | public class NormalJointDrawer : IJointBuilder 9 | { 10 | readonly ISpline _line; 11 | public NormalJointDrawer(ISpline target) 12 | { 13 | _line = target; 14 | } 15 | 16 | public IEnumerable Build(Spline.Triple triple) 17 | { 18 | ///부채꼴에서 가운데점 19 | var p0 = triple.Position; 20 | 21 | var bd = triple.BackDirection; 22 | var fd = triple.ForwardDirection; 23 | //부채꼴에서 양끝점. 24 | Vector3 p1; 25 | Vector3 p2; 26 | var nv = Vector3.back; 27 | 28 | if ((Vector3.Cross(bd, fd).normalized + nv).magnitude < nv.magnitude) 29 | { 30 | p1 = p0 + Vector3.Cross(nv, bd).normalized * triple.CurrentWidth; 31 | 32 | 33 | p2 = p0 + Vector3.Cross(nv, fd).normalized * triple.CurrentWidth; 34 | } 35 | else 36 | { 37 | p1 = p0 - Vector3.Cross(nv, fd).normalized * triple.CurrentWidth; 38 | p2 = p0 - Vector3.Cross(nv, bd).normalized * triple.CurrentWidth; 39 | } 40 | 41 | var angle = Vector3.Angle(p1 - p0, p2 - p0); 42 | var dc = Mathf.Max(1, Mathf.Floor(angle / _line.Line.option.DivideAngle)); 43 | var da = angle / dc; 44 | 45 | var rot = Quaternion.Euler(-nv * da); 46 | var d = p1 - p0; 47 | 48 | var uv = new Vector2[] { new Vector2(0, 1), new Vector2(1, 1), Vector2.zero, new Vector2(1, 0) }; 49 | if (_line is Image && ((Image)_line).sprite != null) 50 | uv = ((Image)_line).sprite.uv; 51 | 52 | var center = (uv[0] + uv[1] + uv[2] + uv[3]) / 4f; 53 | 54 | for (float a = 0f; a < angle; a += da) 55 | { 56 | var v0 = Vertex.New(p0, center, triple.CurrentColor); 57 | var v1 = Vertex.New(p0 + d, uv[1], triple.CurrentColor); 58 | var v2 = Vertex.New(p0 + rot * d, uv[3], triple.CurrentColor); 59 | yield return new Triangle(v0, v1, v2); 60 | 61 | d = rot * d; 62 | } 63 | 64 | } 65 | 66 | } 67 | } -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Line/Scripts/Process/MeshBuilder/RoundCapDrawer.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | 4 | using UnityEngine; 5 | using UnityEngine.UI; 6 | 7 | namespace geniikw.DataRenderer2D 8 | { 9 | 10 | public class RoundCapDrawer : ICapBuilder 11 | { 12 | ISpline _line; 13 | public RoundCapDrawer(ISpline target) 14 | { 15 | _line = target; 16 | } 17 | 18 | public IEnumerable Build(Spline.LinePair pair, bool isEnd) 19 | { 20 | var normal = Vector3.back; 21 | 22 | var Line = _line.Line; // hardCopy. 23 | 24 | var divide = Line.option.DivideAngle; 25 | 26 | var t = isEnd ? 1f : 0f; 27 | 28 | var color = Line.option.color.Evaluate(isEnd ? Line.option.endRatio : Line.option.startRatio); 29 | var position = pair.GetPoisition(t); 30 | 31 | var radian = pair.GetWidth(t); 32 | 33 | var angle = pair.GetAngle(t); 34 | var direction = pair.GetDirection(isEnd ? 1f : 0f) *(isEnd?-1f:1f); 35 | direction = Quaternion.Euler(0, 0, angle) * direction; 36 | 37 | var wv = Vector3.Cross(direction, normal).normalized; 38 | wv *= radian; 39 | var dc = Mathf.Max(1, Mathf.Floor(180f / divide)); 40 | var da = 180f / dc; 41 | 42 | var uv = new Vector2[] { new(0, 1), new(1, 1), new(0, 0), new (1, 0) }; 43 | if (_line is Image && ((Image)_line).sprite != null) 44 | uv = ((Image)_line).sprite.uv; 45 | 46 | var center = (uv[0] + uv[1] + uv[2] + uv[3]) / 4f; 47 | 48 | for (float a = 0f; a < 180; a += da) 49 | { 50 | if(a + da > 180f) 51 | da = 180f - a; 52 | 53 | var rot = Quaternion.Euler(-normal * da); 54 | var v0 = Vertex.New(position, center, color); 55 | var v1 = Vertex.New(position + wv, (!isEnd ? a > 90 : a < 90) ? uv[1]:uv[0], color); 56 | var v2 = Vertex.New(position + rot * wv, (!isEnd ? a > 90 : a < 90) ? uv[3]:uv[2], color); 57 | //Debug.Log("v0 : "+v0.position+", v1 : "+v1.position+", v2 : "+v2.position); 58 | yield return new Triangle(v0, v1, v2); 59 | 60 | wv = rot * wv; 61 | } 62 | 63 | } 64 | } 65 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | [Ll]ibrary/ 2 | [Tt]emp/ 3 | [Oo]bj/ 4 | build/ 5 | Logs/ 6 | Packages/ 7 | 8 | # Autogenerated VS/MD solution and project files 9 | /*.csproj 10 | /*.unityproj 11 | /*.sln 12 | /*.suo 13 | /*.user 14 | /*.userprefs 15 | /*.pidb 16 | /*.booproj 17 | 18 | #Unity3D Generated File On Crash Reports 19 | sysinfo.txt 20 | 21 | # ========================= 22 | # Operating System Files 23 | # ========================= 24 | 25 | # OSX 26 | # ========================= 27 | 28 | .DS_Store 29 | .AppleDouble 30 | .LSOverride 31 | 32 | # Icon must end with two \r 33 | Icon 34 | 35 | 36 | # Thumbnails 37 | ._* 38 | 39 | # Files that might appear on external disk 40 | .Spotlight-V100 41 | .Trashes 42 | 43 | # Directories potentially created on remote AFP share 44 | .AppleDB 45 | .AppleDesktop 46 | Network Trash Folder 47 | Temporary Items 48 | .apdisk 49 | 50 | # Windows 51 | # ========================= 52 | 53 | # Windows image file caches 54 | Thumbs.db 55 | ehthumbs.db 56 | 57 | # Folder config file 58 | Desktop.ini 59 | 60 | # Recycle Bin used on file shares 61 | $RECYCLE.BIN/ 62 | 63 | # Windows Installer files 64 | *.cab 65 | *.msi 66 | *.msm 67 | *.msp 68 | Assets/AssetStoreTools.meta 69 | Assets/AssetStoreTools/Editor.meta 70 | Assets/AssetStoreTools/Editor/AssetStoreTools.dll 71 | Assets/AssetStoreTools/Editor/AssetStoreTools.dll.meta 72 | Assets/AssetStoreTools/Editor/AssetStoreToolsExtra.dll 73 | Assets/AssetStoreTools/Editor/AssetStoreToolsExtra.dll.meta 74 | Assets/AssetStoreTools/Editor/DroidSansMono.ttf 75 | Assets/AssetStoreTools/Editor/DroidSansMono.ttf.meta 76 | Assets/AssetStoreTools/Editor/icon.png 77 | Assets/AssetStoreTools/Editor/icon.png.meta 78 | Assets/AssetStoreTools/Labels.asset 79 | Assets/AssetStoreTools/Labels.asset.meta 80 | Assets/Origin/Logo.unitypackage 81 | Assets/Origin/Logo.unitypackage.meta 82 | Assets/uimeshtool.unitypackage 83 | Assets/uimeshtool.unitypackage.meta 84 | *.unitypackage 85 | .vs/UIMeshLab/v15/sqlite3/storage.ide 86 | /Assets/Materials/road_road_0021_01_crop.mat.meta 87 | /Assets/Materials/road_road_0021_01_crop.mat 88 | /.vs/Polygon/v15/Server/sqlite3 89 | /.vs/Polygon/v15/Server/sqlite3/storage.ide-wal 90 | /.vs/Polygon/v15/Server/sqlite3/storage.ide-shm 91 | /.vs/Polygon/v15/Server/sqlite3/storage.ide 92 | /.vs/Polygon/v15/Server/sqlite3/db.lock 93 | /.vs/Polygon/DesignTimeBuild/.dtbcache 94 | *.ide-shm 95 | *.dtbcache 96 | *.ide-wal 97 | *.ide 98 | *.lock 99 | 100 | .fake -------------------------------------------------------------------------------- /ProjectSettings/GraphicsSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!30 &1 4 | GraphicsSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 12 7 | m_Deferred: 8 | m_Mode: 1 9 | m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0} 10 | m_DeferredReflections: 11 | m_Mode: 1 12 | m_Shader: {fileID: 74, guid: 0000000000000000f000000000000000, type: 0} 13 | m_ScreenSpaceShadows: 14 | m_Mode: 1 15 | m_Shader: {fileID: 64, guid: 0000000000000000f000000000000000, type: 0} 16 | m_LegacyDeferred: 17 | m_Mode: 1 18 | m_Shader: {fileID: 63, guid: 0000000000000000f000000000000000, type: 0} 19 | m_DepthNormals: 20 | m_Mode: 1 21 | m_Shader: {fileID: 62, guid: 0000000000000000f000000000000000, type: 0} 22 | m_MotionVectors: 23 | m_Mode: 1 24 | m_Shader: {fileID: 75, guid: 0000000000000000f000000000000000, type: 0} 25 | m_LightHalo: 26 | m_Mode: 1 27 | m_Shader: {fileID: 105, guid: 0000000000000000f000000000000000, type: 0} 28 | m_LensFlare: 29 | m_Mode: 1 30 | m_Shader: {fileID: 102, guid: 0000000000000000f000000000000000, type: 0} 31 | m_AlwaysIncludedShaders: 32 | - {fileID: 7, guid: 0000000000000000f000000000000000, type: 0} 33 | - {fileID: 15104, guid: 0000000000000000f000000000000000, type: 0} 34 | - {fileID: 15105, guid: 0000000000000000f000000000000000, type: 0} 35 | - {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0} 36 | - {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} 37 | - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} 38 | - {fileID: 17000, guid: 0000000000000000f000000000000000, type: 0} 39 | - {fileID: 16000, guid: 0000000000000000f000000000000000, type: 0} 40 | m_PreloadedShaders: [] 41 | m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, 42 | type: 0} 43 | m_CustomRenderPipeline: {fileID: 0} 44 | m_TransparencySortMode: 0 45 | m_TransparencySortAxis: {x: 0, y: 0, z: 1} 46 | m_DefaultRenderingPath: 1 47 | m_DefaultMobileRenderingPath: 1 48 | m_TierSettings: [] 49 | m_LightmapStripping: 0 50 | m_FogStripping: 0 51 | m_InstancingStripping: 0 52 | m_LightmapKeepPlain: 1 53 | m_LightmapKeepDirCombined: 1 54 | m_LightmapKeepDynamicPlain: 1 55 | m_LightmapKeepDynamicDirCombined: 1 56 | m_LightmapKeepShadowMask: 1 57 | m_LightmapKeepSubtractive: 1 58 | m_FogKeepLinear: 1 59 | m_FogKeepExp: 1 60 | m_FogKeepExp2: 1 61 | m_AlbedoSwatchInfos: [] 62 | m_LightsUseLinearIntensity: 0 63 | m_LightsUseColorTemperature: 0 64 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Signal/Scripts/Component/UISignal.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | #if UNITY_EDITOR 5 | using UnityEditor; 6 | #endif 7 | 8 | namespace geniikw.DataRenderer2D.Signal 9 | { 10 | [RequireComponent(typeof(RectTransform))] 11 | public class UISignal : UIDataMesh, IUnitSize, ISignalData 12 | { 13 | RectTransform m_rect = null; 14 | RectTransform Rect 15 | { 16 | get 17 | { 18 | if (m_rect == null) 19 | m_rect = GetComponent(); 20 | 21 | return m_rect; 22 | } 23 | } 24 | 25 | public SignalData signal; 26 | public float Speed = 1f; 27 | 28 | SignalBuilder m_meshBuilder = null; 29 | 30 | public void Update() 31 | { 32 | if(Application.isPlaying) 33 | signal.t += Time.deltaTime * Speed; 34 | UpdateGeometry(); 35 | } 36 | 37 | protected new void Reset() 38 | { 39 | signal = SignalData.Default; 40 | } 41 | 42 | protected override IEnumerable DrawerFactory 43 | { 44 | get 45 | { 46 | return (m_meshBuilder ?? (m_meshBuilder =new SignalBuilder(this, this))).Draw(); 47 | } 48 | } 49 | 50 | public Vector2 Size 51 | { 52 | get 53 | { 54 | return Rect.rect.size; 55 | } 56 | } 57 | 58 | public SignalData Signal 59 | { 60 | get 61 | { 62 | return signal; 63 | } 64 | } 65 | 66 | //example. 67 | public void AmpHandler(float amf) 68 | { 69 | signal.up.amplify = amf * 10; 70 | signal.down.amplify = amf * 10; 71 | } 72 | 73 | public void UpUseHandler(bool t) 74 | { 75 | signal.up.use = t; 76 | } 77 | 78 | public void DownUseHandler(bool t) 79 | { 80 | signal.down.use = t; 81 | } 82 | 83 | public void UpFrequencyHandler(float v) 84 | { 85 | signal.up.frequncy = v*20; 86 | } 87 | 88 | } 89 | 90 | 91 | #if UNITY_EDITOR 92 | [CustomEditor(typeof(UISignal))] 93 | public class UISinEditor : Editor 94 | { 95 | 96 | } 97 | #endif 98 | 99 | 100 | 101 | } 102 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Example/Stuff/BackGroundMaterial.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: BackGroundMaterial 10 | m_Shader: {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} 11 | m_ShaderKeywords: _GLOSSYREFLECTIONS_OFF _SPECULARHIGHLIGHTS_OFF 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 | - _BumpMap: 21 | m_Texture: {fileID: 0} 22 | m_Scale: {x: 1, y: 1} 23 | m_Offset: {x: 0, y: 0} 24 | - _DetailAlbedoMap: 25 | m_Texture: {fileID: 0} 26 | m_Scale: {x: 1, y: 1} 27 | m_Offset: {x: 0, y: 0} 28 | - _DetailMask: 29 | m_Texture: {fileID: 0} 30 | m_Scale: {x: 1, y: 1} 31 | m_Offset: {x: 0, y: 0} 32 | - _DetailNormalMap: 33 | m_Texture: {fileID: 0} 34 | m_Scale: {x: 1, y: 1} 35 | m_Offset: {x: 0, y: 0} 36 | - _EmissionMap: 37 | m_Texture: {fileID: 0} 38 | m_Scale: {x: 1, y: 1} 39 | m_Offset: {x: 0, y: 0} 40 | - _MainTex: 41 | m_Texture: {fileID: 0} 42 | m_Scale: {x: 1, y: 1} 43 | m_Offset: {x: 0, y: 0} 44 | - _MetallicGlossMap: 45 | m_Texture: {fileID: 0} 46 | m_Scale: {x: 1, y: 1} 47 | m_Offset: {x: 0, y: 0} 48 | - _OcclusionMap: 49 | m_Texture: {fileID: 0} 50 | m_Scale: {x: 1, y: 1} 51 | m_Offset: {x: 0, y: 0} 52 | - _ParallaxMap: 53 | m_Texture: {fileID: 0} 54 | m_Scale: {x: 1, y: 1} 55 | m_Offset: {x: 0, y: 0} 56 | m_Floats: 57 | - _BumpScale: 1 58 | - _ColorMask: 15 59 | - _Cutoff: 0.207 60 | - _DetailNormalMapScale: 1 61 | - _DstBlend: 0 62 | - _GlossMapScale: 1 63 | - _Glossiness: 0.5 64 | - _GlossyReflections: 0 65 | - _Metallic: 0 66 | - _Mode: 0 67 | - _OcclusionStrength: 1 68 | - _Parallax: 0.02 69 | - _SmoothnessTextureChannel: 0 70 | - _SpecularHighlights: 0 71 | - _SrcBlend: 1 72 | - _Stencil: 0 73 | - _StencilComp: 8 74 | - _StencilOp: 0 75 | - _StencilReadMask: 255 76 | - _StencilWriteMask: 255 77 | - _UVSec: 0 78 | - _UseUIAlphaClip: 0 79 | - _ZWrite: 1 80 | m_Colors: 81 | - _Color: {r: 0.1435986, g: 0.6102941, b: 0.39786723, a: 1} 82 | - _EmissionColor: {r: 0.3317474, g: 0.5128446, b: 0.86764705, a: 1} 83 | -------------------------------------------------------------------------------- /ProjectSettings/NavMeshLayers.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!126 &1 4 | NavMeshLayers: 5 | m_ObjectHideFlags: 0 6 | Built-in Layer 0: 7 | name: Default 8 | cost: 1 9 | editType: 2 10 | Built-in Layer 1: 11 | name: Not Walkable 12 | cost: 1 13 | editType: 0 14 | Built-in Layer 2: 15 | name: Jump 16 | cost: 2 17 | editType: 2 18 | User Layer 0: 19 | name: 20 | cost: 1 21 | editType: 3 22 | User Layer 1: 23 | name: 24 | cost: 1 25 | editType: 3 26 | User Layer 2: 27 | name: 28 | cost: 1 29 | editType: 3 30 | User Layer 3: 31 | name: 32 | cost: 1 33 | editType: 3 34 | User Layer 4: 35 | name: 36 | cost: 1 37 | editType: 3 38 | User Layer 5: 39 | name: 40 | cost: 1 41 | editType: 3 42 | User Layer 6: 43 | name: 44 | cost: 1 45 | editType: 3 46 | User Layer 7: 47 | name: 48 | cost: 1 49 | editType: 3 50 | User Layer 8: 51 | name: 52 | cost: 1 53 | editType: 3 54 | User Layer 9: 55 | name: 56 | cost: 1 57 | editType: 3 58 | User Layer 10: 59 | name: 60 | cost: 1 61 | editType: 3 62 | User Layer 11: 63 | name: 64 | cost: 1 65 | editType: 3 66 | User Layer 12: 67 | name: 68 | cost: 1 69 | editType: 3 70 | User Layer 13: 71 | name: 72 | cost: 1 73 | editType: 3 74 | User Layer 14: 75 | name: 76 | cost: 1 77 | editType: 3 78 | User Layer 15: 79 | name: 80 | cost: 1 81 | editType: 3 82 | User Layer 16: 83 | name: 84 | cost: 1 85 | editType: 3 86 | User Layer 17: 87 | name: 88 | cost: 1 89 | editType: 3 90 | User Layer 18: 91 | name: 92 | cost: 1 93 | editType: 3 94 | User Layer 19: 95 | name: 96 | cost: 1 97 | editType: 3 98 | User Layer 20: 99 | name: 100 | cost: 1 101 | editType: 3 102 | User Layer 21: 103 | name: 104 | cost: 1 105 | editType: 3 106 | User Layer 22: 107 | name: 108 | cost: 1 109 | editType: 3 110 | User Layer 23: 111 | name: 112 | cost: 1 113 | editType: 3 114 | User Layer 24: 115 | name: 116 | cost: 1 117 | editType: 3 118 | User Layer 25: 119 | name: 120 | cost: 1 121 | editType: 3 122 | User Layer 26: 123 | name: 124 | cost: 1 125 | editType: 3 126 | User Layer 27: 127 | name: 128 | cost: 1 129 | editType: 3 130 | User Layer 28: 131 | name: 132 | cost: 1 133 | editType: 3 134 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Signal/Scripts/Builder/SignalBuilder.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace geniikw.DataRenderer2D.Signal 6 | { 7 | public interface ISignalData 8 | { 9 | SignalData Signal { get; } 10 | } 11 | 12 | public class SignalBuilder 13 | { 14 | ISignalData _data; 15 | IUnitSize _unit; 16 | 17 | public SignalBuilder(ISignalData data, IUnitSize unit) 18 | { 19 | _data = data; 20 | _unit = unit; 21 | } 22 | 23 | public void ApplySignal(ref float x0, ref float x1, SignalData.SignalOneSet data) 24 | { 25 | 26 | } 27 | 28 | public IEnumerable Draw() 29 | { 30 | var size = _unit.Size; 31 | 32 | var signal = _data.Signal; 33 | var divide = signal.divide; 34 | var color = signal.Color; 35 | 36 | var width = size.x / divide; 37 | 38 | var v0 = new Vertex(new Vector2(-size.x / 2f, -size.y / 2f), Vector2.zero, Color.white); 39 | var v1 = new Vertex(new Vector2(-size.x / 2f, size.y / 2f), Vector2.zero, Color.white); 40 | var v2 = new Vertex(new Vector2(-size.x / 2f + width, size.y / 2f), Vector2.zero, Color.white); 41 | var v3 = new Vertex(new Vector2(-size.x / 2f + width, -size.y / 2f), Vector2.zero, Color.white); 42 | 43 | for (var i = 0f; i < 1f; i += 1f / divide) 44 | { 45 | var ni = Mathf.Min(1f, i + 1f / divide); 46 | 47 | v0.position.x = -size.x / 2f + i * size.x; 48 | v1.position.x = -size.x / 2f + i * size.x; 49 | v2.position.x = -size.x / 2f + ni * size.x; 50 | v3.position.x = -size.x / 2f + ni * size.x; 51 | 52 | if (signal.up.use) 53 | { 54 | v1.position.y = size.y / 2f + signal.up.Output(i, signal.t); 55 | v2.position.y = size.y / 2f + signal.up.Output(ni, signal.t); 56 | } 57 | if (signal.down.use) 58 | { 59 | v0.position.y = -size.y / 2f + signal.down.Output(i, signal.t); 60 | v3.position.y = -size.y / 2f + signal.down.Output(ni, signal.t); 61 | } 62 | 63 | v0.color = color.Evaluate(i); 64 | v1.color = color.Evaluate(i); 65 | v2.color = color.Evaluate(ni); 66 | v3.color = color.Evaluate(ni); 67 | 68 | yield return new Quad(v0, v3, v1, v2); 69 | } 70 | yield return new Quad(); 71 | } 72 | 73 | } 74 | } -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Signal/Scripts/Signal.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using UnityEngine; 5 | 6 | namespace geniikw.DataRenderer2D.Signal 7 | { 8 | public enum ESignalType 9 | { 10 | Sin 11 | } 12 | 13 | [Serializable] 14 | public struct SignalData 15 | { 16 | [Serializable] 17 | public struct SignalOneSet 18 | { 19 | public bool use; 20 | public float amplify; 21 | public float frequncy; 22 | public float timeFactor; 23 | public AnimationCurve AmpCurve; 24 | public ESignalType type; 25 | 26 | public float Output(float x, float t) 27 | { 28 | return amplify * TypeSwitch((x + t* timeFactor) * frequncy); 29 | } 30 | 31 | private float TypeSwitch(float x) 32 | { 33 | switch (type) 34 | { 35 | case ESignalType.Sin: 36 | return Mathf.Sin(x / Mathf.PI * 2); 37 | default: 38 | return 0f; 39 | } 40 | } 41 | 42 | public static SignalOneSet Default 43 | { 44 | get 45 | { 46 | return new SignalOneSet() 47 | { 48 | use = true, 49 | AmpCurve = AnimationCurve.Linear(0, 0, 1, 1), 50 | amplify = 10, 51 | frequncy = 10, 52 | timeFactor = 1, 53 | type = ESignalType.Sin 54 | }; 55 | } 56 | } 57 | } 58 | 59 | public float t; 60 | public SignalOneSet up; 61 | public SignalOneSet down; 62 | 63 | public float divide; 64 | 65 | //public AnimationCurve ampRightCurve; 66 | //public AnimationCurve ampLeftCurve; 67 | [SerializeField] 68 | Gradient color; 69 | public Gradient Color 70 | { 71 | get 72 | { 73 | return color ?? (color = new Gradient()); 74 | } 75 | } 76 | 77 | //public bool right; 78 | //public bool left; 79 | 80 | public static SignalData Default 81 | { 82 | get 83 | { 84 | return new SignalData() 85 | { 86 | color = new Gradient(), 87 | up = SignalOneSet.Default, 88 | down = SignalOneSet.Default, 89 | divide = 5f, 90 | t = 0f 91 | }; 92 | 93 | } 94 | } 95 | } 96 | } -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Core/MeshMath.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace geniikw.DataRenderer2D 6 | { 7 | ///http://wiki.unity3d.com/index.php/3d_Math_functions 8 | 9 | public class Intersect 10 | { 11 | public static bool LineLineIntersection(out Vector3 intersection, Vector3 linePoint1, Vector3 lineVec1, Vector3 linePoint2, Vector3 lineVec2) 12 | { 13 | 14 | Vector3 lineVec3 = linePoint2 - linePoint1; 15 | Vector3 crossVec1and2 = Vector3.Cross(lineVec1, lineVec2); 16 | Vector3 crossVec3and2 = Vector3.Cross(lineVec3, lineVec2); 17 | 18 | float planarFactor = Vector3.Dot(lineVec3, crossVec1and2); 19 | 20 | //is coplanar, and not parrallel 21 | if (Mathf.Abs(planarFactor) < 0.0001f && crossVec1and2.sqrMagnitude > 0.0001f) 22 | { 23 | float s = Vector3.Dot(crossVec3and2, crossVec1and2) / crossVec1and2.sqrMagnitude; 24 | intersection = linePoint1 + (lineVec1 * s); 25 | return true; 26 | } 27 | else 28 | { 29 | intersection = Vector3.zero; 30 | return false; 31 | } 32 | } 33 | 34 | //Two non-parallel lines which may or may not touch each other have a point on each line which are closest 35 | //to each other. This function finds those two points. If the lines are not parallel, the function 36 | //outputs true, otherwise false. 37 | public static bool ClosestPointsOnTwoLines(out Vector3 closestPointLine1, out Vector3 closestPointLine2, Vector3 linePoint1, Vector3 lineVec1, Vector3 linePoint2, Vector3 lineVec2) 38 | { 39 | if((linePoint1 - linePoint2).sqrMagnitude < Mathf.Epsilon) 40 | { 41 | closestPointLine1 = linePoint1; 42 | closestPointLine2 = linePoint2; 43 | return true; 44 | } 45 | 46 | 47 | closestPointLine1 = Vector3.zero; 48 | closestPointLine2 = Vector3.zero; 49 | 50 | float a = Vector3.Dot(lineVec1, lineVec1); 51 | float b = Vector3.Dot(lineVec1, lineVec2); 52 | float e = Vector3.Dot(lineVec2, lineVec2); 53 | 54 | float d = a * e - b * b; 55 | 56 | //lines are not parallel 57 | if (d != 0.0f) 58 | { 59 | 60 | Vector3 r = linePoint1 - linePoint2; 61 | float c = Vector3.Dot(lineVec1, r); 62 | float f = Vector3.Dot(lineVec2, r); 63 | 64 | float s = (b * f - c * e) / d; 65 | float t = (a * f - c * b) / d; 66 | 67 | closestPointLine1 = linePoint1 + lineVec1 * s; 68 | closestPointLine2 = linePoint2 + lineVec2 * t; 69 | 70 | return true; 71 | } 72 | 73 | else 74 | { 75 | return false; 76 | } 77 | } 78 | } 79 | } -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Line/Scripts/Process/Static/CurveLength.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace geniikw.DataRenderer2D { 6 | 7 | public static class CurveLength { 8 | /// 9 | /// for test 10 | /// 11 | public static float SumDirections(Point n0, Point n1) 12 | { 13 | return SumDirections(n0.position, n0.NextControlPosition, n1.PreviousControlPoisition, n1.position); 14 | } 15 | /// 16 | /// for test 17 | /// 18 | public static float SumDirections(Vector3 p0, Vector3 c0, Vector3 c1, Vector3 p1) 19 | { 20 | var length = 0f; 21 | var dt = 0.01f; 22 | for (float t = dt; t < 1f; t += dt) 23 | { 24 | var fst = Curve.Auto(p0,c0,c1,p1, t - dt); 25 | var sec = Curve.Auto(p0,c0,c1,p1, t); 26 | 27 | length += Vector3.Distance(fst, sec); 28 | } 29 | return length; 30 | } 31 | 32 | 33 | public static float Auto(Point n0, Point n1) 34 | { 35 | return Auto(n0.position, n0.NextControlPosition, n1.PreviousControlPoisition, n1.position); 36 | } 37 | public static float Auto(Vector3 p0, Vector3 c0, Vector3 c1, Vector3 p1) 38 | { 39 | if (c0 == p0 && p1 == c1) 40 | return Vector3.Distance(p0, p1); 41 | if (c0 == p0 || c1 == p1) 42 | return Quadratic(p0, c0==p0 ? c1 : c0 , p1); 43 | 44 | return QuadraticApproximation(p0, c0, c1, p1); 45 | } 46 | 47 | /// 48 | /// ref : https://github.com/HTD/FastBezier/blob/master/Program.cs 49 | /// 50 | static float Quadratic(Vector3 p0, Vector3 cp, Vector3 p1) 51 | { 52 | if (p0 == p1) 53 | if (p0 == cp) 54 | return 0f; 55 | else 56 | return Vector3.Distance(p0, cp); 57 | if (p0 == cp || p1 == cp) 58 | return Vector3.Distance(p0, p1); 59 | 60 | Vector3 A0 = cp - p0; 61 | Vector3 A1 = p0 - 2.0f * cp + p1; 62 | 63 | if (A1 == Vector3.zero) 64 | return 2.0f * A0.magnitude; 65 | 66 | var c = 4f * Vector3.Dot(A1, A1); 67 | var b = 8f * Vector3.Dot(A0, A1); 68 | var a = 4f * Vector3.Dot(A0, A0); 69 | var q = 4f * a * c - b * b; 70 | var twoCpB = 2f * c + b; 71 | var sumCBA = c + b + a; 72 | var l0 = (0.25f / c) * (twoCpB * Mathf.Sqrt(sumCBA) - b * Mathf.Sqrt(a)); 73 | 74 | if (q == 0f) 75 | return l0; 76 | 77 | var l1 = (q / (8f * Mathf.Pow(c, 1.5f))) * (Mathf.Log(2.0f * Mathf.Sqrt(c * sumCBA) + twoCpB)- Mathf.Log(2.0f * Mathf.Sqrt(c * a) + b)); 78 | return l0 + l1; 79 | } 80 | 81 | static float QuadraticApproximation(Vector3 p0, Vector3 c0, Vector3 c1, Vector3 p1) 82 | { 83 | return Quadratic(p0, (3f * c1 - p1 + 3f * c0 - p0)/4f, p1); 84 | } 85 | 86 | } 87 | } -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Line/Editor/SplinePropertyDrawer.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEditor; 5 | namespace geniikw.DataRenderer2D.Editors 6 | { 7 | [CustomPropertyDrawer(typeof(Spline))] 8 | public class SplinePropertyDrawer : PropertyDrawer 9 | { 10 | float PointHeight { get 11 | { 12 | if (EditorSetting.Get.onlyViewWidth) 13 | return 1.2f; 14 | else 15 | return 7.7f; 16 | } 17 | } 18 | 19 | public override float GetPropertyHeight(SerializedProperty property, GUIContent label) 20 | { 21 | var height = 1f; 22 | var mode = property.FindPropertyRelative("mode").enumValueIndex; 23 | 24 | if (mode == 0) 25 | height += (property.FindPropertyRelative("points").isExpanded? property.FindPropertyRelative("points").arraySize* PointHeight + 2f : 1f ); 26 | else if (mode == 1) 27 | height += (property.FindPropertyRelative("pair").isExpanded ? 2f * PointHeight + 2f: 1f); 28 | 29 | height += property.FindPropertyRelative("option").isExpanded ? 10f : 1f; ; 30 | 31 | return height * EditorGUIUtility.singleLineHeight; 32 | } 33 | 34 | 35 | public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) 36 | { 37 | property.serializedObject.Update(); 38 | position.height = EditorGUIUtility.singleLineHeight; 39 | EditorGUI.PropertyField(position, property.FindPropertyRelative("mode")); 40 | position.y += EditorGUIUtility.singleLineHeight; 41 | 42 | var mode = property.FindPropertyRelative("mode").enumValueIndex; 43 | var height = 0f; 44 | if (mode == 0) 45 | { 46 | height = property.FindPropertyRelative("points").isExpanded ? (property.FindPropertyRelative("points").arraySize* PointHeight + 2f) : 1f; 47 | height *= EditorGUIUtility.singleLineHeight; 48 | position.height = height; 49 | EditorGUI.PropertyField(position, property.FindPropertyRelative("points"), true); 50 | position.y += height; 51 | } 52 | else if (mode == 1) 53 | { 54 | height = property.FindPropertyRelative("pair").isExpanded ? 2f* PointHeight+2f : 1f; 55 | height *= EditorGUIUtility.singleLineHeight; 56 | 57 | position.height = height; 58 | EditorGUI.PropertyField(position, property.FindPropertyRelative("pair"), true); 59 | position.y += height; 60 | } 61 | 62 | 63 | height = property.FindPropertyRelative("option").isExpanded ? 10f : 1f; 64 | height *= EditorGUIUtility.singleLineHeight; 65 | position.height = height; 66 | EditorGUI.PropertyField(position, property.FindPropertyRelative("option"),true); 67 | 68 | property.serializedObject.ApplyModifiedProperties(); 69 | //base.OnGUI(position, property, label); 70 | } 71 | 72 | 73 | 74 | } 75 | } -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Line/Scripts/Process/MeshBuilder/NormalBezierDrawer.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEngine.UI; 5 | 6 | namespace geniikw.DataRenderer2D 7 | { 8 | public class NormalBezierDrawer : IBezierBuilder 9 | { 10 | readonly ISpline _line; 11 | 12 | public NormalBezierDrawer(ISpline line) 13 | { 14 | _line = line; 15 | } 16 | 17 | public IEnumerable Build(Spline.LinePair pair) 18 | { 19 | var LineData = _line.Line;//hard copy. 20 | 21 | float dt = pair.GetDT(LineData.option.DivideLength); 22 | Vector3 prv1 = Vector3.zero; 23 | Vector3 prv2 = Vector3.zero; 24 | /// todo : too complicate need split code for test or something. 25 | for (float t = pair.start; t < pair.end; t += dt) 26 | { 27 | if(t + dt > pair.end) 28 | dt = pair.end - t; 29 | 30 | var ws = Mathf.Lerp(pair.n0.width, pair.n1.width, t); 31 | var we = Mathf.Lerp(pair.n0.width, pair.n1.width, t+dt); 32 | 33 | var ps = Curve.Auto(pair.n0, pair.n1, t); 34 | var pe = Curve.Auto(pair.n0, pair.n1, Mathf.Min(pair.end,t + dt)); 35 | 36 | var angle1 = Mathf.Lerp(pair.n0.forwardAngle, pair.n1.backAngle, t); 37 | var angle2 = Mathf.Lerp(pair.n0.forwardAngle, pair.n1.backAngle, t + dt); 38 | 39 | 40 | var cs = LineData.option.color.Evaluate(pair.sRatio + t * pair.RatioLength); 41 | var ce = LineData.option.color.Evaluate(pair.sRatio + (t+dt) * pair.RatioLength); 42 | 43 | var d = pe - ps; 44 | var wd = Vector3.Cross(d, Vector3.back).normalized; 45 | 46 | wd = Quaternion.Euler(0, 0, angle2) * wd; 47 | 48 | 49 | var startStartWidth = Vector3.Cross(pair.GetDirection(0f), Vector3.back).normalized ; 50 | var endEndWidth = Vector3.Cross(pair.GetDirection(1f), Vector3.back).normalized; 51 | 52 | 53 | startStartWidth = Quaternion.Euler(0, 0, angle1) * startStartWidth; 54 | endEndWidth = Quaternion.Euler(0, 0, angle2) * endEndWidth; 55 | 56 | 57 | var uv = new Vector2[] { new(0, 1), new(1, 1), new(0, 0), new(1, 0) }; 58 | 59 | if (_line is Image && ((Image)_line).sprite != null) 60 | uv = ((Image)_line).sprite.uv; 61 | 62 | var p0 = Vertex.New(t == pair.start ? ps + startStartWidth * ws : prv1, uv[0], cs); 63 | var p1 = Vertex.New(t == pair.start ? ps - startStartWidth * ws : prv2, uv[1], cs); 64 | 65 | var end = t + dt == pair.end; 66 | 67 | var p2 = Vertex.New(end ? pe + endEndWidth * we : pe + wd * we, uv[2], ce); 68 | var p3 = Vertex.New(end ? pe - endEndWidth * we : pe - wd * we, uv[3], ce); 69 | 70 | prv1 = pe + wd * we; 71 | prv2 = pe - wd * we; 72 | 73 | yield return new Quad(p0, p1, p2, p3); 74 | } 75 | 76 | } 77 | } 78 | } -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Line/Scripts/Process/MeshBuilder/LineBuilder.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace geniikw.DataRenderer2D 6 | { 7 | /// 8 | /// converter (Line -> MeshData) 9 | /// 10 | /// 11 | 12 | public class LineBuilder : IMeshDrawer 13 | { 14 | readonly IBezierBuilder _bezierDrawer; 15 | readonly IJointBuilder _jointDrawer; 16 | readonly IJointBuilder _jointIntersectDrawer; 17 | readonly ICapBuilder _capDrawer; 18 | readonly ISpline _line; 19 | 20 | public LineBuilder(IBezierBuilder b, IJointBuilder j,IJointBuilder js, ICapBuilder c, ISpline line){ 21 | _bezierDrawer = b; 22 | _jointDrawer = j; 23 | _capDrawer = c; 24 | _line = line; 25 | _jointIntersectDrawer = js; 26 | } 27 | 28 | public IEnumerable Draw() 29 | { 30 | if (_line.Line.option.endRatio - _line.Line.option.startRatio <= 0) 31 | yield break; 32 | 33 | //todo : merge Pairlist with TripleList to one iteration. 34 | var ff = true; 35 | Spline.LinePair last = new Spline.LinePair(); 36 | foreach(var pair in _line.Line.TargetPairList) 37 | { 38 | if (ff) 39 | { 40 | ff = false; 41 | if (_line.Line.option.mode == LineOption.Mode.RoundEdge)// && pairList.Count() > 0) 42 | { 43 | foreach (var mesh in _capDrawer.Build(pair, false)) 44 | { 45 | yield return mesh; 46 | } 47 | } 48 | } 49 | 50 | 51 | foreach (var mesh in _bezierDrawer.Build(pair)) 52 | { 53 | yield return mesh; 54 | } 55 | last = pair; 56 | } 57 | 58 | foreach (var triple in _line.Line.TripleList) 59 | { 60 | var joint = _line.Line.option.jointOption == LineOption.LineJointOption.round ? _jointDrawer : _jointIntersectDrawer; 61 | 62 | foreach (var mesh in joint.Build(triple)) 63 | { 64 | yield return mesh; 65 | } 66 | } 67 | 68 | if(_line.Line.option.mode == LineOption.Mode.RoundEdge) 69 | { 70 | foreach (var mesh in _capDrawer.Build(last, true)) 71 | { 72 | yield return mesh; 73 | } 74 | } 75 | } 76 | 77 | public class Factory 78 | { 79 | public static IMeshDrawer Normal(ISpline line, Transform trans) 80 | { 81 | var builder = new LineBuilder 82 | ( 83 | new NormalBezierDrawer(line), 84 | new NormalJointDrawer(line), 85 | new IntersectJointDrawer(line), 86 | new RoundCapDrawer(line), 87 | line 88 | ); 89 | 90 | return builder; 91 | } 92 | } 93 | 94 | } 95 | } -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Polygon/Editor/PolygonPropertyDrawer.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEditor; 5 | 6 | namespace geniikw.DataRenderer2D.Polygon.Editors 7 | { 8 | [CustomPropertyDrawer(typeof(PolygonData))] 9 | public class PolygonPropertyDrawer : PropertyDrawer 10 | { 11 | public override float GetPropertyHeight(SerializedProperty property, GUIContent label) 12 | { 13 | var height = 5f; 14 | property.serializedObject.Update(); 15 | var type = (PolygonType)property.FindPropertyRelative("type").enumValueIndex; 16 | if (type >= PolygonType.Hole) 17 | height += 3f; 18 | 19 | if (type == PolygonType.HoleCurve) 20 | height += 1; 21 | if (type >= PolygonType.HoleCenterColor) 22 | height += 1; 23 | 24 | 25 | height *= EditorGUIUtility.singleLineHeight; 26 | return height; 27 | } 28 | 29 | public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) 30 | { 31 | property.serializedObject.Update(); 32 | position.height = EditorGUIUtility.singleLineHeight; 33 | var type = (PolygonType)property.FindPropertyRelative("type").enumValueIndex; 34 | 35 | EditorGUI.PropertyField(position, property.FindPropertyRelative("type")); 36 | position.y += EditorGUIUtility.singleLineHeight; 37 | EditorGUI.PropertyField(position, property.FindPropertyRelative("sinCft")); 38 | position.y += EditorGUIUtility.singleLineHeight; 39 | EditorGUI.PropertyField(position, property.FindPropertyRelative("cosCft")); 40 | position.y += EditorGUIUtility.singleLineHeight; 41 | EditorGUI.PropertyField(position, property.FindPropertyRelative("count")); 42 | position.y += EditorGUIUtility.singleLineHeight; 43 | EditorGUI.PropertyField(position, property.FindPropertyRelative("outerColor")); 44 | 45 | if (type >= PolygonType.Hole) 46 | { 47 | position.y += EditorGUIUtility.singleLineHeight; 48 | EditorGUI.PropertyField(position, property.FindPropertyRelative("startAngle")); 49 | position.y += EditorGUIUtility.singleLineHeight; 50 | EditorGUI.PropertyField(position, property.FindPropertyRelative("endAngle")); 51 | position.y += EditorGUIUtility.singleLineHeight; 52 | EditorGUI.PropertyField(position, property.FindPropertyRelative("innerRatio")); 53 | 54 | } 55 | 56 | if(type >= PolygonType.HoleCenterColor) 57 | { 58 | position.y += EditorGUIUtility.singleLineHeight; 59 | EditorGUI.PropertyField(position, property.FindPropertyRelative("centerColor")); 60 | } 61 | 62 | if (type == PolygonType.HoleCurve) 63 | { 64 | position.y += EditorGUIUtility.singleLineHeight; 65 | EditorGUI.PropertyField(position, property.FindPropertyRelative("curve")); 66 | } 67 | 68 | property.serializedObject.ApplyModifiedProperties(); 69 | 70 | //base.OnGUI(position, property, label); 71 | } 72 | } 73 | } -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Line/Scripts/Process/Static/Curve.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace geniikw.DataRenderer2D 4 | { 5 | /// 6 | /// Mathmaical stuff. 7 | /// 8 | 9 | public static class Curve 10 | { 11 | public static Vector3 Auto(Vector3 p0, Vector3 c0, Vector3 c1, Vector3 p1, float t) 12 | { 13 | t = Mathf.Clamp01(t); 14 | if (c0 == p0 && c1 == p1) 15 | return Vector3.Lerp(p0, p1, t); 16 | 17 | if (c0 == p0 || c1 == p1) 18 | return Quadratic(p0, c0 == p0 ? c1 : c0, p1, t); 19 | 20 | return Cubic(p0, c0, c1, p1, t); 21 | } 22 | 23 | public static Vector3 Auto(Point n0, Point n1, float t) 24 | { 25 | var p0 = n0.position; 26 | var c0 = n0.NextControlPosition; 27 | var c1 = n1.PreviousControlPoisition; 28 | var p1 = n1.position; 29 | 30 | return Auto(p0, c0, c1, p1, t); 31 | } 32 | 33 | public static Vector3 AutoDirection(Point n0, Point n1, float t) 34 | { 35 | var p0 = n0.position; 36 | var c0 = n0.NextControlPosition; 37 | var c1 = n1.PreviousControlPoisition; 38 | var p1 = n1.position; 39 | 40 | return AutoDirection(p0, c0, c1, p1, t); 41 | } 42 | 43 | 44 | public static Vector3 AutoDirection(Vector3 p0, Vector3 c0, Vector3 c1, Vector3 p1, float t) 45 | { 46 | var dif0 = p0 - c0; 47 | var dif1 = p1 - c1; 48 | 49 | if (dif0 == Vector3.zero && dif1 == Vector3.zero) 50 | return (p1 - p0).normalized; 51 | 52 | if (dif0 == Vector3.zero || dif1 == Vector3.zero) 53 | return QuadraticDirection(p0, dif0 == Vector3.zero ? c1 : c0, p1, t); 54 | t = Mathf.Clamp01(t); 55 | return CubicDirection(p0, c0, c1, p1, t); 56 | } 57 | 58 | public static Vector3 CubicDirection(Point n0, Point n1, float t) 59 | { 60 | var p0 = n0.position; 61 | var c0 = n0.NextControlPosition; 62 | var c1 = n1.PreviousControlPoisition; 63 | var p1 = n1.position; 64 | return CubicDirection(p0, c0, c1, p1, t); 65 | } 66 | 67 | public static Vector3 CubicDirection(Vector3 p0, Vector3 p1, Vector3 p2, Vector3 p3, float t) 68 | { 69 | float mt = 1f - t; 70 | return (3f * mt * mt * (p1 - p0) + 6f * mt * t * (p2 - p1) + 3f * t * t * (p3 - p2)); 71 | } 72 | 73 | public static Vector3 Cubic(Vector3 p0, Vector3 p1, Vector3 p2, Vector3 p3, float t) 74 | { 75 | float mt = 1f - t; 76 | return p0 * mt * mt * mt + 3f * p1 * mt * mt * t + 3f * p2 * mt * t * t + p3 * t * t * t; 77 | } 78 | 79 | /* it doesn't use*/ 80 | public static Vector3 QuadraticDirection(Vector3 p0, Vector3 p1, Vector3 p2, float t) 81 | { 82 | float mt = 1f - t; 83 | return 2f * mt * (p1 - p0) + 2f * t * (p2 - p1); 84 | } 85 | 86 | public static Vector3 Quadratic(Vector3 p0, Vector3 c, Vector3 p1, float t) 87 | { 88 | float mt = 1f - t; 89 | return p0 * mt * mt + 2f * c * mt * t + p1 * t * t; 90 | } 91 | 92 | 93 | } 94 | } -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Line/Editor/PointPropertyDrawer.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEditor; 5 | using System.Text.RegularExpressions; 6 | 7 | namespace geniikw.DataRenderer2D.Editors 8 | { 9 | [CustomPropertyDrawer(typeof(Point))] 10 | public class PointPropertyDrawer : PropertyDrawer 11 | { 12 | public override float GetPropertyHeight(SerializedProperty property, GUIContent label) 13 | { 14 | var lineCount = 7.5f; 15 | 16 | if (EditorSetting.Get.onlyViewWidth) 17 | lineCount = 1f; 18 | 19 | return lineCount * EditorGUIUtility.singleLineHeight; 20 | } 21 | 22 | public override void OnGUI(Rect position, SerializedProperty sp, GUIContent label) 23 | { 24 | var labelPos = position; 25 | labelPos.x = 0f; 26 | 27 | EditorGUI.LabelField(labelPos, (Regex.Match(label.text, @"\d+").Value).ToString()); 28 | 29 | var pos = position; 30 | pos.height = EditorGUIUtility.singleLineHeight; 31 | if (!EditorSetting.Get.onlyViewWidth) 32 | { 33 | EditorGUI.PropertyField(pos, sp.Position()); 34 | pos.y += EditorGUIUtility.singleLineHeight; 35 | 36 | EditorGUI.PropertyField(pos, sp.Width()); 37 | pos.y += EditorGUIUtility.singleLineHeight; 38 | 39 | EditorGUI.PropertyField(pos, sp.NextOffset()); 40 | pos.y += EditorGUIUtility.singleLineHeight; 41 | 42 | EditorGUI.PropertyField(pos, sp.PrevOffset()); 43 | pos.y += EditorGUIUtility.singleLineHeight; 44 | 45 | EditorGUI.PropertyField(pos, sp.StartAngle()); 46 | pos.y += EditorGUIUtility.singleLineHeight; 47 | 48 | EditorGUI.PropertyField(pos, sp.EndAngle()); 49 | pos.y += EditorGUIUtility.singleLineHeight; 50 | 51 | pos.height /= 2f; 52 | EditorGUI.DrawRect(pos, Color.black); 53 | } 54 | else 55 | { 56 | EditorGUI.PropertyField(pos, sp.Width()); 57 | } 58 | } 59 | 60 | } 61 | static class SerializedPropertyAccessor 62 | { 63 | public static SerializedProperty Position(this SerializedProperty sp) 64 | { 65 | return sp.FindPropertyRelative("position"); 66 | } 67 | public static SerializedProperty PrevOffset(this SerializedProperty sp) 68 | { 69 | return sp.FindPropertyRelative("previousControlOffset"); 70 | } 71 | public static SerializedProperty NextOffset(this SerializedProperty sp) 72 | { 73 | return sp.FindPropertyRelative("nextControlOffset"); 74 | } 75 | public static SerializedProperty Width(this SerializedProperty sp) 76 | { 77 | return sp.FindPropertyRelative("width"); 78 | } 79 | public static SerializedProperty StartAngle(this SerializedProperty sp) 80 | { 81 | return sp.FindPropertyRelative("forwardAngle"); 82 | } 83 | public static SerializedProperty EndAngle(this SerializedProperty sp) 84 | { 85 | return sp.FindPropertyRelative("backAngle"); 86 | } 87 | 88 | 89 | } 90 | } -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Line/Scripts/Process/MeshBuilder/IntersectJointDrawer.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEngine.UI; 5 | 6 | namespace geniikw.DataRenderer2D 7 | { 8 | public class IntersectJointDrawer : IJointBuilder 9 | { 10 | readonly ISpline _line; 11 | public IntersectJointDrawer(ISpline target) 12 | { 13 | _line = target; 14 | } 15 | 16 | public IEnumerable Build(Spline.Triple triple) 17 | { 18 | ///부채꼴에서 가운데점 19 | var p0 = triple.Position; 20 | 21 | var bd = triple.BackDirection; 22 | var fd = triple.ForwardDirection; 23 | //부채꼴에서 양끝점. 24 | Vector3 p1; 25 | Vector3 p2; 26 | var nv = Vector3.back; 27 | 28 | if ((Vector3.Cross(bd, fd).normalized + nv).magnitude < nv.magnitude) 29 | { 30 | p1 = p0 + Vector3.Cross(nv, bd).normalized * triple.CurrentWidth; 31 | p2 = p0 + Vector3.Cross(nv, fd).normalized * triple.CurrentWidth; 32 | } 33 | else 34 | { 35 | p1 = p0 - Vector3.Cross(nv, fd).normalized * triple.CurrentWidth; 36 | p2 = p0 - Vector3.Cross(nv, bd).normalized * triple.CurrentWidth; 37 | } 38 | 39 | 40 | var v1 = Vector3.Cross(p1-p0, Vector3.back); 41 | var v2 = Vector3.Cross(p2-p0, Vector3.back); 42 | 43 | Vector3 cp; 44 | ClosestPointsOnTwoLines(out cp, out cp, p1, v1, p2, v2); 45 | 46 | var uv = new Vector2[] { new Vector2(0, 1), new Vector2(1, 1), Vector2.zero, new Vector2(1, 0) }; 47 | if (_line is Image && ((Image)_line).sprite != null) 48 | uv = ((Image)_line).sprite.uv; 49 | var center = (uv[0] + uv[1] + uv[2] + uv[3]) / 4f; 50 | 51 | var vertice = new Vertex[] { 52 | Vertex.New(p0, center, triple.CurrentColor), 53 | Vertex.New(p1, uv[1], triple.CurrentColor), 54 | Vertex.New(p2, uv[1], triple.CurrentColor), 55 | Vertex.New(cp, uv[3], triple.CurrentColor) 56 | }; 57 | 58 | yield return new Triangle(vertice[0], vertice[1], vertice[3]); 59 | yield return new Triangle(vertice[0], vertice[3], vertice[2]); 60 | 61 | } 62 | 63 | 64 | private bool ClosestPointsOnTwoLines(out Vector3 closestPointLine1, out Vector3 closestPointLine2, Vector3 linePoint1, Vector3 lineVec1, Vector3 linePoint2, Vector3 lineVec2) 65 | { 66 | closestPointLine1 = Vector3.zero; 67 | closestPointLine2 = Vector3.zero; 68 | 69 | float a = Vector3.Dot(lineVec1, lineVec1); 70 | float b = Vector3.Dot(lineVec1, lineVec2); 71 | float e = Vector3.Dot(lineVec2, lineVec2); 72 | 73 | float d = a * e - b * b; 74 | 75 | //lines are not parallel 76 | if (d != 0.0f) 77 | { 78 | 79 | Vector3 r = linePoint1 - linePoint2; 80 | float c = Vector3.Dot(lineVec1, r); 81 | float f = Vector3.Dot(lineVec2, r); 82 | 83 | float s = (b * f - c * e) / d; 84 | float t = (a * f - c * b) / d; 85 | 86 | closestPointLine1 = linePoint1 + lineVec1 * s; 87 | closestPointLine2 = linePoint2 + lineVec2 * t; 88 | 89 | return true; 90 | } 91 | 92 | else 93 | { 94 | return false; 95 | } 96 | } 97 | 98 | } 99 | } -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Hole/HoleInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using UnityEngine; 5 | 6 | 7 | namespace geniikw.DataRenderer2D.Hole 8 | { 9 | 10 | [Serializable] 11 | public struct HoleInfo 12 | { 13 | [SerializeField] 14 | [Range(3, 30)] 15 | private int inner; 16 | 17 | 18 | 19 | [SerializeField] 20 | [Range(-0.5f, 0.5f)] 21 | private float offsetY; 22 | 23 | [SerializeField] 24 | [Range(-0.5f, 0.5f)] 25 | private float offsetX; 26 | 27 | [SerializeField] 28 | [Range(0, 1)] 29 | private float sizeX; 30 | 31 | [SerializeField] 32 | [Range(0, 1)] 33 | private float sizeY; 34 | 35 | [SerializeField] 36 | private float angle; 37 | [SerializeField] 38 | private Color color; 39 | 40 | public Action editCallback; 41 | 42 | public int Inner 43 | { 44 | get 45 | { 46 | return inner; 47 | } 48 | 49 | set 50 | { 51 | if (editCallback != null) 52 | { 53 | editCallback(); 54 | } 55 | inner = value; 56 | } 57 | } 58 | 59 | 60 | 61 | public float Angle 62 | { 63 | get 64 | { 65 | return angle; 66 | } 67 | 68 | set 69 | { 70 | if (editCallback != null) 71 | { 72 | editCallback(); 73 | } 74 | angle = value; 75 | } 76 | } 77 | 78 | public Color Color 79 | { 80 | get 81 | { 82 | return color; 83 | } 84 | 85 | set 86 | { 87 | if (editCallback != null) 88 | { 89 | editCallback(); 90 | } 91 | color = value; 92 | } 93 | } 94 | 95 | public float OffsetY 96 | { 97 | get 98 | { 99 | return offsetY; 100 | } 101 | 102 | set 103 | { 104 | if (editCallback != null) 105 | { 106 | editCallback(); 107 | } 108 | offsetY = value; 109 | } 110 | } 111 | 112 | public float OffsetX 113 | { 114 | get 115 | { 116 | return offsetX; 117 | } 118 | 119 | set 120 | { 121 | if (editCallback != null) 122 | { 123 | editCallback(); 124 | } 125 | offsetX = value; 126 | } 127 | } 128 | 129 | public float SizeX 130 | { 131 | get 132 | { 133 | return sizeX; 134 | } 135 | 136 | set 137 | { 138 | if (editCallback != null) 139 | { 140 | editCallback(); 141 | } 142 | sizeX = value; 143 | } 144 | } 145 | 146 | public float SizeY 147 | { 148 | get 149 | { 150 | return sizeY; 151 | } 152 | 153 | set 154 | { 155 | if (editCallback != null) 156 | { 157 | editCallback(); 158 | } 159 | sizeY = value; 160 | } 161 | } 162 | } 163 | } -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Line/Scripts/Data/Line.Editor.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using System; 5 | 6 | namespace geniikw.DataRenderer2D 7 | { 8 | public partial struct Spline 9 | { 10 | public void Initialize() { 11 | this = Default; 12 | } 13 | 14 | /// 15 | /// 중간에 p.position이 worldposition에서 localposition으로 바꿈. 16 | /// 17 | /// 18 | public void Push(Point p) 19 | { 20 | if (mode == LineMode.BezierMode) 21 | throw new Exception("can't add"); 22 | 23 | p.position = owner.transform.InverseTransformPoint(p.position); 24 | 25 | points.Add(p); 26 | 27 | if (EditCallBack != null) 28 | EditCallBack(); 29 | } 30 | 31 | public void Push() 32 | { 33 | Push(Point.Zero); 34 | } 35 | 36 | 37 | public void Push(Vector3 worldPosition, Vector3 nextOffset, Vector3 prevOffset, float width) 38 | { 39 | Push(new Point(worldPosition, nextOffset, prevOffset, width)); 40 | } 41 | 42 | public void EditPoint(int idx, Point p) 43 | { 44 | if(mode == LineMode.BezierMode &&( idx <0 || idx > 2)) 45 | { 46 | throw new Exception("can't edit"); 47 | } 48 | if (points.Count <= idx || idx < 0) 49 | { 50 | throw new Exception("can't edit" + points.Count + " " + idx); 51 | } 52 | 53 | p.position = owner.transform.InverseTransformPoint(p.position); 54 | if (mode == LineMode.BezierMode) 55 | { 56 | if (idx == 0) 57 | pair.n0 = p; 58 | else 59 | pair.n1 = p; 60 | } 61 | else 62 | { 63 | points[idx] = p; 64 | } 65 | 66 | if (EditCallBack != null) 67 | EditCallBack(); 68 | } 69 | 70 | /// 71 | /// edit last point. 72 | /// 73 | /// 74 | public void EditPoint(Vector3 worldPos) 75 | { 76 | EditPoint(points.Count - 1, new Point(worldPos, Vector3.zero, Vector3.zero)); 77 | } 78 | 79 | public void EditPoint(int idx, Vector3 worldPos, Vector3 nOffset, Vector3 pOffset, float width) 80 | { 81 | EditPoint(idx, new Point(worldPos, nOffset, pOffset, width)); 82 | } 83 | 84 | public void EditPoint(int idx, Vector3 worldPos, float width) 85 | { 86 | EditPoint(idx,worldPos, Vector3.zero, Vector3.zero, width); 87 | } 88 | 89 | /// 90 | /// remove last point 91 | /// 92 | /// 93 | public Point Pop() 94 | { 95 | if (mode == LineMode.BezierMode) 96 | throw new Exception("can't remove"); 97 | 98 | var last = points[points.Count - 1]; 99 | points.RemoveAt(points.Count - 1); 100 | 101 | if (EditCallBack != null) 102 | EditCallBack(); 103 | 104 | return last; 105 | } 106 | 107 | public int Count 108 | { 109 | get 110 | { 111 | if (mode == LineMode.BezierMode) 112 | return 2; 113 | return points.Count; 114 | } 115 | } 116 | public void Clear() 117 | { 118 | points.Clear(); 119 | if (EditCallBack != null) 120 | EditCallBack(); 121 | } 122 | 123 | } 124 | } -------------------------------------------------------------------------------- /ProjectSettings/SceneTemplateSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "templatePinStates": [], 3 | "dependencyTypeInfos": [ 4 | { 5 | "userAdded": false, 6 | "type": "UnityEngine.AnimationClip", 7 | "defaultInstantiationMode": 0 8 | }, 9 | { 10 | "userAdded": false, 11 | "type": "UnityEditor.Animations.AnimatorController", 12 | "defaultInstantiationMode": 0 13 | }, 14 | { 15 | "userAdded": false, 16 | "type": "UnityEngine.AnimatorOverrideController", 17 | "defaultInstantiationMode": 0 18 | }, 19 | { 20 | "userAdded": false, 21 | "type": "UnityEditor.Audio.AudioMixerController", 22 | "defaultInstantiationMode": 0 23 | }, 24 | { 25 | "userAdded": false, 26 | "type": "UnityEngine.ComputeShader", 27 | "defaultInstantiationMode": 1 28 | }, 29 | { 30 | "userAdded": false, 31 | "type": "UnityEngine.Cubemap", 32 | "defaultInstantiationMode": 0 33 | }, 34 | { 35 | "userAdded": false, 36 | "type": "UnityEngine.GameObject", 37 | "defaultInstantiationMode": 0 38 | }, 39 | { 40 | "userAdded": false, 41 | "type": "UnityEditor.LightingDataAsset", 42 | "defaultInstantiationMode": 0 43 | }, 44 | { 45 | "userAdded": false, 46 | "type": "UnityEngine.LightingSettings", 47 | "defaultInstantiationMode": 0 48 | }, 49 | { 50 | "userAdded": false, 51 | "type": "UnityEngine.Material", 52 | "defaultInstantiationMode": 0 53 | }, 54 | { 55 | "userAdded": false, 56 | "type": "UnityEditor.MonoScript", 57 | "defaultInstantiationMode": 1 58 | }, 59 | { 60 | "userAdded": false, 61 | "type": "UnityEngine.PhysicsMaterial", 62 | "defaultInstantiationMode": 0 63 | }, 64 | { 65 | "userAdded": false, 66 | "type": "UnityEngine.PhysicsMaterial2D", 67 | "defaultInstantiationMode": 0 68 | }, 69 | { 70 | "userAdded": false, 71 | "type": "UnityEngine.Rendering.PostProcessing.PostProcessProfile", 72 | "defaultInstantiationMode": 0 73 | }, 74 | { 75 | "userAdded": false, 76 | "type": "UnityEngine.Rendering.PostProcessing.PostProcessResources", 77 | "defaultInstantiationMode": 0 78 | }, 79 | { 80 | "userAdded": false, 81 | "type": "UnityEngine.Rendering.VolumeProfile", 82 | "defaultInstantiationMode": 0 83 | }, 84 | { 85 | "userAdded": false, 86 | "type": "UnityEditor.SceneAsset", 87 | "defaultInstantiationMode": 1 88 | }, 89 | { 90 | "userAdded": false, 91 | "type": "UnityEngine.Shader", 92 | "defaultInstantiationMode": 1 93 | }, 94 | { 95 | "userAdded": false, 96 | "type": "UnityEngine.ShaderVariantCollection", 97 | "defaultInstantiationMode": 1 98 | }, 99 | { 100 | "userAdded": false, 101 | "type": "UnityEngine.Texture", 102 | "defaultInstantiationMode": 0 103 | }, 104 | { 105 | "userAdded": false, 106 | "type": "UnityEngine.Texture2D", 107 | "defaultInstantiationMode": 0 108 | }, 109 | { 110 | "userAdded": false, 111 | "type": "UnityEngine.Timeline.TimelineAsset", 112 | "defaultInstantiationMode": 0 113 | } 114 | ], 115 | "defaultDependencyTypeInfo": { 116 | "userAdded": false, 117 | "type": "", 118 | "defaultInstantiationMode": 1 119 | }, 120 | "newSceneOverride": 0 121 | } -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Line/Scripts/Data/Line.Triple.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace geniikw.DataRenderer2D 6 | { 7 | /// 8 | /// to draw joint, Define IEnumerable 9 | /// 10 | public partial struct Spline 11 | { 12 | public IEnumerable TripleList 13 | { 14 | get 15 | { 16 | if (GetCount() < 2) 17 | yield break; 18 | 19 | var mode = option.mode; 20 | var sr = option.startRatio; 21 | var er = option.endRatio; 22 | var color = option.color; 23 | 24 | 25 | var l = AllLength; 26 | var ls = sr * l; 27 | var le = er * l; 28 | var c = 0f; 29 | 30 | var fB = Point.Zero; 31 | var ff = true; 32 | var sB = Point.Zero; 33 | var sf = true; 34 | 35 | var index = 0; 36 | foreach(var p in TripleEnumerator()) 37 | { 38 | if (ff) 39 | { 40 | ff = false; 41 | fB = p; 42 | continue; 43 | } 44 | if (sf) 45 | { 46 | if (mode == LineOption.Mode.Loop && sr == 0f && er == 1f) 47 | yield return new Triple(GetLastPoint(), GetFirstPoint(), p, color.Evaluate(0)); 48 | 49 | sf = false; 50 | sB = p; 51 | continue; 52 | } 53 | 54 | c += CurveLength.Auto(fB, sB); 55 | if (ls < c && c < le) 56 | { 57 | if (index == GetCount() - 1 && mode != LineOption.Mode.Loop) 58 | break; 59 | 60 | yield return new Triple(fB, sB, p,color.Evaluate(c/l)); 61 | } 62 | fB = sB; 63 | sB = p; 64 | index++; 65 | } 66 | } 67 | } 68 | 69 | public struct Triple 70 | { 71 | Point previous; 72 | Point target; 73 | Point next; 74 | Color color; 75 | 76 | public Triple(Point p, Point c, Point n, Color cl) 77 | { 78 | previous = p; target = c; next = n; color = cl; 79 | } 80 | 81 | public Vector3 ForwardDirection { 82 | get 83 | { 84 | var dir = Curve.AutoDirection(target, next, 0f); 85 | var angle = target.forwardAngle; 86 | dir = Quaternion.Euler(0, 0, angle) * dir; 87 | return dir; 88 | 89 | } 90 | } 91 | public Vector3 BackDirection 92 | { 93 | get 94 | { 95 | var dir = Curve.AutoDirection(previous, target, 1f); 96 | var angle = target.backAngle; 97 | dir = Quaternion.Euler(0, 0, angle) * dir; 98 | return dir; 99 | } 100 | } 101 | public Vector3 Position 102 | { 103 | get 104 | { 105 | return target.position; 106 | } 107 | } 108 | public float CurrentWidth 109 | { 110 | get 111 | { 112 | return target.width; 113 | } 114 | } 115 | public Color CurrentColor 116 | { 117 | get 118 | { 119 | return color; 120 | } 121 | } 122 | } 123 | } 124 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # DataRenderer2D 2 | 3 | DataRenderer2D is a simple drawing tool. you can make mesh from data and control it using animator. 4 | all of PR, bug report, comment, suggestion are vary grateful. 5 | 6 | [PatchNote](https://github.com/geniikw/SplineMeshDrawer-PatchNote/blob/master/PatchNode.md) 7 | 8 | [AssetStore(free)](https://assetstore.unity.com/packages/tools/modeling/data-renderer-2d-102377) 9 | 10 | ## Script Edit 11 | If you want to control by script, you have to call GeometryUpdateFlagup() after adjust value. 12 | ```csharp 13 | public UILine line; 14 | public float time; 15 | 16 | IEnumerator Coroutine(){ 17 | var t = 0f; 18 | while(t < 1f) 19 | { 20 | t+=Time.deltaTime/time; 21 | line.line.option.endRatio = t; 22 | line.UpdateGeometryFlagUp(); 23 | yield return null; 24 | } 25 | } 26 | ``` 27 | 28 | ## Bezier line 29 | - Each node has control point and width. 30 | - set line drawing rate using start rate and end rate. 31 | 32 | ![bezier](https://github.com/geniikw/SplineMeshDrawer-PatchNote/raw/master/bezier.gif) 33 | 34 |
35 | 36 | Explain(Korean) 37 | 38 | 이게 사실 메인입니다. 아래 것(?)들은 그냥 사은품정도로 생각하면 됩니다. 원래 이 에셋의 이름은 Spline mesh Drawer였습니다. 이 이름일 때가 훨씬 잘팔렸구요(...). 아래 다각형과 잡것들은 다른 에셋으로 하려다가 그냥 합쳐서 팔자 해서 DataRenderer2D로 바꾸고 합쳐버렸습니다. 그리고 판매량은 반토막 39 | 이름의 중요성을 깨닫는 순간입니다.
40 | 2D로 구성된 선을 생각하는 데로 그리는것이 목적입니다. 시작비율과 끝나는 비율, 각점에서 넓이 등을 커스터마이징 할 수 있습니다. 각 요소들을 Animator에서 조절하여 시각적으로 선을 그리는 효과를 보여주는게 목적이였습니다. 유니티에서 Animator로 움직이기 위해선 struct를 사용해야 합니다. 41 | 그래서 여러 문제들이 생겼는데 덕분에 코드가 개판(...). 뭐, 여러가지 경험을 하면 좋은거죠.
42 | 제일 놀랐던건 사용자분들중 여기에 텍스쳐를 입혀서 사용한 분입니다. sprite로 텍스쳐를 입히기위해 짱구를 굴려봤는데 아무리해도 uv잡는게 힘들어서 그냥 0~1로 만들었기 때문에 아틀라스로 표현하긴 불가능합니다. 그래도 여기에 텍스쳐를 입히고 광원을 줘서 나무를 그리고 있는 프로젝트를 봤는데 43 | 정말 멋지더군요.
44 | 45 |
46 | 47 | ## Polygon 48 | - various method to draw polygon. 49 | - count, scale, inner ratio. 50 | 51 | ![polygon](https://github.com/geniikw/SplineMeshDrawer-PatchNote/raw/master/polygon.gif) 52 | 53 |
54 | 55 | Explain(Korean) 56 | 57 |

58 | 기본적인 다각형을 그리는 녀석입니다. 지그재그로 다각형을 그리는 알고리즘엔 제법 짱구를 굴려서 만들었습니다.
59 | 사실 Hole형식으로 한점에 저렇게 빡빡하게(?) 매쉬가 모이는 경우 어떤 디메리트가 있을 것 같아서 지그재그로 그린건데 60 | 지그재그의 경우 그라데이션을 적용하면 좀 이상하게 나오는 걸 확인해서 그냥 옵션으로 빼버리자 해서 이렇게 됬습니다. 61 | 뭐 어떤 방식이던 장단이 있겠죠.
62 | 다각형을 그릴때 시계방향으로 나오거나 사라지는 효과를 만들고 싶었습니다.(이유는 없습니다. 그저 만들고 싶었을 뿐). 처음에는 원을 기준으로 그렸는데 그리는 도중 다각형이 찌부러지는(...) 것을 확인했습니다. 지금은 잘 나오는데 다음 점으로 방향벡터를 구해서 영점에서 시작 각도와 끝나는 각도로의 63 | 방향벡터와 겹치는 점을 기준으로 그리고 있습니다. 이걸 쓰고 있는 저도 무슨말을 하는지 잘 모르겠으니 그냥 넘가셔도 됩니다. 아무튼 자연스럽게 없어지게 만드는건 성공했는데 이걸 뭐 어따 써야될지는 잘 모르겠습니다. 64 | 이건 떨어진 면접에서 나온 이야기인데, 곧 각 변에 대하여 길이나 색상을 커스텀할 수 있게 하도록 옵션하나를 추가할 것 같습니다. 65 | 말이 좀 이상해서 이해하기 힘든데 예를들어 게임에서 보면 5각형으로 스텟을 보여주는 방식에 쓸 수 있도록 만들 예정입니다. 66 | 뭐, SKT에서 뱅만 KDA가 높아서 오각형을 뚫고 나오잖아요? 그런거 말하는 겁니다. 67 |

68 |
69 | 70 | ## Sinwave 71 | ![sin](https://github.com/geniikw/SplineMeshDrawer-PatchNote/raw/master/sin.gif) 72 | 73 |
74 | 75 | Explain(Korean) 76 | 77 |

78 | 네이버 유니티카페에서 질문을 받고 만든 것입니다. 간단한 모델이라 만드는데 1시간쯤 걸린 것 같습니다. 79 | 사실 그리 사용할 데가 애매한 녀석입니다. 물을 표현한다거나 할 때 쓸 수 있으나. 텍스쳐 같은건 꿈도 못꾸고... 80 | 만들면서 신호처리 때 배웠던 톱니파나 지그재그 등등 각동 시그널을 표현하도록 만들려고 했는데 81 | 수직으로 올라가는 패턴의 경우 매쉬를 다르게 해줘야 된다는 것 깨달은 동시에 포기했습니다. 어설프게 82 | 결국 sin파밖에 없는 애매한 녀석이 되었습니다. 83 |

84 |
85 | 86 | ## Hole 87 | ![hole](https://github.com/geniikw/SplineMeshDrawer-PatchNote/raw/master/hole2.gif) 88 | 89 |
90 | 91 | Explain(Korean) 92 | 93 |

94 | 그냥 만들고 싶어져서 만든 형식입니다. 사실 폴리곤에 반전형식으로 넣을까 했는데 따로 분리했습니다. 95 | 그냥보면 뻥뚫린 원입니다. 와이어프레임이 어떻게 되어 있나 볼 수 있는 gif입니다.
96 | 97 |
보시면 안에있는 다각형의 각 꼭지점과 외부의 정사각형에 대하여 폴리곤을 그리고 있습니다. 98 | 대충 다음과 같은 식으로 폴리곤을 만듦니다.

99 | 1. 외부 4변에서 다각형의 가장 가까운 점으로 세모를 그린다.
100 | 2. 내부 각변에서 가장 가깝게 바라보고 있는 외부 4점중 하나와 세모를 그린다.

101 | 102 | 2의 경우 정확하게 가운데에서 그릴경우 내부변에서 어디로 세모를 그릴지 몰라서 버그가 발생하는데 103 | 언젠간 고치겠습니다. 104 |

105 |
106 | -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Polygon/Scripts/Drawer/HolePolygon.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using System.Linq; 5 | 6 | 7 | namespace geniikw.DataRenderer2D.Polygon 8 | { 9 | public class HolePolygon : IMeshDrawer 10 | { 11 | CircleCalculator _circle; 12 | IPolygon _target; 13 | 14 | public HolePolygon(CircleCalculator cc, IPolygon target) 15 | { 16 | _circle = cc; 17 | _target = target; 18 | } 19 | 20 | public IEnumerable Draw() 21 | { 22 | var count = _target.Polygon.count; 23 | var startAngle = _target.Polygon.startAngle * 360f; 24 | var startFlag = false; 25 | var endAngle = _target.Polygon.endAngle * 360f; 26 | var endFlag = false; 27 | 28 | if (endAngle < startAngle) 29 | yield break; 30 | 31 | for (float i = 0; i < count; i++) 32 | { 33 | var unitAngle = 360f / count; 34 | 35 | var a0 = unitAngle * i; 36 | var a1 = unitAngle * (i + 1); 37 | 38 | if (startAngle > a1) 39 | continue; 40 | 41 | var a = _circle.CalculateVertex(a0); 42 | var b = _circle.CalculateVertex(a1); 43 | var c = _circle.CalculateInnerVertex(a1); 44 | var d = _circle.CalculateInnerVertex(a0); 45 | 46 | var va = b.position - a.position; 47 | 48 | var ap = a.position; 49 | var bp = d.position; 50 | 51 | var uvV = b.uv - a.uv; 52 | 53 | var aUV = a.uv; 54 | var bUV = d.uv; 55 | if (!startFlag) 56 | { 57 | 58 | startFlag = true; 59 | a = _circle.CalculateVertex(startAngle); 60 | d = _circle.CalculateInnerVertex(startAngle); 61 | 62 | var vt = a.position; 63 | var useless = Vector3.zero; 64 | Intersect.ClosestPointsOnTwoLines(out a.position, out useless, Vector3.zero, vt, ap, va); 65 | Intersect.ClosestPointsOnTwoLines(out d.position, out useless, Vector3.zero, vt, bp, va); 66 | 67 | Vector3 aOut, bOut; 68 | 69 | Intersect.ClosestPointsOnTwoLines(out aOut, out useless, Vector3.one * 0.5f, a.uv - Vector2.one * 0.5f, aUV, uvV); 70 | Intersect.ClosestPointsOnTwoLines(out bOut, out useless, Vector3.one * 0.5f, a.uv - Vector2.one * 0.5f, bUV, uvV); 71 | a.uv = aOut; 72 | d.uv = bOut; 73 | 74 | } 75 | 76 | if (!endFlag && endAngle < a1) 77 | { 78 | endFlag = true; 79 | b = _circle.CalculateVertex(endAngle); 80 | c = _circle.CalculateInnerVertex(endAngle); 81 | 82 | var vt = b.position;//-Vector3.zero; 83 | var useless = Vector3.zero; 84 | Intersect.ClosestPointsOnTwoLines(out b.position, out useless, Vector3.zero, vt, ap, va); 85 | Intersect.ClosestPointsOnTwoLines(out c.position, out useless, Vector3.zero, vt, bp, va); 86 | 87 | Vector3 aOut, bOut; 88 | 89 | Intersect.ClosestPointsOnTwoLines(out aOut, out useless, Vector2.one * 0.5f, b.uv - Vector2.one * 0.5f, aUV, uvV); 90 | Intersect.ClosestPointsOnTwoLines(out bOut, out useless, Vector2.one * 0.5f, b.uv - Vector2.one * 0.5f, bUV, uvV); 91 | b.uv = aOut; 92 | c.uv = bOut; 93 | } 94 | 95 | 96 | yield return new Triangle(a, b, c); 97 | 98 | if (_target.Polygon.innerRatio == 0f || 99 | _target.Polygon.type == PolygonType.Hole || 100 | _target.Polygon.type == PolygonType.HoleCurve || 101 | _target.Polygon.type == PolygonType.HoleCenterColor) 102 | yield return new Triangle(a, c, d); 103 | 104 | if (endFlag) 105 | yield break; 106 | 107 | } 108 | } 109 | } 110 | } -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Line/Scripts/Data/Line.Pair.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using System; 5 | 6 | namespace geniikw.DataRenderer2D 7 | { 8 | /// 9 | /// to draw bezier, define IEnumerable 10 | /// 11 | public partial struct Spline 12 | { 13 | IEnumerable AllPair 14 | { 15 | get 16 | { 17 | bool first = true; 18 | Point firstPoint = Point.Zero; 19 | Point lastPoint = Point.Zero; 20 | Point prev = Point.Zero; 21 | int count = 0; 22 | 23 | foreach(var p in this) 24 | { 25 | count++; 26 | if (first) 27 | { 28 | firstPoint = p; 29 | lastPoint = p; 30 | first = false; 31 | continue; 32 | } 33 | 34 | yield return new Point[] {lastPoint, p}; 35 | 36 | lastPoint = p; 37 | } 38 | 39 | if (option.mode == LineOption.Mode.Loop && count > 1) 40 | { 41 | yield return new Point[] { lastPoint, firstPoint }; 42 | } 43 | } 44 | } 45 | 46 | public IEnumerable TargetPairList 47 | { 48 | get 49 | { 50 | var l = AllLength; 51 | var ls = l * option.startRatio; 52 | var le = l * option.endRatio; 53 | var ps = 0f; 54 | var pe = 0f; 55 | var pl = 0f; 56 | 57 | if (ls >= le) 58 | yield break; 59 | 60 | foreach (var pair in AllPair) 61 | { 62 | pl = CurveLength.Auto(pair[0], pair[1]); 63 | pe = ps + pl; 64 | 65 | if (le < ps) 66 | yield break; 67 | if (ls < pe) 68 | yield return new LinePair(pair[0], pair[1], Mathf.Max(0f, (ls - ps) / pl), Mathf.Min(1f, (le - ps) / pl), ps / l, pe / l); 69 | ps = pe; 70 | } 71 | } 72 | } 73 | [Serializable] 74 | public struct LinePair 75 | { 76 | public Point n0; 77 | public Point n1; 78 | [NonSerialized] 79 | public float sRatio; 80 | [NonSerialized] 81 | public float eRatio; 82 | public float RatioLength 83 | { 84 | get 85 | { 86 | return eRatio - sRatio; 87 | } 88 | } 89 | [NonSerialized] 90 | public float start; 91 | [NonSerialized] 92 | public float end; 93 | public LinePair(Point n0, Point n1, float s, float e, float sr, float er) 94 | { 95 | this.n0 = n0; 96 | this.n1 = n1; 97 | start = s; 98 | end = e; 99 | sRatio = sr; 100 | eRatio = er; 101 | } 102 | public float Length 103 | { 104 | get 105 | { 106 | return CurveLength.Auto(n0, n1) * (end - start); 107 | } 108 | } 109 | 110 | public float GetDT(float divideLength) 111 | { 112 | return (divideLength / Length) * (end - start); 113 | } 114 | public Vector3 GetPoisition(float r) 115 | { 116 | return Curve.Auto(n0, n1, Mathf.Lerp(start, end, r)); 117 | } 118 | public Vector3 GetDirection(float r) 119 | { 120 | return Curve.AutoDirection(n0, n1, Mathf.Lerp(start, end, r)); 121 | } 122 | public float GetWidth(float t) 123 | { 124 | return Mathf.Lerp(n0.width, n1.width, Mathf.Lerp(start, end, t)); 125 | } 126 | 127 | public float GetAngle(float t) 128 | { 129 | return Mathf.Lerp(n0.forwardAngle, n1.backAngle, Mathf.Lerp(start, end, t)); 130 | } 131 | 132 | } 133 | } 134 | } -------------------------------------------------------------------------------- /Assets/DataRenderer2D/Core/WorldDataMesh.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using System; 5 | 6 | namespace geniikw.DataRenderer2D 7 | { 8 | [ExecuteInEditMode] 9 | [RequireComponent(typeof(MeshFilter))] 10 | [RequireComponent(typeof(MeshRenderer))] 11 | public abstract class WorldDataMesh : MonoBehaviour 12 | { 13 | public bool updateInUpdate = true; 14 | 15 | IEnumerable _mesh; 16 | 17 | IEnumerable Mesh { get { return _mesh ?? (_mesh = MeshFactory); } } 18 | 19 | int bufferSize = 100; 20 | Vector3[] vBuffer; 21 | Vector2[] uvBuffer; 22 | Color[] colorBuffer; 23 | int[] tBuffer; 24 | 25 | bool m_geometryUpdateFlag = false; 26 | 27 | abstract protected IEnumerable MeshFactory { get; } 28 | 29 | MeshFilter m_mf; 30 | MeshFilter Mf 31 | { 32 | get 33 | { 34 | return m_mf ?? (m_mf = GetComponent()); 35 | } 36 | } 37 | 38 | protected virtual void Awake() 39 | { 40 | AllocateBuffer(bufferSize); 41 | } 42 | 43 | public void Reset() 44 | { 45 | var mf = GetComponent(); 46 | 47 | if (mf.sharedMesh == null) 48 | { 49 | MakeNewMesh(); 50 | } 51 | } 52 | 53 | private void Update() 54 | { 55 | m_geometryUpdateFlag = true; 56 | } 57 | 58 | public void LateUpdate() 59 | { 60 | if (m_geometryUpdateFlag) 61 | { 62 | UpdateGeometry(); 63 | m_geometryUpdateFlag = false; 64 | } 65 | } 66 | 67 | public void MakeNewMesh() 68 | { 69 | var mf = GetComponent(); 70 | 71 | var mesh = new Mesh(); 72 | mesh.name = name; 73 | mf.mesh = mesh; 74 | } 75 | 76 | 77 | public void UpdateGeometry() 78 | { 79 | var mf = GetComponent(); 80 | 81 | mf.sharedMesh.Clear(); 82 | 83 | var vc = 0; 84 | var tc = 0; 85 | 86 | foreach (var mesh in Mesh) 87 | { 88 | foreach (var t in mesh.Triangles) 89 | { 90 | if (tc > tBuffer.Length - 1) 91 | ExtendBuffer(); 92 | 93 | tBuffer[tc] = vc + t; 94 | tc++; 95 | } 96 | 97 | foreach (var v in mesh.Vertices) 98 | { 99 | if (vc > vBuffer.Length - 1) 100 | ExtendBuffer(); 101 | 102 | vBuffer[vc] = v.position; 103 | uvBuffer[vc] = v.uv; 104 | colorBuffer[vc] = v.color; 105 | vc++; 106 | } 107 | } 108 | 109 | while (vc < vBuffer.Length) 110 | { 111 | vBuffer[vc] = Vector3.zero; 112 | uvBuffer[vc] = Vector2.zero; 113 | colorBuffer[vc] = Color.white; 114 | vc++; 115 | } 116 | while (tc < vBuffer.Length) 117 | { 118 | tBuffer[tc] = 0; 119 | tc++; 120 | } 121 | 122 | mf.sharedMesh.vertices = vBuffer; 123 | 124 | mf.sharedMesh.uv = uvBuffer; 125 | mf.sharedMesh.triangles = tBuffer; 126 | mf.sharedMesh.colors = colorBuffer; 127 | mf.sharedMesh.RecalculateNormals(); 128 | mf.sharedMesh.RecalculateTangents(); 129 | mf.sharedMesh.RecalculateBounds(); 130 | } 131 | 132 | private void AllocateBuffer(int size) 133 | { 134 | vBuffer = new Vector3[size]; 135 | uvBuffer = new Vector2[size]; 136 | colorBuffer = new Color[size]; 137 | tBuffer = new int[size * 6]; 138 | } 139 | 140 | private void ExtendBuffer() 141 | { 142 | var tempV = vBuffer; 143 | var tempUV = uvBuffer; 144 | var tempC = colorBuffer; 145 | var tempT = tBuffer; 146 | //Debug.Log("Size double up : " + bufferSize); 147 | bufferSize *= 2; 148 | AllocateBuffer(bufferSize); 149 | 150 | Array.Copy(tempV, vBuffer, tempV.Length); 151 | Array.Copy(tempUV, uvBuffer, tempUV.Length); 152 | Array.Copy(tempC, colorBuffer, tempC.Length); 153 | Array.Copy(tempT, tBuffer, tempT.Length); 154 | } 155 | 156 | 157 | public void GeometyUpdateFlagUp() 158 | { 159 | m_geometryUpdateFlag = true; 160 | } 161 | 162 | 163 | } 164 | } --------------------------------------------------------------------------------