physics wip

This commit is contained in:
2015-07-05 15:38:12 +06:00
parent 9c700fb06a
commit 569efe5e82
23 changed files with 587 additions and 218 deletions

View File

@@ -19,7 +19,7 @@
<DebugType>full</DebugType> <DebugType>full</DebugType>
<Optimize>false</Optimize> <Optimize>false</Optimize>
<OutputPath>Temp\bin\Debug\</OutputPath> <OutputPath>Temp\bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;UNITY_5_0_2;UNITY_5_0;UNITY_5;ENABLE_LICENSE_RENAME;ENABLE_NEW_BUGREPORTER;ENABLE_2D_PHYSICS;ENABLE_4_6_FEATURES;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_NEW_HIERARCHY;ENABLE_PHYSICS;ENABLE_PHYSICS_PHYSX3;ENABLE_PLUGIN_INSPECTOR;ENABLE_SHADOWS;ENABLE_SINGLE_INSTANCE_BUILD_SETTING;ENABLE_SPRITES;ENABLE_TERRAIN;ENABLE_UNITYEVENTS;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_AUDIOMIXER_SUSPEND;ENABLE_NONPRO;INCLUDE_DYNAMIC_GI;INCLUDE_GI;INCLUDE_IL2CPP;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;UNITY_STANDALONE_OSX;UNITY_STANDALONE;ENABLE_SUBSTANCE;ENABLE_GAMECENTER;ENABLE_TEXTUREID_MAP;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_MONO;ENABLE_PROFILER;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_OSX</DefineConstants> <DefineConstants>DEBUG;TRACE;UNITY_5_1_1;UNITY_5_1;UNITY_5;ENABLE_NEW_BUGREPORTER;ENABLE_2D_PHYSICS;ENABLE_4_6_FEATURES;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_PHYSICS_PHYSX3;ENABLE_PLUGIN_INSPECTOR;ENABLE_SHADOWS;ENABLE_SINGLE_INSTANCE_BUILD_SETTING;ENABLE_SPRITES;ENABLE_TERRAIN;ENABLE_UNET;ENABLE_UNITYEVENTS;ENABLE_VR;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_UNET;ENABLE_CLOUD_LICENSE;ENABLE_AUDIOMIXER_SUSPEND;ENABLE_EDITOR_METRICS;INCLUDE_DYNAMIC_GI;INCLUDE_GI;INCLUDE_IL2CPP;INCLUDE_DIRECTX12;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;ENABLE_LOCALIZATION;UNITY_STANDALONE_OSX;UNITY_STANDALONE;ENABLE_SUBSTANCE;ENABLE_GAMECENTER;ENABLE_TEXTUREID_MAP;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_WEBSOCKET_HOST;ENABLE_MONO;ENABLE_PROFILER;DEBUG;TRACE;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_OSX</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<NoWarn>0169</NoWarn> <NoWarn>0169</NoWarn>
@@ -46,15 +46,22 @@
</Reference> </Reference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Assets\IsoTools\Editor\IsoBoxColliderEditor.cs" />
<Compile Include="Assets\IsoTools\Editor\IsoObjectEditor.cs" /> <Compile Include="Assets\IsoTools\Editor\IsoObjectEditor.cs" />
<Compile Include="Assets\IsoTools\Editor\IsoSphereColliderEditor.cs" />
<Reference Include="UnityEngine.UI"> <Reference Include="UnityEngine.UI">
<HintPath>/Applications/Unity/Unity.app/Contents/UnityExtensions/Unity/GUISystem/UnityEngine.UI.dll</HintPath> <HintPath>/Applications/Unity/Unity.app/Contents/UnityExtensions/Unity/GUISystem/UnityEngine.UI.dll</HintPath>
</Reference> </Reference>
<Reference Include="UnityEditor.UI"> <Reference Include="UnityEditor.UI">
<HintPath>/Applications/Unity/Unity.app/Contents/UnityExtensions/Unity/GUISystem/Editor/UnityEditor.UI.dll</HintPath> <HintPath>/Applications/Unity/Unity.app/Contents/UnityExtensions/Unity/GUISystem/Editor/UnityEditor.UI.dll</HintPath>
</Reference> </Reference>
<Reference Include="UnityEngine.Networking">
<HintPath>/Applications/Unity/Unity.app/Contents/UnityExtensions/Unity/Networking/UnityEngine.Networking.dll</HintPath>
</Reference>
<Reference Include="UnityEditor.Networking">
<HintPath>/Applications/Unity/Unity.app/Contents/UnityExtensions/Unity/Networking/Editor/UnityEditor.Networking.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.Analytics">
<HintPath>/Applications/Unity/Unity.app/Contents/UnityExtensions/Unity/UnityAnalytics/UnityEngine.Analytics.dll</HintPath>
</Reference>
<Reference Include="UnityEditor.Graphs"> <Reference Include="UnityEditor.Graphs">
<HintPath>/Applications/Unity/Unity.app/Contents/Frameworks/Managed/UnityEditor.Graphs.dll</HintPath> <HintPath>/Applications/Unity/Unity.app/Contents/Frameworks/Managed/UnityEditor.Graphs.dll</HintPath>
</Reference> </Reference>
@@ -62,7 +69,7 @@
<HintPath>/Applications/Unity/Unity.app/Contents/PlaybackEngines/AndroidPlayer/UnityEditor.Android.Extensions.dll</HintPath> <HintPath>/Applications/Unity/Unity.app/Contents/PlaybackEngines/AndroidPlayer/UnityEditor.Android.Extensions.dll</HintPath>
</Reference> </Reference>
<Reference Include="UnityEditor.iOS.Extensions"> <Reference Include="UnityEditor.iOS.Extensions">
<HintPath>/Applications/Unity/Unity.app/Contents/PlaybackEngines/iossupport/UnityEditor.iOS.Extensions.dll</HintPath> <HintPath>/Applications/Unity/Unity.app/Contents/PlaybackEngines/iOSSupport/UnityEditor.iOS.Extensions.dll</HintPath>
</Reference> </Reference>
<Reference Include="UnityEditor.BB10.Extensions"> <Reference Include="UnityEditor.BB10.Extensions">
<HintPath>/Applications/Unity/Unity.app/Contents/PlaybackEngines/BlackBerryPlayer/UnityEditor.BB10.Extensions.dll</HintPath> <HintPath>/Applications/Unity/Unity.app/Contents/PlaybackEngines/BlackBerryPlayer/UnityEditor.BB10.Extensions.dll</HintPath>
@@ -83,7 +90,7 @@
<HintPath>/Applications/Unity/Unity.app/Contents/PlaybackEngines/MacStandaloneSupport/UnityEditor.OSXStandalone.Extensions.dll</HintPath> <HintPath>/Applications/Unity/Unity.app/Contents/PlaybackEngines/MacStandaloneSupport/UnityEditor.OSXStandalone.Extensions.dll</HintPath>
</Reference> </Reference>
<Reference Include="UnityEditor.iOS.Extensions.Xcode"> <Reference Include="UnityEditor.iOS.Extensions.Xcode">
<HintPath>/Applications/Unity/Unity.app/Contents/PlaybackEngines/iossupport/UnityEditor.iOS.Extensions.Xcode.dll</HintPath> <HintPath>/Applications/Unity/Unity.app/Contents/PlaybackEngines/iOSSupport/UnityEditor.iOS.Extensions.Xcode.dll</HintPath>
</Reference> </Reference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View File

@@ -19,7 +19,7 @@
<DebugType>full</DebugType> <DebugType>full</DebugType>
<Optimize>false</Optimize> <Optimize>false</Optimize>
<OutputPath>Temp\bin\Debug\</OutputPath> <OutputPath>Temp\bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;UNITY_5_0_2;UNITY_5_0;UNITY_5;ENABLE_LICENSE_RENAME;ENABLE_NEW_BUGREPORTER;ENABLE_2D_PHYSICS;ENABLE_4_6_FEATURES;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_NEW_HIERARCHY;ENABLE_PHYSICS;ENABLE_PHYSICS_PHYSX3;ENABLE_PLUGIN_INSPECTOR;ENABLE_SHADOWS;ENABLE_SINGLE_INSTANCE_BUILD_SETTING;ENABLE_SPRITES;ENABLE_TERRAIN;ENABLE_UNITYEVENTS;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_AUDIOMIXER_SUSPEND;ENABLE_NONPRO;INCLUDE_DYNAMIC_GI;INCLUDE_GI;INCLUDE_IL2CPP;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;UNITY_STANDALONE_OSX;UNITY_STANDALONE;ENABLE_SUBSTANCE;ENABLE_GAMECENTER;ENABLE_TEXTUREID_MAP;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_MONO;ENABLE_PROFILER;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_OSX</DefineConstants> <DefineConstants>DEBUG;TRACE;UNITY_5_1_1;UNITY_5_1;UNITY_5;ENABLE_NEW_BUGREPORTER;ENABLE_2D_PHYSICS;ENABLE_4_6_FEATURES;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_PHYSICS_PHYSX3;ENABLE_PLUGIN_INSPECTOR;ENABLE_SHADOWS;ENABLE_SINGLE_INSTANCE_BUILD_SETTING;ENABLE_SPRITES;ENABLE_TERRAIN;ENABLE_UNET;ENABLE_UNITYEVENTS;ENABLE_VR;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_UNET;ENABLE_CLOUD_LICENSE;ENABLE_AUDIOMIXER_SUSPEND;ENABLE_EDITOR_METRICS;INCLUDE_DYNAMIC_GI;INCLUDE_GI;INCLUDE_IL2CPP;INCLUDE_DIRECTX12;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;ENABLE_LOCALIZATION;UNITY_STANDALONE_OSX;UNITY_STANDALONE;ENABLE_SUBSTANCE;ENABLE_GAMECENTER;ENABLE_TEXTUREID_MAP;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_WEBSOCKET_HOST;ENABLE_MONO;ENABLE_PROFILER;DEBUG;TRACE;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_OSX</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<NoWarn>0169</NoWarn> <NoWarn>0169</NoWarn>
@@ -46,15 +46,22 @@
</Reference> </Reference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Assets\IsoTools\Editor\IsoBoxColliderEditor.cs" />
<Compile Include="Assets\IsoTools\Editor\IsoObjectEditor.cs" /> <Compile Include="Assets\IsoTools\Editor\IsoObjectEditor.cs" />
<Compile Include="Assets\IsoTools\Editor\IsoSphereColliderEditor.cs" />
<Reference Include="UnityEngine.UI"> <Reference Include="UnityEngine.UI">
<HintPath>/Applications/Unity/Unity.app/Contents/UnityExtensions/Unity/GUISystem/UnityEngine.UI.dll</HintPath> <HintPath>/Applications/Unity/Unity.app/Contents/UnityExtensions/Unity/GUISystem/UnityEngine.UI.dll</HintPath>
</Reference> </Reference>
<Reference Include="UnityEditor.UI"> <Reference Include="UnityEditor.UI">
<HintPath>/Applications/Unity/Unity.app/Contents/UnityExtensions/Unity/GUISystem/Editor/UnityEditor.UI.dll</HintPath> <HintPath>/Applications/Unity/Unity.app/Contents/UnityExtensions/Unity/GUISystem/Editor/UnityEditor.UI.dll</HintPath>
</Reference> </Reference>
<Reference Include="UnityEngine.Networking">
<HintPath>/Applications/Unity/Unity.app/Contents/UnityExtensions/Unity/Networking/UnityEngine.Networking.dll</HintPath>
</Reference>
<Reference Include="UnityEditor.Networking">
<HintPath>/Applications/Unity/Unity.app/Contents/UnityExtensions/Unity/Networking/Editor/UnityEditor.Networking.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.Analytics">
<HintPath>/Applications/Unity/Unity.app/Contents/UnityExtensions/Unity/UnityAnalytics/UnityEngine.Analytics.dll</HintPath>
</Reference>
<Reference Include="UnityEditor.Graphs"> <Reference Include="UnityEditor.Graphs">
<HintPath>/Applications/Unity/Unity.app/Contents/Frameworks/Managed/UnityEditor.Graphs.dll</HintPath> <HintPath>/Applications/Unity/Unity.app/Contents/Frameworks/Managed/UnityEditor.Graphs.dll</HintPath>
</Reference> </Reference>
@@ -62,7 +69,7 @@
<HintPath>/Applications/Unity/Unity.app/Contents/PlaybackEngines/AndroidPlayer/UnityEditor.Android.Extensions.dll</HintPath> <HintPath>/Applications/Unity/Unity.app/Contents/PlaybackEngines/AndroidPlayer/UnityEditor.Android.Extensions.dll</HintPath>
</Reference> </Reference>
<Reference Include="UnityEditor.iOS.Extensions"> <Reference Include="UnityEditor.iOS.Extensions">
<HintPath>/Applications/Unity/Unity.app/Contents/PlaybackEngines/iossupport/UnityEditor.iOS.Extensions.dll</HintPath> <HintPath>/Applications/Unity/Unity.app/Contents/PlaybackEngines/iOSSupport/UnityEditor.iOS.Extensions.dll</HintPath>
</Reference> </Reference>
<Reference Include="UnityEditor.BB10.Extensions"> <Reference Include="UnityEditor.BB10.Extensions">
<HintPath>/Applications/Unity/Unity.app/Contents/PlaybackEngines/BlackBerryPlayer/UnityEditor.BB10.Extensions.dll</HintPath> <HintPath>/Applications/Unity/Unity.app/Contents/PlaybackEngines/BlackBerryPlayer/UnityEditor.BB10.Extensions.dll</HintPath>
@@ -83,7 +90,7 @@
<HintPath>/Applications/Unity/Unity.app/Contents/PlaybackEngines/MacStandaloneSupport/UnityEditor.OSXStandalone.Extensions.dll</HintPath> <HintPath>/Applications/Unity/Unity.app/Contents/PlaybackEngines/MacStandaloneSupport/UnityEditor.OSXStandalone.Extensions.dll</HintPath>
</Reference> </Reference>
<Reference Include="UnityEditor.iOS.Extensions.Xcode"> <Reference Include="UnityEditor.iOS.Extensions.Xcode">
<HintPath>/Applications/Unity/Unity.app/Contents/PlaybackEngines/iossupport/UnityEditor.iOS.Extensions.Xcode.dll</HintPath> <HintPath>/Applications/Unity/Unity.app/Contents/PlaybackEngines/iOSSupport/UnityEditor.iOS.Extensions.Xcode.dll</HintPath>
</Reference> </Reference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View File

@@ -19,7 +19,7 @@
<DebugType>full</DebugType> <DebugType>full</DebugType>
<Optimize>false</Optimize> <Optimize>false</Optimize>
<OutputPath>Temp\bin\Debug\</OutputPath> <OutputPath>Temp\bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;UNITY_5_0_2;UNITY_5_0;UNITY_5;ENABLE_LICENSE_RENAME;ENABLE_NEW_BUGREPORTER;ENABLE_2D_PHYSICS;ENABLE_4_6_FEATURES;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_NEW_HIERARCHY;ENABLE_PHYSICS;ENABLE_PHYSICS_PHYSX3;ENABLE_PLUGIN_INSPECTOR;ENABLE_SHADOWS;ENABLE_SINGLE_INSTANCE_BUILD_SETTING;ENABLE_SPRITES;ENABLE_TERRAIN;ENABLE_UNITYEVENTS;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_AUDIOMIXER_SUSPEND;ENABLE_NONPRO;INCLUDE_DYNAMIC_GI;INCLUDE_GI;INCLUDE_IL2CPP;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;UNITY_STANDALONE_OSX;UNITY_STANDALONE;ENABLE_SUBSTANCE;ENABLE_GAMECENTER;ENABLE_TEXTUREID_MAP;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_MONO;ENABLE_PROFILER;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_OSX</DefineConstants> <DefineConstants>DEBUG;TRACE;UNITY_5_1_1;UNITY_5_1;UNITY_5;ENABLE_NEW_BUGREPORTER;ENABLE_2D_PHYSICS;ENABLE_4_6_FEATURES;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_PHYSICS_PHYSX3;ENABLE_PLUGIN_INSPECTOR;ENABLE_SHADOWS;ENABLE_SINGLE_INSTANCE_BUILD_SETTING;ENABLE_SPRITES;ENABLE_TERRAIN;ENABLE_UNET;ENABLE_UNITYEVENTS;ENABLE_VR;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_UNET;ENABLE_CLOUD_LICENSE;ENABLE_AUDIOMIXER_SUSPEND;ENABLE_EDITOR_METRICS;INCLUDE_DYNAMIC_GI;INCLUDE_GI;INCLUDE_IL2CPP;INCLUDE_DIRECTX12;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;ENABLE_LOCALIZATION;UNITY_STANDALONE_OSX;UNITY_STANDALONE;ENABLE_SUBSTANCE;ENABLE_GAMECENTER;ENABLE_TEXTUREID_MAP;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_WEBSOCKET_HOST;ENABLE_MONO;ENABLE_PROFILER;DEBUG;TRACE;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_OSX</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<NoWarn>0169</NoWarn> <NoWarn>0169</NoWarn>
@@ -61,8 +61,14 @@
<Reference Include="UnityEngine.UI"> <Reference Include="UnityEngine.UI">
<HintPath>/Applications/Unity/Unity.app/Contents/UnityExtensions/Unity/GUISystem/UnityEngine.UI.dll</HintPath> <HintPath>/Applications/Unity/Unity.app/Contents/UnityExtensions/Unity/GUISystem/UnityEngine.UI.dll</HintPath>
</Reference> </Reference>
<Reference Include="UnityEngine.Networking">
<HintPath>/Applications/Unity/Unity.app/Contents/UnityExtensions/Unity/Networking/UnityEngine.Networking.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.Analytics">
<HintPath>/Applications/Unity/Unity.app/Contents/UnityExtensions/Unity/UnityAnalytics/UnityEngine.Analytics.dll</HintPath>
</Reference>
<Reference Include="UnityEditor.iOS.Extensions.Xcode"> <Reference Include="UnityEditor.iOS.Extensions.Xcode">
<HintPath>/Applications/Unity/Unity.app/Contents/PlaybackEngines/iossupport/UnityEditor.iOS.Extensions.Xcode.dll</HintPath> <HintPath>/Applications/Unity/Unity.app/Contents/PlaybackEngines/iOSSupport/UnityEditor.iOS.Extensions.Xcode.dll</HintPath>
</Reference> </Reference>
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />

View File

@@ -19,7 +19,7 @@
<DebugType>full</DebugType> <DebugType>full</DebugType>
<Optimize>false</Optimize> <Optimize>false</Optimize>
<OutputPath>Temp\bin\Debug\</OutputPath> <OutputPath>Temp\bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;UNITY_5_0_2;UNITY_5_0;UNITY_5;ENABLE_LICENSE_RENAME;ENABLE_NEW_BUGREPORTER;ENABLE_2D_PHYSICS;ENABLE_4_6_FEATURES;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_NEW_HIERARCHY;ENABLE_PHYSICS;ENABLE_PHYSICS_PHYSX3;ENABLE_PLUGIN_INSPECTOR;ENABLE_SHADOWS;ENABLE_SINGLE_INSTANCE_BUILD_SETTING;ENABLE_SPRITES;ENABLE_TERRAIN;ENABLE_UNITYEVENTS;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_AUDIOMIXER_SUSPEND;ENABLE_NONPRO;INCLUDE_DYNAMIC_GI;INCLUDE_GI;INCLUDE_IL2CPP;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;UNITY_STANDALONE_OSX;UNITY_STANDALONE;ENABLE_SUBSTANCE;ENABLE_GAMECENTER;ENABLE_TEXTUREID_MAP;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_MONO;ENABLE_PROFILER;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_OSX</DefineConstants> <DefineConstants>DEBUG;TRACE;UNITY_5_1_1;UNITY_5_1;UNITY_5;ENABLE_NEW_BUGREPORTER;ENABLE_2D_PHYSICS;ENABLE_4_6_FEATURES;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_PHYSICS_PHYSX3;ENABLE_PLUGIN_INSPECTOR;ENABLE_SHADOWS;ENABLE_SINGLE_INSTANCE_BUILD_SETTING;ENABLE_SPRITES;ENABLE_TERRAIN;ENABLE_UNET;ENABLE_UNITYEVENTS;ENABLE_VR;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_UNET;ENABLE_CLOUD_LICENSE;ENABLE_AUDIOMIXER_SUSPEND;ENABLE_EDITOR_METRICS;INCLUDE_DYNAMIC_GI;INCLUDE_GI;INCLUDE_IL2CPP;INCLUDE_DIRECTX12;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;ENABLE_LOCALIZATION;UNITY_STANDALONE_OSX;UNITY_STANDALONE;ENABLE_SUBSTANCE;ENABLE_GAMECENTER;ENABLE_TEXTUREID_MAP;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_WEBSOCKET_HOST;ENABLE_MONO;ENABLE_PROFILER;DEBUG;TRACE;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_OSX</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<NoWarn>0169</NoWarn> <NoWarn>0169</NoWarn>
@@ -61,8 +61,14 @@
<Reference Include="UnityEngine.UI"> <Reference Include="UnityEngine.UI">
<HintPath>/Applications/Unity/Unity.app/Contents/UnityExtensions/Unity/GUISystem/UnityEngine.UI.dll</HintPath> <HintPath>/Applications/Unity/Unity.app/Contents/UnityExtensions/Unity/GUISystem/UnityEngine.UI.dll</HintPath>
</Reference> </Reference>
<Reference Include="UnityEngine.Networking">
<HintPath>/Applications/Unity/Unity.app/Contents/UnityExtensions/Unity/Networking/UnityEngine.Networking.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.Analytics">
<HintPath>/Applications/Unity/Unity.app/Contents/UnityExtensions/Unity/UnityAnalytics/UnityEngine.Analytics.dll</HintPath>
</Reference>
<Reference Include="UnityEditor.iOS.Extensions.Xcode"> <Reference Include="UnityEditor.iOS.Extensions.Xcode">
<HintPath>/Applications/Unity/Unity.app/Contents/PlaybackEngines/iossupport/UnityEditor.iOS.Extensions.Xcode.dll</HintPath> <HintPath>/Applications/Unity/Unity.app/Contents/PlaybackEngines/iOSSupport/UnityEditor.iOS.Extensions.Xcode.dll</HintPath>
</Reference> </Reference>
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />

View File

@@ -1,21 +0,0 @@
using UnityEngine;
using UnityEditor;
using System.Linq;
namespace IsoTools {
[CustomEditor(typeof(IsoBoxCollider)), CanEditMultipleObjects]
class IsoBoxColliderEditor : Editor {
public override void OnInspectorGUI() {
DrawDefaultInspector();
if ( GUILayout.Button("Reset") ) {
var colliders = targets
.Where(p => p as IsoBoxCollider)
.Select(p => p as IsoBoxCollider);
Undo.RecordObjects(colliders.ToArray(), "Reset");
foreach ( var collider in colliders ) {
collider.EditorReset();
}
}
}
}
} // namespace IsoTools

View File

@@ -1,12 +0,0 @@
fileFormatVersion: 2
guid: f3b3f8161f00e42c4b964264ca55a213
timeCreated: 1434283945
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,21 +0,0 @@
using UnityEngine;
using UnityEditor;
using System.Linq;
namespace IsoTools {
[CustomEditor(typeof(IsoSphereCollider)), CanEditMultipleObjects]
class IsoSphereColliderEditor : Editor {
public override void OnInspectorGUI() {
DrawDefaultInspector();
if ( GUILayout.Button("Reset") ) {
var colliders = targets
.Where(p => p as IsoSphereCollider)
.Select(p => p as IsoSphereCollider);
Undo.RecordObjects(colliders.ToArray(), "Reset");
foreach ( var collider in colliders ) {
collider.EditorReset();
}
}
}
}
} // namespace IsoTools

View File

@@ -1,12 +0,0 @@
fileFormatVersion: 2
guid: 6573b5ff6eda8473f9de383724b83790
timeCreated: 1434283965
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -160,6 +160,7 @@ Camera:
m_OcclusionCulling: 1 m_OcclusionCulling: 1
m_StereoConvergence: 10 m_StereoConvergence: 10
m_StereoSeparation: .0219999999 m_StereoSeparation: .0219999999
m_StereoMirrorMode: 0
--- !u!4 &318480497 --- !u!4 &318480497
Transform: Transform:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -167,11 +168,11 @@ Transform:
m_PrefabInternal: {fileID: 0} m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 318480492} m_GameObject: {fileID: 318480492}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: -6.4000001, z: -10} m_LocalPosition: {x: 0, y: 64, z: -10}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: [] m_Children: []
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 0 m_RootOrder: 2
--- !u!114 &318480498 --- !u!114 &318480498
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -186,3 +187,173 @@ MonoBehaviour:
_tileSize: 16 _tileSize: 16
_minDepth: 0 _minDepth: 0
_maxDepth: 100 _maxDepth: 100
--- !u!1001 &562183236
Prefab:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 453404, guid: d10e5320df9f84d4186bda0ba98db9ff, type: 2}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 453404, guid: d10e5320df9f84d4186bda0ba98db9ff, type: 2}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 453404, guid: d10e5320df9f84d4186bda0ba98db9ff, type: 2}
propertyPath: m_LocalPosition.z
value: 50
objectReference: {fileID: 0}
- target: {fileID: 453404, guid: d10e5320df9f84d4186bda0ba98db9ff, type: 2}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 453404, guid: d10e5320df9f84d4186bda0ba98db9ff, type: 2}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 453404, guid: d10e5320df9f84d4186bda0ba98db9ff, type: 2}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 453404, guid: d10e5320df9f84d4186bda0ba98db9ff, type: 2}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 453404, guid: d10e5320df9f84d4186bda0ba98db9ff, type: 2}
propertyPath: m_RootOrder
value: 0
objectReference: {fileID: 0}
- target: {fileID: 11453404, guid: d10e5320df9f84d4186bda0ba98db9ff, type: 2}
propertyPath: _position.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 11453404, guid: d10e5320df9f84d4186bda0ba98db9ff, type: 2}
propertyPath: _position.x
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: d10e5320df9f84d4186bda0ba98db9ff, type: 2}
m_IsPrefabParent: 0
--- !u!1 &562183237 stripped
GameObject:
m_PrefabParentObject: {fileID: 153404, guid: d10e5320df9f84d4186bda0ba98db9ff, type: 2}
m_PrefabInternal: {fileID: 562183236}
--- !u!114 &562183238
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 562183237}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: b256250c588ee4e4590a3e58eaa69b1d, type: 3}
m_Name:
m_EditorClassIdentifier:
_material: {fileID: 0}
_isTrigger: 0
_size: {x: 3, y: 3, z: 0}
_offset: {x: 1.5, y: 1.5, z: 0}
--- !u!114 &562183239
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 562183237}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4febe544112bb4678bdd59fa963c802d, type: 3}
m_Name:
m_EditorClassIdentifier:
_isKinematic: 1
_interpolation: 0
_collisionDetectionMode: 0
--- !u!1001 &844501808
Prefab:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
propertyPath: m_LocalPosition.y
value: 48
objectReference: {fileID: 0}
- target: {fileID: 417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
propertyPath: m_RootOrder
value: 0
objectReference: {fileID: 0}
- target: {fileID: 11417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
propertyPath: _position.x
value: 1
objectReference: {fileID: 0}
- target: {fileID: 11417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
propertyPath: _position.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 11417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
propertyPath: _position.z
value: 2
objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
m_IsPrefabParent: 0
--- !u!1 &844501809 stripped
GameObject:
m_PrefabParentObject: {fileID: 117528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
m_PrefabInternal: {fileID: 844501808}
--- !u!114 &844501810
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 844501809}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: b256250c588ee4e4590a3e58eaa69b1d, type: 3}
m_Name:
m_EditorClassIdentifier:
_material: {fileID: 0}
_isTrigger: 0
_size: {x: 1, y: 1, z: 1}
_offset: {x: .5, y: .5, z: .5}
--- !u!114 &844501811
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 844501809}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4febe544112bb4678bdd59fa963c802d, type: 3}
m_Name:
m_EditorClassIdentifier:
_isKinematic: 0
_interpolation: 0
_collisionDetectionMode: 0

View File

@@ -5,30 +5,67 @@ using UnityEditor;
#endif #endif
namespace IsoTools { namespace IsoTools {
[RequireComponent(typeof(IsoObject))]
public class IsoBoxCollider : IsoCollider { public class IsoBoxCollider : IsoCollider {
public Vector3 Size = Vector3.zero;
public Vector3 Offset = Vector3.zero;
protected override Collider CreateCollider() { [SerializeField]
var collider = IsoFakeObject.gameObject.AddComponent<BoxCollider>(); public Vector3 _size = Vector3.zero;
collider.center = Offset; public Vector3 Size {
get { return _size; }
set {
_size = value;
if ( RealBoxCollider ) {
RealBoxCollider.size = value;
}
}
}
[SerializeField]
public Vector3 _offset = Vector3.zero;
public Vector3 Offset {
get { return _offset; }
set {
_offset = value;
if ( RealBoxCollider ) {
RealBoxCollider.center = value;
}
}
}
protected override Collider CreateCollider(GameObject target) {
var collider = target.AddComponent<BoxCollider>();
collider.size = Size; collider.size = Size;
collider.center = Offset;
return collider; return collider;
} }
public BoxCollider RealBoxCollider {
get { return RealCollider as BoxCollider; }
}
#if UNITY_EDITOR #if UNITY_EDITOR
public override void EditorReset() { protected override void Reset() {
if ( Application.isEditor ) { base.Reset();
Size = IsoObject.Size; var iso_object = GetComponent<IsoObject>();
Offset = IsoObject.Size * 0.5f; Size = iso_object ? iso_object.Size : Vector3.zero;
EditorUtility.SetDirty(this); Offset = iso_object ? iso_object.Size * 0.5f : Vector3.zero;
EditorUtility.SetDirty(this);
}
protected override void OnValidate() {
base.OnValidate();
if ( RealBoxCollider ) {
RealBoxCollider.size = Size;
RealBoxCollider.center = Offset;
} }
} }
void OnDrawGizmosSelected() { void OnDrawGizmosSelected() {
if ( Application.isEditor ) { var iso_object = GetComponent<IsoObject>();
if ( iso_object && iso_object.IsoWorld ) {
IsoUtils.DrawCube( IsoUtils.DrawCube(
IsoObject.Position + Offset, iso_object.IsoWorld,
iso_object.Position + Offset,
Size, Size,
Color.green); Color.green);
} }

View File

@@ -1,37 +1,84 @@
using UnityEngine; using UnityEngine;
#if UNITY_EDITOR
using UnityEditor;
#endif
namespace IsoTools { namespace IsoTools {
[ExecuteInEditMode] [RequireComponent(typeof(IsoObject))]
[RequireComponent(typeof(IsoPhysicHelper))]
public abstract class IsoCollider : MonoBehaviour { public abstract class IsoCollider : MonoBehaviour {
protected abstract Collider CreateCollider(GameObject target);
public PhysicMaterial Material = null; [SerializeField]
public bool IsTrigger = false; public PhysicMaterial _material = null;
public PhysicMaterial Material {
public IsoObject IsoObject { get { return _material; }
get { return GetComponent<IsoPhysicHelper>().IsoObject; } set {
} _material = value;
if ( RealCollider ) {
public IsoFakeObject IsoFakeObject { RealCollider.material = value;
get { return GetComponent<IsoPhysicHelper>().IsoFakeObject; }
}
public abstract void EditorReset();
protected abstract Collider CreateCollider();
void Awake() {
if ( Application.isPlaying ) {
var collider = CreateCollider();
if ( collider ) {
collider.material = Material;
collider.isTrigger = IsTrigger;
} }
} }
#if UNITY_EDITOR
else if ( Application.isEditor ) {
EditorReset();
}
#endif
} }
[SerializeField]
public bool _isTrigger = false;
public bool IsTrigger {
get { return _isTrigger; }
set {
_isTrigger = value;
if ( RealCollider ) {
RealCollider.isTrigger = value;
}
}
}
Collider _realCollider = null;
public Collider RealCollider {
get { return _realCollider; }
}
void Awake() {
var helper = IsoUtils.GetOrCreateComponent<IsoPhysicHelper>(gameObject);
_realCollider = CreateCollider(helper.IsoFakeObject);
if ( _realCollider ) {
_realCollider.material = Material;
_realCollider.isTrigger = IsTrigger;
}
}
void OnEnable() {
if ( RealCollider ) {
RealCollider.enabled = true;
}
}
void OnDisable() {
if ( RealCollider ) {
RealCollider.enabled = false;
}
}
void OnDestroy() {
if ( _realCollider ) {
Destroy(_realCollider);
_realCollider = null;
}
}
#if UNITY_EDITOR
protected virtual void Reset() {
Material = null;
IsTrigger = false;
EditorUtility.SetDirty(this);
}
protected virtual void OnValidate() {
if ( RealCollider ) {
RealCollider.material = Material;
RealCollider.isTrigger = IsTrigger;
}
}
#endif
} }
} // namespace IsoTools } // namespace IsoTools

View File

@@ -1,7 +1,9 @@
using UnityEngine; using UnityEngine;
using System.Collections.Generic;
namespace IsoTools { namespace IsoTools {
public class IsoFakeObject : MonoBehaviour { public class IsoFakeObject : MonoBehaviour {
IsoObject _isoObject = null; IsoObject _isoObject = null;
Vector3 _lastPosition = Vector3.zero; Vector3 _lastPosition = Vector3.zero;
@@ -23,5 +25,29 @@ namespace IsoTools {
} }
_lastPosition = IsoObject.Position; _lastPosition = IsoObject.Position;
} }
void OnTriggerEnter(Collider collider) {
Debug.LogFormat("OnTriggerEnter: {0}-{1}", gameObject.name, collider.gameObject.name);
}
void OnTriggerExit(Collider collider) {
Debug.LogFormat("OnTriggerExit: {0}-{1}", gameObject.name, collider.gameObject.name);
}
void OnTriggerStay(Collider collider) {
Debug.LogFormat("OnTriggerStay: {0}-{1}", gameObject.name, collider.gameObject.name);
}
void OnCollisionEnter(Collision collision) {
Debug.LogFormat("OnCollisionEnter: {0}-{1}", gameObject.name, collision.gameObject.name);
}
void OnCollisionExit(Collision collision) {
Debug.LogFormat("OnCollisionExit: {0}-{1}", gameObject.name, collision.gameObject.name);
}
void OnCollisionStay(Collision collision) {
Debug.LogFormat("OnCollisionStay: {0}-{1}", gameObject.name, collision.gameObject.name);
}
} }
} // namespace IsoTools } // namespace IsoTools

View File

@@ -252,8 +252,8 @@ namespace IsoTools {
#if UNITY_EDITOR #if UNITY_EDITOR
void OnDrawGizmos() { void OnDrawGizmos() {
if ( ShowBounds ) { if ( ShowBounds && IsoWorld ) {
IsoUtils.DrawCube(Position + Size * 0.5f, Size, Color.red); IsoUtils.DrawCube(IsoWorld, Position + Size * 0.5f, Size, Color.red);
} }
} }

View File

@@ -4,29 +4,25 @@ namespace IsoTools {
[RequireComponent(typeof(IsoObject))] [RequireComponent(typeof(IsoObject))]
public class IsoPhysicHelper : MonoBehaviour { public class IsoPhysicHelper : MonoBehaviour {
IsoObject _isoObject = null; GameObject _isoFakeObject = null;
public IsoObject IsoObject { public GameObject IsoFakeObject {
get { get { return _isoFakeObject; }
if ( !_isoObject ) { }
_isoObject = GetComponent<IsoObject>();
} void Awake() {
if ( !_isoObject ) { hideFlags = HideFlags.HideInInspector;
throw new UnityException("IsoPhysicHelper. IsoObject not found!"); var iso_object = GetComponent<IsoObject>();
} if ( iso_object ) {
return _isoObject; _isoFakeObject = new GameObject("_Fake" + gameObject.name);
_isoFakeObject.AddComponent<IsoFakeObject>().Init(iso_object);
//_isoFakeObject.hideFlags = HideFlags.HideInHierarchy | HideFlags.NotEditable;
} }
} }
IsoFakeObject _isoFakeObject = null; void OnDestroy() {
public IsoFakeObject IsoFakeObject { if ( _isoFakeObject ) {
get { DestroyImmediate(_isoFakeObject);
if ( !_isoFakeObject ) { _isoFakeObject = null;
var go = new GameObject("_Fake" + gameObject.name);
//go.hideFlags = HideFlags.HideInHierarchy | HideFlags.HideInInspector;
_isoFakeObject = go.AddComponent<IsoFakeObject>();
_isoFakeObject.Init(IsoObject);
}
return _isoFakeObject;
} }
} }
} }

View File

@@ -1,31 +1,97 @@
using UnityEngine; using UnityEngine;
#if UNITY_EDITOR
using UnityEditor;
#endif
namespace IsoTools { namespace IsoTools {
[RequireComponent(typeof(IsoPhysicHelper))] [RequireComponent(typeof(IsoObject))]
public class IsoRigidbody : MonoBehaviour { public class IsoRigidbody : MonoBehaviour {
public bool IsKinematic = false; [SerializeField]
public RigidbodyInterpolation Interpolation = RigidbodyInterpolation.None; public bool _isKinematic = false;
public CollisionDetectionMode CollisionMode = CollisionDetectionMode.Discrete; public bool IsKinematic {
get { return _isKinematic; }
public IsoObject IsoObject { set {
get { return GetComponent<IsoPhysicHelper>().IsoObject; } _isKinematic = value;
} if ( RealRigidbody ) {
RealRigidbody.isKinematic = value;
public IsoFakeObject IsoFakeObject { }
get { return GetComponent<IsoPhysicHelper>().IsoFakeObject; } }
} }
[SerializeField]
public RigidbodyInterpolation _interpolation = RigidbodyInterpolation.None;
public RigidbodyInterpolation Interpolation {
get { return _interpolation; }
set {
_interpolation = value;
if ( RealRigidbody ) {
RealRigidbody.interpolation = value;
}
}
}
[SerializeField]
public CollisionDetectionMode _collisionDetectionMode = CollisionDetectionMode.Discrete;
public CollisionDetectionMode CollisionDetectionMode {
get { return _collisionDetectionMode; }
set {
_collisionDetectionMode = value;
if ( RealRigidbody ) {
RealRigidbody.collisionDetectionMode = value;
}
}
}
Rigidbody _realRigidbody = null;
public Rigidbody RealRigidbody { public Rigidbody RealRigidbody {
get { return IsoFakeObject.GetComponent<Rigidbody>(); } get { return _realRigidbody; }
} }
void Awake() { void Awake() {
var rigidbody = IsoFakeObject.gameObject.AddComponent<Rigidbody>(); var helper = IsoUtils.GetOrCreateComponent<IsoPhysicHelper>(gameObject);
rigidbody.freezeRotation = true; _realRigidbody = helper.IsoFakeObject.AddComponent<Rigidbody>();
rigidbody.isKinematic = IsKinematic; _realRigidbody.freezeRotation = true;
rigidbody.interpolation = Interpolation; _realRigidbody.isKinematic = IsKinematic;
rigidbody.collisionDetectionMode = CollisionMode; _realRigidbody.interpolation = Interpolation;
_realRigidbody.collisionDetectionMode = CollisionDetectionMode;
} }
void OnEnable() {
if ( RealRigidbody ) {
RealRigidbody.detectCollisions = true;
}
}
void OnDisable() {
if ( RealRigidbody ) {
RealRigidbody.detectCollisions = false;
}
}
void OnDestroy() {
if ( _realRigidbody ) {
Destroy(_realRigidbody);
_realRigidbody = null;
}
}
#if UNITY_EDITOR
void Reset() {
IsKinematic = false;
Interpolation = RigidbodyInterpolation.None;
CollisionDetectionMode = CollisionDetectionMode.Discrete;
EditorUtility.SetDirty(this);
}
void OnValidate() {
if ( RealRigidbody ) {
RealRigidbody.isKinematic = IsKinematic;
RealRigidbody.interpolation = Interpolation;
RealRigidbody.collisionDetectionMode = CollisionDetectionMode;
}
}
#endif
} }
} // namespace IsoTools } // namespace IsoTools

View File

@@ -5,30 +5,67 @@ using UnityEditor;
#endif #endif
namespace IsoTools { namespace IsoTools {
[RequireComponent(typeof(IsoObject))]
public class IsoSphereCollider : IsoCollider { public class IsoSphereCollider : IsoCollider {
public float Radius = 0.0f;
public Vector3 Offset = Vector3.zero;
protected override Collider CreateCollider() { [SerializeField]
var collider = IsoFakeObject.gameObject.AddComponent<SphereCollider>(); public float _radius = 0.0f;
public float Radius {
get { return _radius; }
set {
_radius = value;
if ( RealSphereCollider ) {
RealSphereCollider.radius = value;
}
}
}
[SerializeField]
public Vector3 _offset = Vector3.zero;
public Vector3 Offset {
get { return _offset; }
set {
_offset = value;
if ( RealSphereCollider ) {
RealSphereCollider.center = value;
}
}
}
protected override Collider CreateCollider(GameObject target) {
var collider = target.AddComponent<SphereCollider>();
collider.radius = Radius; collider.radius = Radius;
collider.center = Offset; collider.center = Offset;
return collider; return collider;
} }
public SphereCollider RealSphereCollider {
get { return RealCollider as SphereCollider; }
}
#if UNITY_EDITOR #if UNITY_EDITOR
public override void EditorReset() { protected override void Reset() {
if ( Application.isEditor ) { base.Reset();
Radius = IsoUtils.Vec3MinF(IsoObject.Size) * 0.5f; var iso_object = GetComponent<IsoObject>();
Offset = IsoObject.Size * 0.5f; Radius = iso_object ? IsoUtils.Vec3MinF(iso_object.Size) * 0.5f : 0.0f;
EditorUtility.SetDirty(this); Offset = iso_object ? iso_object.Size * 0.5f : Vector3.zero;
EditorUtility.SetDirty(this);
}
protected override void OnValidate() {
base.OnValidate();
if ( RealSphereCollider ) {
RealSphereCollider.radius = Radius;
RealSphereCollider.center = Offset;
} }
} }
void OnDrawGizmosSelected() { void OnDrawGizmosSelected() {
if ( Application.isEditor ) { var iso_object = GetComponent<IsoObject>();
if ( iso_object && iso_object.IsoWorld ) {
IsoUtils.DrawSphere( IsoUtils.DrawSphere(
IsoObject.Position + Offset, iso_object.IsoWorld,
iso_object.Position + Offset,
Radius, Radius,
Color.green); Color.green);
} }

View File

@@ -1,7 +1,8 @@
using UnityEngine; using UnityEngine;
using System;
#if UNITY_EDITOR
using UnityEditor; using UnityEditor;
#endif
namespace IsoTools { namespace IsoTools {
public static class IsoUtils { public static class IsoUtils {
@@ -346,14 +347,14 @@ namespace IsoTools {
// //
// --------------------------------------------------------------------- // ---------------------------------------------------------------------
public static void LookUpCube(Vector2 min, Vector2 max, Action<Vector2> act) { public static void LookUpCube(Vector2 min, Vector2 max, System.Action<Vector2> act) {
for ( var y = min.y; y < max.y; ++y ) { for ( var y = min.y; y < max.y; ++y ) {
for ( var x = min.x; x < max.x; ++x ) { for ( var x = min.x; x < max.x; ++x ) {
act(new Vector2(x, y)); act(new Vector2(x, y));
}} }}
} }
public static void LookUpCube(Vector3 min, Vector3 max, Action<Vector3> act) { public static void LookUpCube(Vector3 min, Vector3 max, System.Action<Vector3> act) {
for ( var z = min.z; z < max.z; ++z ) { for ( var z = min.z; z < max.z; ++z ) {
for ( var y = min.y; y < max.y; ++y ) { for ( var y = min.y; y < max.y; ++y ) {
for ( var x = min.x; x < max.x; ++x ) { for ( var x = min.x; x < max.x; ++x ) {
@@ -361,6 +362,19 @@ namespace IsoTools {
}}} }}}
} }
// ---------------------------------------------------------------------
//
// Helpers
//
// ---------------------------------------------------------------------
public static T GetOrCreateComponent<T>(GameObject obj) where T : Component {
var comp = obj.GetComponent<T>();
return comp != null
? comp
: obj.AddComponent<T>();
}
// --------------------------------------------------------------------- // ---------------------------------------------------------------------
// //
// Debug draw // Debug draw
@@ -368,8 +382,7 @@ namespace IsoTools {
// --------------------------------------------------------------------- // ---------------------------------------------------------------------
#if UNITY_EDITOR #if UNITY_EDITOR
static void DrawTop(Vector3 pos, Vector3 size) { static void DrawTop(IsoWorld iso_world, Vector3 pos, Vector3 size) {
var iso_world = GameObject.FindObjectOfType<IsoWorld>();
if ( iso_world ) { if ( iso_world ) {
var points = new Vector3[]{ var points = new Vector3[]{
iso_world.IsoToScreen(pos), iso_world.IsoToScreen(pos),
@@ -378,35 +391,35 @@ namespace IsoTools {
iso_world.IsoToScreen(pos + IsoUtils.Vec3FromY(size.y)), iso_world.IsoToScreen(pos + IsoUtils.Vec3FromY(size.y)),
iso_world.IsoToScreen(pos) iso_world.IsoToScreen(pos)
}; };
Gizmos.DrawLine(points[0], points[1]); Handles.DrawLine(points[0], points[1]);
Gizmos.DrawLine(points[1], points[2]); Handles.DrawLine(points[1], points[2]);
Gizmos.DrawLine(points[2], points[3]); Handles.DrawLine(points[2], points[3]);
Gizmos.DrawLine(points[3], points[0]); Handles.DrawLine(points[3], points[0]);
} }
} }
static void DrawVert(Vector3 pos, Vector3 size) { static void DrawVert(IsoWorld iso_world, Vector3 pos, Vector3 size) {
var iso_world = GameObject.FindObjectOfType<IsoWorld>();
if ( iso_world ) { if ( iso_world ) {
Gizmos.DrawLine( Handles.DrawLine(
iso_world.IsoToScreen(pos), iso_world.IsoToScreen(pos),
iso_world.IsoToScreen(pos + IsoUtils.Vec3FromZ(size.z))); iso_world.IsoToScreen(pos + IsoUtils.Vec3FromZ(size.z)));
} }
} }
public static void DrawCube(Vector3 center, Vector3 size, Color color) { public static void DrawCube(IsoWorld iso_world, Vector3 center, Vector3 size, Color color) {
Gizmos.color = color; if ( iso_world ) {
var pos = center - size * 0.5f; Handles.color = color;
DrawTop (pos, size); var pos = center - size * 0.5f;
DrawTop (pos + IsoUtils.Vec3FromZ(size.z), size); DrawTop (iso_world, pos, size);
DrawVert(pos, size); DrawTop (iso_world, pos + IsoUtils.Vec3FromZ(size.z), size);
DrawVert(pos + IsoUtils.Vec3FromX(size.x), size); DrawVert(iso_world, pos, size);
DrawVert(pos + IsoUtils.Vec3FromY(size.y), size); DrawVert(iso_world, pos + IsoUtils.Vec3FromX(size.x), size);
DrawVert(pos + IsoUtils.Vec3FromXY(size.x, size.y), size); DrawVert(iso_world, pos + IsoUtils.Vec3FromY(size.y), size);
DrawVert(iso_world, pos + IsoUtils.Vec3FromXY(size.x, size.y), size);
}
} }
public static void DrawSphere(Vector3 pos, float radius, Color color) { public static void DrawSphere(IsoWorld iso_world, Vector3 pos, float radius, Color color) {
var iso_world = GameObject.FindObjectOfType<IsoWorld>();
if ( iso_world ) { if ( iso_world ) {
Handles.color = color; Handles.color = color;
Handles.RadiusHandle( Handles.RadiusHandle(

View File

@@ -1,5 +1,4 @@
using UnityEngine; using UnityEngine;
using System;
using System.Linq; using System.Linq;
using System.Collections.Generic; using System.Collections.Generic;
@@ -59,7 +58,7 @@ namespace IsoTools {
public float TileSize { public float TileSize {
get { return _tileSize; } get { return _tileSize; }
set { set {
_tileSize = Math.Max(value, Mathf.Epsilon); _tileSize = Mathf.Max(value, Mathf.Epsilon);
ChangeSortingProperty(); ChangeSortingProperty();
} }
} }
@@ -172,7 +171,7 @@ namespace IsoTools {
#endif #endif
} }
void ApplyToAllIsoObjects(Action<IsoObject> act) { void ApplyToAllIsoObjects(System.Action<IsoObject> act) {
var iso_objects = GameObject.FindObjectsOfType<IsoObject>(); var iso_objects = GameObject.FindObjectsOfType<IsoObject>();
foreach ( var obj in iso_objects ) { foreach ( var obj in iso_objects ) {
act(obj); act(obj);
@@ -219,7 +218,7 @@ namespace IsoTools {
return _sectors[SectorIndex(num_pos)]; return _sectors[SectorIndex(num_pos)];
} }
void LookUpSectorDepends(Vector3 num_pos, Action<SectorInfo> act) { void LookUpSectorDepends(Vector3 num_pos, System.Action<SectorInfo> act) {
var ms = FindSector(num_pos); var ms = FindSector(num_pos);
if ( ms != null ) { if ( ms != null ) {
act(ms); act(ms);
@@ -350,7 +349,7 @@ namespace IsoTools {
} }
void PlaceObject(IsoObject obj, float depth) { void PlaceObject(IsoObject obj, float depth) {
var trans = obj.gameObject.transform; var trans = obj.transform;
trans.position = IsoUtils.Vec3ChangeZ(trans.position, depth); trans.position = IsoUtils.Vec3ChangeZ(trans.position, depth);
} }

View File

@@ -3,17 +3,14 @@
--- !u!129 &1 --- !u!129 &1
PlayerSettings: PlayerSettings:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
serializedVersion: 6 serializedVersion: 7
AndroidProfiler: 0 AndroidProfiler: 0
defaultScreenOrientation: 4 defaultScreenOrientation: 4
targetDevice: 2 targetDevice: 2
targetGlesGraphics: 1
targetIOSGraphics: -1
targetResolution: 0 targetResolution: 0
accelerometerFrequency: 60 accelerometerFrequency: 60
companyName: DefaultCompany companyName: BlackMat
productName: UnityIso productName: UnityIso
cloudProjectId:
defaultCursor: {fileID: 0} defaultCursor: {fileID: 0}
cursorHotspot: {x: 0, y: 0} cursorHotspot: {x: 0, y: 0}
m_ShowUnitySplashScreen: 1 m_ShowUnitySplashScreen: 1
@@ -26,7 +23,6 @@ PlayerSettings:
m_ActiveColorSpace: 0 m_ActiveColorSpace: 0
m_MTRendering: 1 m_MTRendering: 1
m_MobileMTRendering: 0 m_MobileMTRendering: 0
m_UseDX11: 1
m_Stereoscopic3D: 0 m_Stereoscopic3D: 0
iosShowActivityIndicatorOnLoading: -1 iosShowActivityIndicatorOnLoading: -1
androidShowActivityIndicatorOnLoading: -1 androidShowActivityIndicatorOnLoading: -1
@@ -81,6 +77,7 @@ PlayerSettings:
metroEnableIndependentInputSource: 0 metroEnableIndependentInputSource: 0
metroEnableLowLatencyPresentationAPI: 0 metroEnableLowLatencyPresentationAPI: 0
xboxOneDisableKinectGpuReservation: 0 xboxOneDisableKinectGpuReservation: 0
virtualRealitySupported: 0
productGUID: 0ae4d8e5611a65d45bd97550aa4471af productGUID: 0ae4d8e5611a65d45bd97550aa4471af
AndroidBundleVersionCode: 1 AndroidBundleVersionCode: 1
AndroidMinSdkVersion: 9 AndroidMinSdkVersion: 9
@@ -123,6 +120,7 @@ PlayerSettings:
iOSLaunchScreenCustomXibPath: iOSLaunchScreenCustomXibPath:
AndroidTargetDevice: 0 AndroidTargetDevice: 0
AndroidSplashScreenScale: 0 AndroidSplashScreenScale: 0
androidSplashScreen: {fileID: 0}
AndroidKeystoreName: AndroidKeystoreName:
AndroidKeyaliasName: AndroidKeyaliasName:
AndroidTVCompatibility: 1 AndroidTVCompatibility: 1
@@ -134,8 +132,16 @@ PlayerSettings:
banner: {fileID: 0} banner: {fileID: 0}
androidGamepadSupportLevel: 0 androidGamepadSupportLevel: 0
resolutionDialogBanner: {fileID: 0} resolutionDialogBanner: {fileID: 0}
m_BuildTargetIcons: [] m_BuildTargetIcons:
- m_BuildTarget:
m_Icons:
- m_Icon: {fileID: 0}
m_Size: 128
m_BuildTargetBatching: [] m_BuildTargetBatching: []
m_BuildTargetGraphicsAPIs:
- m_BuildTarget: AndroidPlayer
m_APIs: 08000000
m_Automatic: 0
webPlayerTemplate: APPLICATION:Default webPlayerTemplate: APPLICATION:Default
m_TemplateCustomTags: {} m_TemplateCustomTags: {}
actionOnDotNetUnhandledException: 1 actionOnDotNetUnhandledException: 1
@@ -197,6 +203,7 @@ PlayerSettings:
ps4ApplicationParam2: 0 ps4ApplicationParam2: 0
ps4ApplicationParam3: 0 ps4ApplicationParam3: 0
ps4ApplicationParam4: 0 ps4ApplicationParam4: 0
ps4GarlicHeapSize: 2048
ps4Passcode: KgSnOxla5PMvVHtMgwLFr7qLEJsRxHBI ps4Passcode: KgSnOxla5PMvVHtMgwLFr7qLEJsRxHBI
ps4pnSessions: 1 ps4pnSessions: 1
ps4pnPresence: 1 ps4pnPresence: 1
@@ -252,7 +259,8 @@ PlayerSettings:
psp2InfoBarColor: 0 psp2InfoBarColor: 0
psmSplashimage: {fileID: 0} psmSplashimage: {fileID: 0}
spritePackerPolicy: spritePackerPolicy:
scriptingDefineSymbols: {} scriptingDefineSymbols:
1:
metroPackageName: UnityIso metroPackageName: UnityIso
metroPackageLogo: metroPackageLogo:
metroPackageLogo140: metroPackageLogo140:
@@ -339,8 +347,7 @@ PlayerSettings:
blackberrySquareSplashScreen: {fileID: 0} blackberrySquareSplashScreen: {fileID: 0}
tizenProductDescription: tizenProductDescription:
tizenProductURL: tizenProductURL:
tizenCertificatePath: tizenSigningProfileName:
tizenCertificatePassword:
tizenGPSPermissions: 0 tizenGPSPermissions: 0
tizenMicrophonePermissions: 0 tizenMicrophonePermissions: 0
stvDeviceAddress: stvDeviceAddress:
@@ -378,14 +385,23 @@ PlayerSettings:
WebGL::audioCompressionFormat: 4 WebGL::audioCompressionFormat: 4
WebGL::exceptionSupport: 0 WebGL::exceptionSupport: 0
WebGL::memorySize: 256 WebGL::memorySize: 256
iOS::Architecture: 2 iOS::Architecture: 0
iOS::ScriptingBackend: 0 iOS::ScriptingBackend: 0
boolPropertyNames: boolPropertyNames:
- WebGL::analyzeBuildSize
- WebGL::dataCaching - WebGL::dataCaching
- WebGL::useEmbeddedResources
WebGL::analyzeBuildSize: 0
WebGL::dataCaching: 0 WebGL::dataCaching: 0
WebGL::useEmbeddedResources: 0
stringPropertyNames: stringPropertyNames:
- WebGL::emscriptenArgs - WebGL::emscriptenArgs
- WebGL::template - WebGL::template
WebGL::emscriptenArgs: WebGL::emscriptenArgs:
WebGL::template: APPLICATION:Default WebGL::template: APPLICATION:Default
firstStreamedLevelWithResources: 0 firstStreamedSceneWithResources: 0
cloudProjectId:
projectId:
projectName:
organizationId:
cloudEnabled: 0

View File

@@ -1,2 +1,2 @@
m_EditorVersion: 5.0.2f1 m_EditorVersion: 5.1.1f1
m_StandardAssetsVersion: 0 m_StandardAssetsVersion: 0

View File

@@ -23,7 +23,7 @@ Global
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
EndGlobalSection EndGlobalSection
GlobalSection(MonoDevelopProperties) = preSolution GlobalSection(MonoDevelopProperties) = preSolution
StartupItem = Assembly-CSharp.csproj StartupItem = Assembly-CSharp.csproj
Policies = $0 Policies = $0
$0.TextStylePolicy = $1 $0.TextStylePolicy = $1

View File

@@ -23,7 +23,7 @@ Global
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
EndGlobalSection EndGlobalSection
GlobalSection(MonoDevelopProperties) = preSolution GlobalSection(MonoDevelopProperties) = preSolution
StartupItem = Assembly-CSharp.csproj StartupItem = Assembly-CSharp.csproj
Policies = $0 Policies = $0
$0.TextStylePolicy = $1 $0.TextStylePolicy = $1

View File

@@ -1,9 +1,10 @@
<Properties> <Properties>
<MonoDevelop.Ide.Workspace ActiveConfiguration="Debug" PreferredExecutionTarget="MonoDevelop.Default" /> <MonoDevelop.Ide.Workspace ActiveConfiguration="Debug" />
<MonoDevelop.Ide.Workbench ActiveDocument="Assets/IsoTools/Scripts/IsoPhysicHelper.cs"> <MonoDevelop.Ide.Workbench ActiveDocument="Assets/IsoTools/Scripts/IsoFakeObject.cs">
<Files> <Files>
<File FileName="Assets/IsoTools/Scripts/IsoPhysicHelper.cs" Line="8" Column="3" /> <File FileName="Assets/IsoTools/Scripts/IsoPhysicHelper.cs" Line="44" Column="24" />
<File FileName="Assets/IsoTools/Scripts/IsoCollider.cs" Line="4" Column="2" /> <File FileName="Assets/IsoTools/Scripts/IsoFakeObject.cs" Line="58" Column="37" />
<File FileName="Assets/IsoTools/Scripts/IsoCollider.cs" Line="31" Column="4" />
</Files> </Files>
</MonoDevelop.Ide.Workbench> </MonoDevelop.Ide.Workbench>
<MonoDevelop.Ide.DebuggingService.Breakpoints> <MonoDevelop.Ide.DebuggingService.Breakpoints>