From a0270bf6ff2c029aa1fec67dfa3d14f2c2e7d523 Mon Sep 17 00:00:00 2001 From: BlackMATov Date: Sat, 23 Apr 2016 03:50:25 +0600 Subject: [PATCH] add capsule collider --- Assembly-CSharp-Editor.csproj | 2 +- Assembly-CSharp.csproj | 3 +- .../Examples/Prefabs/Kenney/Player.prefab | 61 +++-- Assets/IsoTools/Examples/Scenes/Scene01.unity | 254 +++++++----------- Assets/IsoTools/Scripts/IsoBoxCollider.cs | 7 +- Assets/IsoTools/Scripts/IsoCapsuleCollider.cs | 111 ++++++++ .../Scripts/IsoCapsuleCollider.cs.meta | 12 + Assets/IsoTools/Scripts/IsoObject.cs | 1 - Assets/IsoTools/Scripts/IsoSphereCollider.cs | 7 +- Assets/IsoTools/Scripts/IsoWorld.cs | 2 +- 10 files changed, 274 insertions(+), 186 deletions(-) create mode 100644 Assets/IsoTools/Scripts/IsoCapsuleCollider.cs create mode 100644 Assets/IsoTools/Scripts/IsoCapsuleCollider.cs.meta diff --git a/Assembly-CSharp-Editor.csproj b/Assembly-CSharp-Editor.csproj index 97a3b42..fefdb38 100644 --- a/Assembly-CSharp-Editor.csproj +++ b/Assembly-CSharp-Editor.csproj @@ -19,7 +19,7 @@ full false Temp\bin\Debug\ - DEBUG;TRACE;UNITY_5_3_OR_NEWER;UNITY_5_3_4;UNITY_5_3;UNITY_5;ENABLE_NEW_BUGREPORTER;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_DUCK_TYPING;ENABLE_FRAME_DEBUGGER;ENABLE_GENERICS;ENABLE_HOME_SCREEN;ENABLE_IMAGEEFFECTS;ENABLE_LIGHT_PROBES_LEGACY;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_PHYSICS;ENABLE_PLUGIN_INSPECTOR;ENABLE_SHADOWS;ENABLE_SINGLE_INSTANCE_BUILD_SETTING;ENABLE_SPRITERENDERER_FLIPPING;ENABLE_SPRITES;ENABLE_SPRITE_POLYGON;ENABLE_TERRAIN;ENABLE_RAKNET;ENABLE_UNET;ENABLE_UNITYEVENTS;ENABLE_VR;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ADS;ENABLE_CLOUD_HUB;ENABLE_CLOUD_PROJECT_ID;ENABLE_CLOUD_SERVICES_PURCHASING;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_UNET;ENABLE_CLOUD_SERVICES_BUILD;ENABLE_CLOUD_LICENSE;ENABLE_EDITOR_METRICS;ENABLE_EDITOR_METRICS_CACHING;INCLUDE_DYNAMIC_GI;INCLUDE_GI;INCLUDE_IL2CPP;INCLUDE_DIRECTX12;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;ENABLE_LOCALIZATION;ENABLE_ANDROID_ATLAS_ETC1_COMPRESSION;ENABLE_EDITOR_TESTS_RUNNER;UNITY_STANDALONE_OSX;UNITY_STANDALONE;ENABLE_SUBSTANCE;ENABLE_GAMECENTER;ENABLE_TEXTUREID_MAP;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_LOG_MIXED_STACKTRACE;ENABLE_UNITYWEBREQUEST;ENABLE_CLUSTERINPUT;ENABLE_WEBSOCKET_HOST;ENABLE_MONO;ENABLE_PROFILER;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_OSX;PLAYMAKER;PLAYMAKER_1_8 + DEBUG;TRACE;UNITY_5_3_OR_NEWER;UNITY_5_3_4;UNITY_5_3;UNITY_5;ENABLE_NEW_BUGREPORTER;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_DUCK_TYPING;ENABLE_FRAME_DEBUGGER;ENABLE_GENERICS;ENABLE_HOME_SCREEN;ENABLE_IMAGEEFFECTS;ENABLE_LIGHT_PROBES_LEGACY;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_PHYSICS;ENABLE_PLUGIN_INSPECTOR;ENABLE_SHADOWS;ENABLE_SINGLE_INSTANCE_BUILD_SETTING;ENABLE_SPRITERENDERER_FLIPPING;ENABLE_SPRITES;ENABLE_SPRITE_POLYGON;ENABLE_TERRAIN;ENABLE_RAKNET;ENABLE_UNET;ENABLE_UNITYEVENTS;ENABLE_VR;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ADS;ENABLE_CLOUD_HUB;ENABLE_CLOUD_PROJECT_ID;ENABLE_CLOUD_SERVICES_PURCHASING;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_UNET;ENABLE_CLOUD_SERVICES_BUILD;ENABLE_CLOUD_LICENSE;ENABLE_EDITOR_METRICS;ENABLE_EDITOR_METRICS_CACHING;INCLUDE_DYNAMIC_GI;INCLUDE_GI;INCLUDE_IL2CPP;INCLUDE_DIRECTX12;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;ENABLE_LOCALIZATION;ENABLE_ANDROID_ATLAS_ETC1_COMPRESSION;ENABLE_EDITOR_TESTS_RUNNER;UNITY_STANDALONE_OSX;UNITY_STANDALONE;ENABLE_SUBSTANCE;ENABLE_GAMECENTER;ENABLE_TEXTUREID_MAP;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_LOG_MIXED_STACKTRACE;ENABLE_UNITYWEBREQUEST;ENABLE_CLUSTERINPUT;ENABLE_WEBSOCKET_HOST;ENABLE_MONO;DEVELOPMENT_BUILD;ENABLE_PROFILER;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_OSX;PLAYMAKER;PLAYMAKER_1_8 prompt 4 0169 diff --git a/Assembly-CSharp.csproj b/Assembly-CSharp.csproj index cb91d67..b8dfcb4 100644 --- a/Assembly-CSharp.csproj +++ b/Assembly-CSharp.csproj @@ -19,7 +19,7 @@ full false Temp\bin\Debug\ - DEBUG;TRACE;UNITY_5_3_OR_NEWER;UNITY_5_3_4;UNITY_5_3;UNITY_5;ENABLE_NEW_BUGREPORTER;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_DUCK_TYPING;ENABLE_FRAME_DEBUGGER;ENABLE_GENERICS;ENABLE_HOME_SCREEN;ENABLE_IMAGEEFFECTS;ENABLE_LIGHT_PROBES_LEGACY;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_PHYSICS;ENABLE_PLUGIN_INSPECTOR;ENABLE_SHADOWS;ENABLE_SINGLE_INSTANCE_BUILD_SETTING;ENABLE_SPRITERENDERER_FLIPPING;ENABLE_SPRITES;ENABLE_SPRITE_POLYGON;ENABLE_TERRAIN;ENABLE_RAKNET;ENABLE_UNET;ENABLE_UNITYEVENTS;ENABLE_VR;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ADS;ENABLE_CLOUD_HUB;ENABLE_CLOUD_PROJECT_ID;ENABLE_CLOUD_SERVICES_PURCHASING;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_UNET;ENABLE_CLOUD_SERVICES_BUILD;ENABLE_CLOUD_LICENSE;ENABLE_EDITOR_METRICS;ENABLE_EDITOR_METRICS_CACHING;INCLUDE_DYNAMIC_GI;INCLUDE_GI;INCLUDE_IL2CPP;INCLUDE_DIRECTX12;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;ENABLE_LOCALIZATION;ENABLE_ANDROID_ATLAS_ETC1_COMPRESSION;ENABLE_EDITOR_TESTS_RUNNER;UNITY_STANDALONE_OSX;UNITY_STANDALONE;ENABLE_SUBSTANCE;ENABLE_GAMECENTER;ENABLE_TEXTUREID_MAP;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_LOG_MIXED_STACKTRACE;ENABLE_UNITYWEBREQUEST;ENABLE_CLUSTERINPUT;ENABLE_WEBSOCKET_HOST;ENABLE_MONO;ENABLE_PROFILER;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_OSX;PLAYMAKER;PLAYMAKER_1_8 + DEBUG;TRACE;UNITY_5_3_OR_NEWER;UNITY_5_3_4;UNITY_5_3;UNITY_5;ENABLE_NEW_BUGREPORTER;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_DUCK_TYPING;ENABLE_FRAME_DEBUGGER;ENABLE_GENERICS;ENABLE_HOME_SCREEN;ENABLE_IMAGEEFFECTS;ENABLE_LIGHT_PROBES_LEGACY;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_PHYSICS;ENABLE_PLUGIN_INSPECTOR;ENABLE_SHADOWS;ENABLE_SINGLE_INSTANCE_BUILD_SETTING;ENABLE_SPRITERENDERER_FLIPPING;ENABLE_SPRITES;ENABLE_SPRITE_POLYGON;ENABLE_TERRAIN;ENABLE_RAKNET;ENABLE_UNET;ENABLE_UNITYEVENTS;ENABLE_VR;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ADS;ENABLE_CLOUD_HUB;ENABLE_CLOUD_PROJECT_ID;ENABLE_CLOUD_SERVICES_PURCHASING;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_UNET;ENABLE_CLOUD_SERVICES_BUILD;ENABLE_CLOUD_LICENSE;ENABLE_EDITOR_METRICS;ENABLE_EDITOR_METRICS_CACHING;INCLUDE_DYNAMIC_GI;INCLUDE_GI;INCLUDE_IL2CPP;INCLUDE_DIRECTX12;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;ENABLE_LOCALIZATION;ENABLE_ANDROID_ATLAS_ETC1_COMPRESSION;ENABLE_EDITOR_TESTS_RUNNER;UNITY_STANDALONE_OSX;UNITY_STANDALONE;ENABLE_SUBSTANCE;ENABLE_GAMECENTER;ENABLE_TEXTUREID_MAP;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_LOG_MIXED_STACKTRACE;ENABLE_UNITYWEBREQUEST;ENABLE_CLUSTERINPUT;ENABLE_WEBSOCKET_HOST;ENABLE_MONO;DEVELOPMENT_BUILD;ENABLE_PROFILER;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_OSX;PLAYMAKER;PLAYMAKER_1_8 prompt 4 0169 @@ -63,6 +63,7 @@ + diff --git a/Assets/IsoTools/Examples/Prefabs/Kenney/Player.prefab b/Assets/IsoTools/Examples/Prefabs/Kenney/Player.prefab index d73b7f5..48f7d78 100644 --- a/Assets/IsoTools/Examples/Prefabs/Kenney/Player.prefab +++ b/Assets/IsoTools/Examples/Prefabs/Kenney/Player.prefab @@ -10,9 +10,11 @@ GameObject: - 4: {fileID: 434702} - 114: {fileID: 11429270} - 114: {fileID: 11445356} - - 114: {fileID: 11499200} + - 114: {fileID: 11484474} - 114: {fileID: 11484120} - - 114: {fileID: 11492740} + - 114: {fileID: 11402146} + - 114: {fileID: 11463578} + - 114: {fileID: 11434786} m_Layer: 0 m_Name: Player m_TagString: Untagged @@ -43,7 +45,7 @@ Transform: m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 121016} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: -1.5955333, y: 1.5494155, z: 30.35715} + m_LocalPosition: {x: -1.595533, y: 1.549416, z: 9} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - {fileID: 442418} @@ -61,6 +63,17 @@ Transform: m_Children: [] m_Father: {fileID: 434702} m_RootOrder: 0 +--- !u!114 &11402146 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 121016} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5528e050e2d53409f9a4f1662625b0bf, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!114 &11429270 MonoBehaviour: m_ObjectHideFlags: 1 @@ -73,11 +86,22 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: _size: {x: 0.3, y: 0.3, z: 0.6} - _position: {x: 0, y: 0, z: 0} + _position: {x: 0.62638426, y: 3.0810504, z: 0.53} _mode: 0 _cacheRenderers: 1 _isAlignment: 0 _isShowBounds: 0 +--- !u!114 &11434786 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 121016} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1925507eee33e42c2a04a1ae1eaa1ec5, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!114 &11445356 MonoBehaviour: m_ObjectHideFlags: 1 @@ -95,6 +119,17 @@ MonoBehaviour: _isKinematic: 0 _interpolation: 0 _collisionDetectionMode: 0 +--- !u!114 &11463578 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 121016} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c9634e461d1e942de8174ee80528a2d3, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!114 &11484120 MonoBehaviour: m_ObjectHideFlags: 1 @@ -107,7 +142,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: speed: 2 ---- !u!114 &11492740 +--- !u!114 &11484474 MonoBehaviour: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} @@ -115,23 +150,13 @@ MonoBehaviour: m_GameObject: {fileID: 121016} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 5528e050e2d53409f9a4f1662625b0bf, type: 3} - m_Name: - m_EditorClassIdentifier: ---- !u!114 &11499200 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 121016} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: b256250c588ee4e4590a3e58eaa69b1d, type: 3} + m_Script: {fileID: 11500000, guid: d4d35c70ee62a44288b95ff88ca8e87c, type: 3} m_Name: m_EditorClassIdentifier: _material: {fileID: 0} _isTrigger: 0 - _size: {x: 0.32, y: 0.32, z: 0.62} + _height: 0.6 + _radius: 0.17 _offset: {x: 0.15, y: 0.15, z: 0.3} --- !u!212 &21204754 SpriteRenderer: diff --git a/Assets/IsoTools/Examples/Scenes/Scene01.unity b/Assets/IsoTools/Examples/Scenes/Scene01.unity index 84d25bc..d2cb5d5 100644 --- a/Assets/IsoTools/Examples/Scenes/Scene01.unity +++ b/Assets/IsoTools/Examples/Scenes/Scene01.unity @@ -204,7 +204,7 @@ Prefab: objectReference: {fileID: 0} - target: {fileID: 436736, guid: 30a269be2fc864c9ea00c7a65636d543, type: 2} propertyPath: m_LocalPosition.z - value: 30 + value: 25.5 objectReference: {fileID: 0} - target: {fileID: 436736, guid: 30a269be2fc864c9ea00c7a65636d543, type: 2} propertyPath: m_LocalRotation.x @@ -290,7 +290,7 @@ Prefab: objectReference: {fileID: 0} - target: {fileID: 482272, guid: c1da36e1b472b4195a4780c9d03c52de, type: 2} propertyPath: m_LocalPosition.z - value: 5 + value: 7 objectReference: {fileID: 0} - target: {fileID: 482272, guid: c1da36e1b472b4195a4780c9d03c52de, type: 2} propertyPath: m_LocalRotation.x @@ -392,7 +392,7 @@ Prefab: objectReference: {fileID: 0} - target: {fileID: 436736, guid: 30a269be2fc864c9ea00c7a65636d543, type: 2} propertyPath: m_LocalPosition.z - value: 3.5 + value: 6 objectReference: {fileID: 0} - target: {fileID: 436736, guid: 30a269be2fc864c9ea00c7a65636d543, type: 2} propertyPath: m_LocalRotation.x @@ -466,7 +466,7 @@ Prefab: objectReference: {fileID: 0} - target: {fileID: 482272, guid: c1da36e1b472b4195a4780c9d03c52de, type: 2} propertyPath: m_LocalPosition.z - value: 9.5 + value: 11 objectReference: {fileID: 0} - target: {fileID: 482272, guid: c1da36e1b472b4195a4780c9d03c52de, type: 2} propertyPath: m_LocalRotation.x @@ -568,7 +568,7 @@ Prefab: objectReference: {fileID: 0} - target: {fileID: 436736, guid: 30a269be2fc864c9ea00c7a65636d543, type: 2} propertyPath: m_LocalPosition.z - value: 23 + value: 21 objectReference: {fileID: 0} - target: {fileID: 436736, guid: 30a269be2fc864c9ea00c7a65636d543, type: 2} propertyPath: m_LocalRotation.x @@ -790,7 +790,7 @@ Prefab: objectReference: {fileID: 0} - target: {fileID: 436736, guid: 30a269be2fc864c9ea00c7a65636d543, type: 2} propertyPath: m_LocalPosition.z - value: 24 + value: 19 objectReference: {fileID: 0} - target: {fileID: 436736, guid: 30a269be2fc864c9ea00c7a65636d543, type: 2} propertyPath: m_LocalRotation.x @@ -868,7 +868,7 @@ Prefab: objectReference: {fileID: 0} - target: {fileID: 436736, guid: 30a269be2fc864c9ea00c7a65636d543, type: 2} propertyPath: m_LocalPosition.z - value: 23.5 + value: 18.5 objectReference: {fileID: 0} - target: {fileID: 436736, guid: 30a269be2fc864c9ea00c7a65636d543, type: 2} propertyPath: m_LocalRotation.x @@ -1020,7 +1020,7 @@ Prefab: objectReference: {fileID: 0} - target: {fileID: 482272, guid: c1da36e1b472b4195a4780c9d03c52de, type: 2} propertyPath: m_LocalPosition.z - value: 19.5 + value: 16.5 objectReference: {fileID: 0} - target: {fileID: 482272, guid: c1da36e1b472b4195a4780c9d03c52de, type: 2} propertyPath: m_LocalRotation.x @@ -1220,7 +1220,7 @@ Prefab: objectReference: {fileID: 0} - target: {fileID: 482272, guid: c1da36e1b472b4195a4780c9d03c52de, type: 2} propertyPath: m_LocalPosition.z - value: 22.5 + value: 18 objectReference: {fileID: 0} - target: {fileID: 482272, guid: c1da36e1b472b4195a4780c9d03c52de, type: 2} propertyPath: m_LocalRotation.x @@ -1322,7 +1322,7 @@ Prefab: objectReference: {fileID: 0} - target: {fileID: 436736, guid: 30a269be2fc864c9ea00c7a65636d543, type: 2} propertyPath: m_LocalPosition.z - value: 5.5 + value: 7.5 objectReference: {fileID: 0} - target: {fileID: 436736, guid: 30a269be2fc864c9ea00c7a65636d543, type: 2} propertyPath: m_LocalRotation.x @@ -1660,85 +1660,6 @@ MonoBehaviour: _isKinematic: 1 _interpolation: 0 _collisionDetectionMode: 0 ---- !u!1001 &555992081 -Prefab: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - m_TransformParent: {fileID: 0} - m_Modifications: - - target: {fileID: 434702, guid: b89b96b93724d4f7489cd31f4f2fda48, type: 2} - propertyPath: m_LocalPosition.x - value: -1.595533 - objectReference: {fileID: 0} - - target: {fileID: 434702, guid: b89b96b93724d4f7489cd31f4f2fda48, type: 2} - propertyPath: m_LocalPosition.y - value: 1.549416 - objectReference: {fileID: 0} - - target: {fileID: 434702, guid: b89b96b93724d4f7489cd31f4f2fda48, type: 2} - propertyPath: m_LocalPosition.z - value: 7 - objectReference: {fileID: 0} - - target: {fileID: 434702, guid: b89b96b93724d4f7489cd31f4f2fda48, type: 2} - propertyPath: m_LocalRotation.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 434702, guid: b89b96b93724d4f7489cd31f4f2fda48, type: 2} - propertyPath: m_LocalRotation.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 434702, guid: b89b96b93724d4f7489cd31f4f2fda48, type: 2} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 434702, guid: b89b96b93724d4f7489cd31f4f2fda48, type: 2} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 434702, guid: b89b96b93724d4f7489cd31f4f2fda48, type: 2} - propertyPath: m_RootOrder - value: 6 - objectReference: {fileID: 0} - - target: {fileID: 121016, guid: b89b96b93724d4f7489cd31f4f2fda48, type: 2} - propertyPath: m_IsActive - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 11429270, guid: b89b96b93724d4f7489cd31f4f2fda48, type: 2} - propertyPath: MinSector.y - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 11429270, guid: b89b96b93724d4f7489cd31f4f2fda48, type: 2} - propertyPath: MaxSector.x - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 11429270, guid: b89b96b93724d4f7489cd31f4f2fda48, type: 2} - propertyPath: MaxSector.y - value: 2 - objectReference: {fileID: 0} - - target: {fileID: 11429270, guid: b89b96b93724d4f7489cd31f4f2fda48, type: 2} - propertyPath: MaxSector.z - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 11429270, guid: b89b96b93724d4f7489cd31f4f2fda48, type: 2} - propertyPath: InternalVisited - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 11429270, guid: b89b96b93724d4f7489cd31f4f2fda48, type: 2} - propertyPath: _position.x - value: 0.62638426 - objectReference: {fileID: 0} - - target: {fileID: 11429270, guid: b89b96b93724d4f7489cd31f4f2fda48, type: 2} - propertyPath: _position.y - value: 3.0810504 - objectReference: {fileID: 0} - - target: {fileID: 11429270, guid: b89b96b93724d4f7489cd31f4f2fda48, type: 2} - propertyPath: _position.z - value: 0.53 - objectReference: {fileID: 0} - m_RemovedComponents: - - {fileID: 11492740, guid: b89b96b93724d4f7489cd31f4f2fda48, type: 2} - m_ParentPrefab: {fileID: 100100000, guid: b89b96b93724d4f7489cd31f4f2fda48, type: 2} - m_IsPrefabParent: 0 --- !u!1001 &566324953 Prefab: m_ObjectHideFlags: 0 @@ -1858,7 +1779,7 @@ Prefab: objectReference: {fileID: 0} - target: {fileID: 436736, guid: 30a269be2fc864c9ea00c7a65636d543, type: 2} propertyPath: m_LocalPosition.z - value: 21.5 + value: 20 objectReference: {fileID: 0} - target: {fileID: 436736, guid: 30a269be2fc864c9ea00c7a65636d543, type: 2} propertyPath: m_LocalRotation.x @@ -2014,7 +1935,7 @@ Prefab: objectReference: {fileID: 0} - target: {fileID: 482272, guid: c1da36e1b472b4195a4780c9d03c52de, type: 2} propertyPath: m_LocalPosition.z - value: 3 + value: 5.5 objectReference: {fileID: 0} - target: {fileID: 482272, guid: c1da36e1b472b4195a4780c9d03c52de, type: 2} propertyPath: m_LocalRotation.x @@ -2116,7 +2037,7 @@ Prefab: objectReference: {fileID: 0} - target: {fileID: 436736, guid: 30a269be2fc864c9ea00c7a65636d543, type: 2} propertyPath: m_LocalPosition.z - value: 29.5 + value: 25 objectReference: {fileID: 0} - target: {fileID: 436736, guid: 30a269be2fc864c9ea00c7a65636d543, type: 2} propertyPath: m_LocalRotation.x @@ -2257,7 +2178,7 @@ Prefab: objectReference: {fileID: 0} - target: {fileID: 436736, guid: 30a269be2fc864c9ea00c7a65636d543, type: 2} propertyPath: m_LocalPosition.z - value: 26.5 + value: 21.5 objectReference: {fileID: 0} - target: {fileID: 436736, guid: 30a269be2fc864c9ea00c7a65636d543, type: 2} propertyPath: m_LocalRotation.x @@ -2339,7 +2260,7 @@ Prefab: objectReference: {fileID: 0} - target: {fileID: 436736, guid: 30a269be2fc864c9ea00c7a65636d543, type: 2} propertyPath: m_LocalPosition.z - value: 2.5 + value: 5 objectReference: {fileID: 0} - target: {fileID: 436736, guid: 30a269be2fc864c9ea00c7a65636d543, type: 2} propertyPath: m_LocalRotation.x @@ -2519,7 +2440,7 @@ Prefab: objectReference: {fileID: 0} - target: {fileID: 436736, guid: 30a269be2fc864c9ea00c7a65636d543, type: 2} propertyPath: m_LocalPosition.z - value: 22 + value: 20.5 objectReference: {fileID: 0} - target: {fileID: 436736, guid: 30a269be2fc864c9ea00c7a65636d543, type: 2} propertyPath: m_LocalRotation.x @@ -2636,7 +2557,7 @@ Prefab: objectReference: {fileID: 0} - target: {fileID: 482272, guid: c1da36e1b472b4195a4780c9d03c52de, type: 2} propertyPath: m_LocalPosition.z - value: 21 + value: 19.5 objectReference: {fileID: 0} - target: {fileID: 482272, guid: c1da36e1b472b4195a4780c9d03c52de, type: 2} propertyPath: m_LocalRotation.x @@ -2840,7 +2761,7 @@ Prefab: objectReference: {fileID: 0} - target: {fileID: 436736, guid: 30a269be2fc864c9ea00c7a65636d543, type: 2} propertyPath: m_LocalPosition.z - value: 25 + value: 22 objectReference: {fileID: 0} - target: {fileID: 436736, guid: 30a269be2fc864c9ea00c7a65636d543, type: 2} propertyPath: m_LocalRotation.x @@ -3024,7 +2945,7 @@ Prefab: objectReference: {fileID: 0} - target: {fileID: 436736, guid: 30a269be2fc864c9ea00c7a65636d543, type: 2} propertyPath: m_LocalPosition.z - value: 7.5 + value: 9.5 objectReference: {fileID: 0} - target: {fileID: 436736, guid: 30a269be2fc864c9ea00c7a65636d543, type: 2} propertyPath: m_LocalRotation.x @@ -3208,7 +3129,7 @@ Prefab: objectReference: {fileID: 0} - target: {fileID: 436736, guid: 30a269be2fc864c9ea00c7a65636d543, type: 2} propertyPath: m_LocalPosition.z - value: 20 + value: 17 objectReference: {fileID: 0} - target: {fileID: 436736, guid: 30a269be2fc864c9ea00c7a65636d543, type: 2} propertyPath: m_LocalRotation.x @@ -3286,7 +3207,7 @@ Prefab: objectReference: {fileID: 0} - target: {fileID: 436736, guid: 30a269be2fc864c9ea00c7a65636d543, type: 2} propertyPath: m_LocalPosition.z - value: 29 + value: 24.5 objectReference: {fileID: 0} - target: {fileID: 436736, guid: 30a269be2fc864c9ea00c7a65636d543, type: 2} propertyPath: m_LocalRotation.x @@ -3347,6 +3268,60 @@ Prefab: Transform: m_PrefabParentObject: {fileID: 436736, guid: 30a269be2fc864c9ea00c7a65636d543, type: 2} m_PrefabInternal: {fileID: 948217954} +--- !u!1001 &971440826 +Prefab: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 434702, guid: b89b96b93724d4f7489cd31f4f2fda48, type: 2} + propertyPath: m_LocalPosition.x + value: -1.595533 + objectReference: {fileID: 0} + - target: {fileID: 434702, guid: b89b96b93724d4f7489cd31f4f2fda48, type: 2} + propertyPath: m_LocalPosition.y + value: 1.549416 + objectReference: {fileID: 0} + - target: {fileID: 434702, guid: b89b96b93724d4f7489cd31f4f2fda48, type: 2} + propertyPath: m_LocalPosition.z + value: 9 + objectReference: {fileID: 0} + - target: {fileID: 434702, guid: b89b96b93724d4f7489cd31f4f2fda48, type: 2} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 434702, guid: b89b96b93724d4f7489cd31f4f2fda48, type: 2} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 434702, guid: b89b96b93724d4f7489cd31f4f2fda48, type: 2} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 434702, guid: b89b96b93724d4f7489cd31f4f2fda48, type: 2} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 434702, guid: b89b96b93724d4f7489cd31f4f2fda48, type: 2} + propertyPath: m_RootOrder + value: 6 + objectReference: {fileID: 0} + - target: {fileID: 11429270, guid: b89b96b93724d4f7489cd31f4f2fda48, type: 2} + propertyPath: _position.x + value: 0.62638426 + objectReference: {fileID: 0} + - target: {fileID: 11429270, guid: b89b96b93724d4f7489cd31f4f2fda48, type: 2} + propertyPath: _position.y + value: 3.0810504 + objectReference: {fileID: 0} + - target: {fileID: 11429270, guid: b89b96b93724d4f7489cd31f4f2fda48, type: 2} + propertyPath: _position.z + value: 0.53 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 100100000, guid: b89b96b93724d4f7489cd31f4f2fda48, type: 2} + m_IsPrefabParent: 0 --- !u!1001 &1000114649 Prefab: m_ObjectHideFlags: 0 @@ -3364,7 +3339,7 @@ Prefab: objectReference: {fileID: 0} - target: {fileID: 436736, guid: 30a269be2fc864c9ea00c7a65636d543, type: 2} propertyPath: m_LocalPosition.z - value: 16.5 + value: 14.5 objectReference: {fileID: 0} - target: {fileID: 436736, guid: 30a269be2fc864c9ea00c7a65636d543, type: 2} propertyPath: m_LocalRotation.x @@ -3442,7 +3417,7 @@ Prefab: objectReference: {fileID: 0} - target: {fileID: 436798, guid: a60889c79802a4d04a26f078003a2a8d, type: 2} propertyPath: m_LocalPosition.z - value: 17.5 + value: 15.5 objectReference: {fileID: 0} - target: {fileID: 436798, guid: a60889c79802a4d04a26f078003a2a8d, type: 2} propertyPath: m_LocalRotation.x @@ -3622,7 +3597,7 @@ Prefab: objectReference: {fileID: 0} - target: {fileID: 436736, guid: 30a269be2fc864c9ea00c7a65636d543, type: 2} propertyPath: m_LocalPosition.z - value: 25.5 + value: 22.5 objectReference: {fileID: 0} - target: {fileID: 436736, guid: 30a269be2fc864c9ea00c7a65636d543, type: 2} propertyPath: m_LocalRotation.x @@ -3992,7 +3967,7 @@ Prefab: objectReference: {fileID: 0} - target: {fileID: 460460, guid: d0e2c3af2985847769c6fc2e016c0e4d, type: 2} propertyPath: m_LocalPosition.z - value: 17 + value: 15 objectReference: {fileID: 0} - target: {fileID: 460460, guid: d0e2c3af2985847769c6fc2e016c0e4d, type: 2} propertyPath: m_LocalRotation.x @@ -4054,7 +4029,7 @@ Prefab: objectReference: {fileID: 0} - target: {fileID: 460460, guid: d0e2c3af2985847769c6fc2e016c0e4d, type: 2} propertyPath: m_LocalPosition.z - value: 2 + value: 1 objectReference: {fileID: 0} - target: {fileID: 460460, guid: d0e2c3af2985847769c6fc2e016c0e4d, type: 2} propertyPath: m_LocalRotation.x @@ -4116,7 +4091,7 @@ Prefab: objectReference: {fileID: 0} - target: {fileID: 436736, guid: 30a269be2fc864c9ea00c7a65636d543, type: 2} propertyPath: m_LocalPosition.z - value: 26 + value: 23 objectReference: {fileID: 0} - target: {fileID: 436736, guid: 30a269be2fc864c9ea00c7a65636d543, type: 2} propertyPath: m_LocalRotation.x @@ -4317,7 +4292,7 @@ Prefab: objectReference: {fileID: 0} - target: {fileID: 482272, guid: c1da36e1b472b4195a4780c9d03c52de, type: 2} propertyPath: m_LocalPosition.z - value: 27.5 + value: 24 objectReference: {fileID: 0} - target: {fileID: 482272, guid: c1da36e1b472b4195a4780c9d03c52de, type: 2} propertyPath: m_LocalRotation.x @@ -4419,7 +4394,7 @@ Prefab: objectReference: {fileID: 0} - target: {fileID: 482272, guid: c1da36e1b472b4195a4780c9d03c52de, type: 2} propertyPath: m_LocalPosition.z - value: 8 + value: 10 objectReference: {fileID: 0} - target: {fileID: 482272, guid: c1da36e1b472b4195a4780c9d03c52de, type: 2} propertyPath: m_LocalRotation.x @@ -4521,7 +4496,7 @@ Prefab: objectReference: {fileID: 0} - target: {fileID: 436736, guid: 30a269be2fc864c9ea00c7a65636d543, type: 2} propertyPath: m_LocalPosition.z - value: 20.5 + value: 17.5 objectReference: {fileID: 0} - target: {fileID: 436736, guid: 30a269be2fc864c9ea00c7a65636d543, type: 2} propertyPath: m_LocalRotation.x @@ -4725,43 +4700,6 @@ Transform: m_Children: [] m_Father: {fileID: 0} m_RootOrder: 7 ---- !u!1 &1452576132 stripped -GameObject: - m_PrefabParentObject: {fileID: 121016, guid: b89b96b93724d4f7489cd31f4f2fda48, type: 2} - m_PrefabInternal: {fileID: 555992081} ---- !u!114 &1452576133 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1452576132} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 5528e050e2d53409f9a4f1662625b0bf, type: 3} - m_Name: - m_EditorClassIdentifier: ---- !u!114 &1452576134 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1452576132} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: c9634e461d1e942de8174ee80528a2d3, type: 3} - m_Name: - m_EditorClassIdentifier: ---- !u!114 &1452576135 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1452576132} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 1925507eee33e42c2a04a1ae1eaa1ec5, type: 3} - m_Name: - m_EditorClassIdentifier: --- !u!1 &1458715212 GameObject: m_ObjectHideFlags: 0 @@ -4858,7 +4796,7 @@ Prefab: objectReference: {fileID: 0} - target: {fileID: 436736, guid: 30a269be2fc864c9ea00c7a65636d543, type: 2} propertyPath: m_LocalPosition.z - value: 27 + value: 23.5 objectReference: {fileID: 0} - target: {fileID: 436736, guid: 30a269be2fc864c9ea00c7a65636d543, type: 2} propertyPath: m_LocalRotation.x @@ -5100,7 +5038,7 @@ Prefab: objectReference: {fileID: 0} - target: {fileID: 452232, guid: bdd4e0dbed4fd4ea980de2f39dac8c71, type: 2} propertyPath: m_LocalPosition.z - value: 16 + value: 14 objectReference: {fileID: 0} - target: {fileID: 452232, guid: bdd4e0dbed4fd4ea980de2f39dac8c71, type: 2} propertyPath: m_LocalRotation.x @@ -5206,7 +5144,7 @@ Prefab: objectReference: {fileID: 0} - target: {fileID: 436798, guid: a60889c79802a4d04a26f078003a2a8d, type: 2} propertyPath: m_LocalPosition.z - value: 18 + value: 16 objectReference: {fileID: 0} - target: {fileID: 436798, guid: a60889c79802a4d04a26f078003a2a8d, type: 2} propertyPath: m_LocalRotation.x @@ -5308,7 +5246,7 @@ Prefab: objectReference: {fileID: 0} - target: {fileID: 452232, guid: bdd4e0dbed4fd4ea980de2f39dac8c71, type: 2} propertyPath: m_LocalPosition.z - value: 1 + value: 2 objectReference: {fileID: 0} - target: {fileID: 452232, guid: bdd4e0dbed4fd4ea980de2f39dac8c71, type: 2} propertyPath: m_LocalRotation.x @@ -5472,7 +5410,7 @@ Prefab: objectReference: {fileID: 0} - target: {fileID: 482272, guid: c1da36e1b472b4195a4780c9d03c52de, type: 2} propertyPath: m_LocalPosition.z - value: 15.5 + value: 13.5 objectReference: {fileID: 0} - target: {fileID: 482272, guid: c1da36e1b472b4195a4780c9d03c52de, type: 2} propertyPath: m_LocalRotation.x @@ -5695,7 +5633,7 @@ Prefab: objectReference: {fileID: 0} - target: {fileID: 452232, guid: bdd4e0dbed4fd4ea980de2f39dac8c71, type: 2} propertyPath: m_LocalPosition.z - value: 6.5 + value: 8.5 objectReference: {fileID: 0} - target: {fileID: 452232, guid: bdd4e0dbed4fd4ea980de2f39dac8c71, type: 2} propertyPath: m_LocalRotation.x @@ -5801,7 +5739,7 @@ Prefab: objectReference: {fileID: 0} - target: {fileID: 436736, guid: 30a269be2fc864c9ea00c7a65636d543, type: 2} propertyPath: m_LocalPosition.z - value: 15 + value: 12 objectReference: {fileID: 0} - target: {fileID: 436736, guid: 30a269be2fc864c9ea00c7a65636d543, type: 2} propertyPath: m_LocalRotation.x @@ -5883,7 +5821,7 @@ Prefab: objectReference: {fileID: 0} - target: {fileID: 436736, guid: 30a269be2fc864c9ea00c7a65636d543, type: 2} propertyPath: m_LocalPosition.z - value: 4.5 + value: 6.5 objectReference: {fileID: 0} - target: {fileID: 436736, guid: 30a269be2fc864c9ea00c7a65636d543, type: 2} propertyPath: m_LocalRotation.x @@ -6035,7 +5973,7 @@ Prefab: objectReference: {fileID: 0} - target: {fileID: 436736, guid: 30a269be2fc864c9ea00c7a65636d543, type: 2} propertyPath: m_LocalPosition.z - value: 10 + value: 11.5 objectReference: {fileID: 0} - target: {fileID: 436736, guid: 30a269be2fc864c9ea00c7a65636d543, type: 2} propertyPath: m_LocalRotation.x @@ -6113,7 +6051,7 @@ Prefab: objectReference: {fileID: 0} - target: {fileID: 436736, guid: 30a269be2fc864c9ea00c7a65636d543, type: 2} propertyPath: m_LocalPosition.z - value: 1.5 + value: 3 objectReference: {fileID: 0} - target: {fileID: 436736, guid: 30a269be2fc864c9ea00c7a65636d543, type: 2} propertyPath: m_LocalRotation.x @@ -6187,7 +6125,7 @@ Prefab: objectReference: {fileID: 0} - target: {fileID: 436736, guid: 30a269be2fc864c9ea00c7a65636d543, type: 2} propertyPath: m_LocalPosition.z - value: 8.5 + value: 10.5 objectReference: {fileID: 0} - target: {fileID: 436736, guid: 30a269be2fc864c9ea00c7a65636d543, type: 2} propertyPath: m_LocalRotation.x @@ -6265,7 +6203,7 @@ Prefab: objectReference: {fileID: 0} - target: {fileID: 436736, guid: 30a269be2fc864c9ea00c7a65636d543, type: 2} propertyPath: m_LocalPosition.z - value: 6 + value: 8 objectReference: {fileID: 0} - target: {fileID: 436736, guid: 30a269be2fc864c9ea00c7a65636d543, type: 2} propertyPath: m_LocalRotation.x diff --git a/Assets/IsoTools/Scripts/IsoBoxCollider.cs b/Assets/IsoTools/Scripts/IsoBoxCollider.cs index fba28c8..73a44ae 100644 --- a/Assets/IsoTools/Scripts/IsoBoxCollider.cs +++ b/Assets/IsoTools/Scripts/IsoBoxCollider.cs @@ -47,9 +47,10 @@ namespace IsoTools { #if UNITY_EDITOR protected override void Reset() { base.Reset(); - var iso_object = GetComponent(); - size = iso_object ? iso_object.size : Vector3.zero; - offset = iso_object ? iso_object.size * 0.5f : Vector3.zero; + var iso_object = GetComponent(); + var iso_object_size = iso_object ? iso_object.size : Vector3.zero; + size = iso_object_size; + offset = iso_object_size * 0.5f; EditorUtility.SetDirty(this); } diff --git a/Assets/IsoTools/Scripts/IsoCapsuleCollider.cs b/Assets/IsoTools/Scripts/IsoCapsuleCollider.cs new file mode 100644 index 0000000..581e464 --- /dev/null +++ b/Assets/IsoTools/Scripts/IsoCapsuleCollider.cs @@ -0,0 +1,111 @@ +using UnityEngine; +using IsoTools.Internal; + +#if UNITY_EDITOR +using UnityEditor; +#endif + +namespace IsoTools { + [RequireComponent(typeof(IsoObject))] + public class IsoCapsuleCollider : IsoCollider { + + [SerializeField] + public float _height = 0.0f; + public float height { + get { return _height; } + set { + _height = value; + if ( realCapsuleCollider ) { + realCapsuleCollider.height = value; + } + } + } + + [SerializeField] + public float _radius = 0.0f; + public float radius { + get { return _radius; } + set { + _radius = value; + if ( realCapsuleCollider ) { + realCapsuleCollider.radius = value; + } + } + } + + [SerializeField] + public Vector3 _offset = Vector3.zero; + public Vector3 offset { + get { return _offset; } + set { + _offset = value; + if ( realCapsuleCollider ) { + realCapsuleCollider.center = value; + } + } + } + + protected override Collider CreateRealCollider(GameObject target) { + var collider = target.AddComponent(); + collider.height = height; + collider.radius = radius; + collider.center = offset; + collider.direction = 2; // z-axis + return collider; + } + + public CapsuleCollider realCapsuleCollider { + get { return realCollider as CapsuleCollider; } + } + + #if UNITY_EDITOR + protected override void Reset() { + base.Reset(); + var iso_object = GetComponent(); + var iso_object_size = iso_object ? iso_object.size : Vector3.zero; + height = iso_object.size.z; + radius = IsoUtils.Vec3MinF(iso_object_size) * 0.5f; + offset = iso_object_size * 0.5f; + EditorUtility.SetDirty(this); + } + + protected override void OnValidate() { + base.OnValidate(); + if ( realCapsuleCollider ) { + realCapsuleCollider.height = height; + realCapsuleCollider.radius = radius; + realCapsuleCollider.center = offset; + } + } + + void OnDrawGizmosSelected() { + var iso_object = GetComponent(); + if ( iso_object && iso_object.isoWorld ) { + if ( radius * 2 < height ) { + IsoUtils.DrawCube( + iso_object.isoWorld, + iso_object.position + offset, + new Vector3(radius * 2.0f, radius * 2.0f, height - radius), + Color.green); + IsoUtils.DrawSphere( + iso_object.isoWorld, + iso_object.position + offset - IsoUtils.Vec3FromZ(height * 0.5f - radius), + radius, + Color.green); + IsoUtils.DrawSphere( + iso_object.isoWorld, + iso_object.position + offset + IsoUtils.Vec3FromZ(height * 0.5f - radius), + radius, + Color.green); + } else { + IsoUtils.DrawSphere( + iso_object.isoWorld, + iso_object.position + offset, + radius, + Color.green); + } + } + } + #endif + } +} diff --git a/Assets/IsoTools/Scripts/IsoCapsuleCollider.cs.meta b/Assets/IsoTools/Scripts/IsoCapsuleCollider.cs.meta new file mode 100644 index 0000000..434eeed --- /dev/null +++ b/Assets/IsoTools/Scripts/IsoCapsuleCollider.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: d4d35c70ee62a44288b95ff88ca8e87c +timeCreated: 1461359219 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/IsoTools/Scripts/IsoObject.cs b/Assets/IsoTools/Scripts/IsoObject.cs index 199ecc7..ecc03f5 100644 --- a/Assets/IsoTools/Scripts/IsoObject.cs +++ b/Assets/IsoTools/Scripts/IsoObject.cs @@ -143,7 +143,6 @@ namespace IsoTools { // // --------------------------------------------------------------------- - public enum Mode { Mode2d, Mode3d diff --git a/Assets/IsoTools/Scripts/IsoSphereCollider.cs b/Assets/IsoTools/Scripts/IsoSphereCollider.cs index 0589dbf..546aa6a 100644 --- a/Assets/IsoTools/Scripts/IsoSphereCollider.cs +++ b/Assets/IsoTools/Scripts/IsoSphereCollider.cs @@ -47,9 +47,10 @@ namespace IsoTools { #if UNITY_EDITOR protected override void Reset() { base.Reset(); - var iso_object = GetComponent(); - radius = iso_object ? IsoUtils.Vec3MinF(iso_object.size) * 0.5f : 0.0f; - offset = iso_object ? iso_object.size * 0.5f : Vector3.zero; + var iso_object = GetComponent(); + var iso_object_size = iso_object ? iso_object.size : Vector3.zero; + radius = IsoUtils.Vec3MinF(iso_object_size) * 0.5f; + offset = iso_object_size * 0.5f; EditorUtility.SetDirty(this); } diff --git a/Assets/IsoTools/Scripts/IsoWorld.cs b/Assets/IsoTools/Scripts/IsoWorld.cs index 8fc1b67..7799497 100644 --- a/Assets/IsoTools/Scripts/IsoWorld.cs +++ b/Assets/IsoTools/Scripts/IsoWorld.cs @@ -410,7 +410,7 @@ namespace IsoTools { } bool IsIsoObjectVisible(IsoObject iso_object) { - var renderers = GetIsoObjectRenderers(iso_object); + var renderers = GetIsoObjectRenderers(iso_object); for ( int i = 0, e = renderers.Count; i < e; ++i ) { if ( renderers[i].isVisible ) { return true;