mirror of
https://github.com/BlackMATov/unity-iso-tools.git
synced 2026-01-06 03:21:15 +07:00
Compare commits
304 Commits
1.4_review
...
3.0.6_revi
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7562afc37f | ||
|
|
772b3c7fc6 | ||
|
|
b175720fe1 | ||
| eab56615bc | |||
| 3c029384b8 | |||
| 0a3b85aef7 | |||
| d4de46f747 | |||
| 3bc2e45e0e | |||
| 454477a910 | |||
| 4f5197c138 | |||
| b7798b3ce0 | |||
| e7743e0b23 | |||
| 9611419aca | |||
| 82b2ef048c | |||
| 17a5f3461b | |||
| 5598188257 | |||
| f63205fcfb | |||
| f4ff267bc8 | |||
| c15b554759 | |||
| 20a3c5af59 | |||
| 5835494ebc | |||
| 696984fb06 | |||
| 5127b83dc4 | |||
| 16a671cba5 | |||
| 3b39893d39 | |||
| 4d7b8a0e7a | |||
| 6121483d21 | |||
| d636b19119 | |||
| 63f5ccff61 | |||
| ed980cfbd8 | |||
| ac8a1a670d | |||
| 33bc36687d | |||
| 97db117b84 | |||
| d3ee8394f7 | |||
| 5a68df63b2 | |||
| 9eaf2733dc | |||
| 736891754b | |||
| b407ff13de | |||
| 4dbdfd04b2 | |||
| 0d7ab882e5 | |||
| badbb0a53c | |||
| 7be90fa61a | |||
| f0b7f3165c | |||
| 26dbd35324 | |||
| df7838dd52 | |||
| f0ff0b16f8 | |||
| 336e2aecb9 | |||
| 6e15ee2d45 | |||
| 70a28c743d | |||
| f1a3025d44 | |||
| 6afa1e24f6 | |||
| c6de29bd5a | |||
| 7c40167da8 | |||
| 1c0a66cd01 | |||
| 8f997be60d | |||
| 10a33b001c | |||
| bebe8644ef | |||
| 3e9c6a8377 | |||
| 864727a50d | |||
| a7f4fee821 | |||
| 486c95f9cd | |||
| af5077a96d | |||
| 72c0850445 | |||
| 780d0391aa | |||
| 9bef427c5f | |||
| f3ed1f3236 | |||
| a0ec6a93eb | |||
| cc08f1e2c7 | |||
| 985274a710 | |||
| fde18817fa | |||
| 236e72d879 | |||
| c5084b1596 | |||
| d3016c5603 | |||
| 204960372a | |||
| 93b11c5ea0 | |||
| afd19224bb | |||
| 2d6f8d37f6 | |||
| 2ff0b86135 | |||
| b79a1adcd4 | |||
| fc6fac0ea2 | |||
| 8cff61ae91 | |||
| d74728b4df | |||
| d1fecf808e | |||
| 2a8a48d360 | |||
| 1627bf4f54 | |||
| ef85079c64 | |||
| eb533aa868 | |||
| 9e21f078ed | |||
| bdb2fdc489 | |||
| 475d3ece51 | |||
| 931e0267d9 | |||
| 26b4f8e7a6 | |||
| b3922d5cfe | |||
| 0746be1275 | |||
| 49a78c0d3f | |||
| dddd778c34 | |||
| 219799c404 | |||
| 71b609a6c8 | |||
| 521c0d2ff2 | |||
| e1c09e4552 | |||
| 184c903381 | |||
| 49ef44273e | |||
| 2493ffe382 | |||
| 302b0fdd25 | |||
| 22edab4e2a | |||
| 8227a29a22 | |||
| 14c5ab487c | |||
| c0c29b64c3 | |||
| 406a05675c | |||
| 88317b80f1 | |||
| 5a5dabf882 | |||
| 83ced8f772 | |||
| 4326c80a68 | |||
| f51d88e355 | |||
| 890e54f1b0 | |||
| e6ba2d8eb2 | |||
| 94dc2fa581 | |||
| 6c0e843b7f | |||
| eadc44f9f1 | |||
| b6a0f5c043 | |||
| 999685cf1a | |||
| 23ce28152c | |||
| 300f2eb8ca | |||
| 3bfc07706f | |||
| e80da29acb | |||
| 0bac02a4a2 | |||
| c6802b430c | |||
| 4948f4c155 | |||
| 956d516338 | |||
| b1155d8284 | |||
| 642e508274 | |||
| b261977094 | |||
| f849ecb529 | |||
| fa022b6f65 | |||
| d53e8caf97 | |||
| ff4faec197 | |||
| bff9b5ca3a | |||
| 811466a749 | |||
| 40349a896a | |||
| 4f33a070d9 | |||
| a0270bf6ff | |||
| cdeeea6e4e | |||
| 63949412f0 | |||
| f9c391aa59 | |||
| ef5be56a8f | |||
| effb5f7b09 | |||
| 3ead69dd27 | |||
| 40488f9424 | |||
| 92ed826849 | |||
| a9706465e1 | |||
| c21d33cd77 | |||
| 469f674f69 | |||
| 27dc8cb35a | |||
| ae568870c9 | |||
| 3e5542e38d | |||
| 7656f3c565 | |||
| 12e944b068 | |||
| 68ca004cbd | |||
| 91195b66a6 | |||
| 7c22b52489 | |||
| 8d5a177eb1 | |||
| c1d521e96a | |||
| fccf22b3cd | |||
| bdc20eea4b | |||
| d6343af20b | |||
| 295cad24e2 | |||
| 4811872cad | |||
| be4ca04e3b | |||
| 17058f859e | |||
| 4848b817c7 | |||
| 0ee0153a7a | |||
| 4c1fcbe92c | |||
| d434881a88 | |||
| aa6637bb3d | |||
| 4bf3be6c79 | |||
| 9704155e72 | |||
| ba02ef7803 | |||
| 0ed90de773 | |||
| 244b672b23 | |||
| ba482724d3 | |||
| 116fd56174 | |||
| d406548240 | |||
| 13ca62cfdc | |||
| a4061b9af0 | |||
| 8c4b0eccac | |||
| ba1c51fcb7 | |||
| 7be576f7b3 | |||
| 133df2d20e | |||
| 7297a81dea | |||
| fe2092860f | |||
| ff36b3f6be | |||
| 0ad52b3800 | |||
| 17c5ce898e | |||
| 1920b49e47 | |||
| 46e2e830b5 | |||
| bb6e9994bb | |||
| ca713128cf | |||
| 1d1f7afb05 | |||
| bd1c518f87 | |||
| af12a9f6e2 | |||
| 944b40b430 | |||
| 7bb01a9e7b | |||
| 6133140820 | |||
| 69401614a6 | |||
| 31d9787cae | |||
| 21cab16b7d | |||
| 396669e860 | |||
| 6ef010b147 | |||
| 7c867f36ff | |||
| c16c0d7c28 | |||
| 8664e3b438 | |||
| 6c7a10c348 | |||
| aa737810bd | |||
| f153ed49df | |||
| 2c21599d61 | |||
| 6574c1c810 | |||
| 5f2156de14 | |||
| 5a462b370e | |||
| c3c6a7ac8a | |||
| 4f2bc0b3ac | |||
| 9291d29cba | |||
| c92716ff01 | |||
| 90f2ab83ba | |||
| bc82489593 | |||
| 69bcec0ca9 | |||
| 3ba6543f38 | |||
| cd540daa22 | |||
| 63edf259e2 | |||
| e8627d11ee | |||
| ffaed11858 | |||
| 5faab57140 | |||
| c50a105368 | |||
| 93740f5a3c | |||
| 6bdee45867 | |||
| 9010d9a3ae | |||
| c6cad2e0bc | |||
| cc8138a942 | |||
| a1f5276f6d | |||
| 7c84319132 | |||
| 7180f6f8db | |||
| 22df2d021c | |||
| 5fc9fef7dc | |||
| e3f272fe46 | |||
| e9034dff1f | |||
| 67e483d42c | |||
| c786606297 | |||
| d5be0ec0dd | |||
| 8d7f4e0093 | |||
| 41574c293a | |||
| d83fe0f094 | |||
| 706b13d990 | |||
| 62d94afa73 | |||
| 7e015ec21e | |||
| 925d5df7b3 | |||
| 868ad69b44 | |||
| bb46149fbd | |||
| 8b6e84857e | |||
| 4eacdfa205 | |||
| 8513938f3f | |||
| 61c5286ff8 | |||
| e07b70ae2b | |||
| b52c52870f | |||
| 3a0d4e3b2f | |||
| dbb2ae39a3 | |||
| e2565fd74c | |||
| d8b4886aa9 | |||
| 01ef7fc860 | |||
| 5f99a6d537 | |||
| 5cce4fd9c0 | |||
| 13e900f811 | |||
| 217285eeec | |||
| d6eb47100a | |||
| 52a96ecf44 | |||
| 04ea4b75cf | |||
| 8d1e8e7deb | |||
| cf6a71f0c3 | |||
| 4ab3de12e7 | |||
| 1d2910fb3b | |||
| cd145c5f57 | |||
| 3415970378 | |||
| 66c247712e | |||
| 36c0546f29 | |||
| ff77d077e2 | |||
| 3437fa40ce | |||
| ff2db6d279 | |||
| 8aeca49513 | |||
| a294088ea7 | |||
| 74503911a5 | |||
| d26c7e4a12 | |||
| 1b7a7e115c | |||
| 7342b70d82 | |||
| ba3448a39b | |||
| 569efe5e82 | |||
| 9c700fb06a | |||
| 33645632a6 | |||
| f6b69c72b5 | |||
| e0ac3b82cd | |||
| 918284ca6d | |||
| 16825a6512 | |||
| b638117c89 | |||
| 5fd2f46ab8 | |||
| 31f834c48c | |||
| 65a02ceb1d | |||
| 05c29ce6c3 |
15
.gitignore
vendored
Normal file
15
.gitignore
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
.vs/*
|
||||
.vscode/*
|
||||
|
||||
obj/*
|
||||
Temp/*
|
||||
Library/*
|
||||
|
||||
Assets/AssetStoreTools/*
|
||||
Assets/AssetStoreTools.meta
|
||||
|
||||
.DS_Store
|
||||
iso-tools.sln
|
||||
iso-tools.userprefs
|
||||
Assembly-CSharp.csproj
|
||||
Assembly-CSharp-Editor.csproj
|
||||
@@ -1,68 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>10.0.20506</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{7D717A69-578D-258F-954A-2360437723EF}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace></RootNamespace>
|
||||
<AssemblyName>Assembly-CSharp</AssemblyName>
|
||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<BaseDirectory>Assets</BaseDirectory>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>Temp\bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE;UNITY_5_0_0;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;UNITY_TEAM_LICENSE;UNITY_PRO_LICENSE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<NoWarn>0169</NoWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>Temp\bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<NoWarn>0169</NoWarn>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.XML" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="UnityEngine">
|
||||
<HintPath>/Applications/Unity/Unity.app/Contents/Frameworks/Managed/UnityEngine.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEditor">
|
||||
<HintPath>/Applications/Unity/Unity.app/Contents/Frameworks/Managed/UnityEditor.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Assets\IsoTools\Examples\Scripts\CircleFlyCamera.cs" />
|
||||
<Compile Include="Assets\IsoTools\Examples\Scripts\IsoAutoController.cs" />
|
||||
<Compile Include="Assets\IsoTools\Examples\Scripts\IsoController.cs" />
|
||||
<Compile Include="Assets\IsoTools\Scripts\IsoObject.cs" />
|
||||
<Compile Include="Assets\IsoTools\Scripts\IsoUtils.cs" />
|
||||
<Compile Include="Assets\IsoTools\Scripts\IsoWorld.cs" />
|
||||
<Reference Include="UnityEngine.UI">
|
||||
<HintPath>/Applications/Unity/Unity.app/Contents/UnityExtensions/Unity/GUISystem/UnityEngine.UI.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
|
||||
</Project>
|
||||
@@ -1,68 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>10.0.20506</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{7D717A69-578D-258F-954A-2360437723EF}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace></RootNamespace>
|
||||
<AssemblyName>Assembly-CSharp</AssemblyName>
|
||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<BaseDirectory>Assets</BaseDirectory>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>Temp\bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE;UNITY_5_0_0;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;UNITY_TEAM_LICENSE;UNITY_PRO_LICENSE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<NoWarn>0169</NoWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>Temp\bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<NoWarn>0169</NoWarn>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.XML" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="UnityEngine">
|
||||
<HintPath>/Applications/Unity/Unity.app/Contents/Frameworks/Managed/UnityEngine.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEditor">
|
||||
<HintPath>/Applications/Unity/Unity.app/Contents/Frameworks/Managed/UnityEditor.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Assets\IsoTools\Examples\Scripts\CircleFlyCamera.cs" />
|
||||
<Compile Include="Assets\IsoTools\Examples\Scripts\IsoAutoController.cs" />
|
||||
<Compile Include="Assets\IsoTools\Examples\Scripts\IsoController.cs" />
|
||||
<Compile Include="Assets\IsoTools\Scripts\IsoObject.cs" />
|
||||
<Compile Include="Assets\IsoTools\Scripts\IsoUtils.cs" />
|
||||
<Compile Include="Assets\IsoTools\Scripts\IsoWorld.cs" />
|
||||
<Reference Include="UnityEngine.UI">
|
||||
<HintPath>/Applications/Unity/Unity.app/Contents/UnityExtensions/Unity/GUISystem/UnityEngine.UI.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
|
||||
</Project>
|
||||
9
Assets/IsoTools/Addons.meta
Normal file
9
Assets/IsoTools/Addons.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 90df07b38ec6e4d678babdff7426f98e
|
||||
folderAsset: yes
|
||||
timeCreated: 1477130201
|
||||
licenseType: Free
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
9
Assets/IsoTools/Addons/Physics.meta
Normal file
9
Assets/IsoTools/Addons/Physics.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8dd47e4d38ef9485586318e48755aff9
|
||||
folderAsset: yes
|
||||
timeCreated: 1480174284
|
||||
licenseType: Free
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
9
Assets/IsoTools/Addons/Physics/Internal.meta
Normal file
9
Assets/IsoTools/Addons/Physics/Internal.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e3a035a6c93424c7a98d81c8cb5aad1c
|
||||
folderAsset: yes
|
||||
timeCreated: 1480174340
|
||||
licenseType: Free
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
18
Assets/IsoTools/Addons/Physics/Internal/IsoFakeCollider.cs
Normal file
18
Assets/IsoTools/Addons/Physics/Internal/IsoFakeCollider.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace IsoTools.Physics.Internal {
|
||||
[AddComponentMenu("")]
|
||||
public class IsoFakeCollider : MonoBehaviour {
|
||||
|
||||
IsoCollider _isoCollider = null;
|
||||
|
||||
public IsoFakeCollider Init(IsoCollider iso_collider) {
|
||||
_isoCollider = iso_collider;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IsoCollider isoCollider {
|
||||
get { return _isoCollider; }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 449e21ec66627fb49a67d615cd9d240a
|
||||
guid: e6013de6edf894f15b4b45e011afe2a4
|
||||
timeCreated: 1436271657
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,28 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace IsoTools.Physics.Internal {
|
||||
[AddComponentMenu("")]
|
||||
public class IsoFakeCollisionListener : MonoBehaviour {
|
||||
|
||||
GameObject _realGameObject = null;
|
||||
|
||||
public IsoFakeCollisionListener Init(IsoCollisionListener iso_listener) {
|
||||
_realGameObject = iso_listener.gameObject;
|
||||
return this;
|
||||
}
|
||||
|
||||
void OnCollisionEnter(Collision collision) {
|
||||
_realGameObject.SendMessage(
|
||||
"OnIsoCollisionEnter",
|
||||
new IsoCollision(collision),
|
||||
SendMessageOptions.DontRequireReceiver);
|
||||
}
|
||||
|
||||
void OnCollisionExit(Collision collision) {
|
||||
_realGameObject.SendMessage(
|
||||
"OnIsoCollisionExit",
|
||||
new IsoCollision(collision),
|
||||
SendMessageOptions.DontRequireReceiver);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b3ba702b17e9f4b85aad7b29b1a06eed
|
||||
timeCreated: 1461097028
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
36
Assets/IsoTools/Addons/Physics/Internal/IsoFakeObject.cs
Normal file
36
Assets/IsoTools/Addons/Physics/Internal/IsoFakeObject.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace IsoTools.Physics.Internal {
|
||||
[AddComponentMenu("")]
|
||||
public class IsoFakeObject : MonoBehaviour {
|
||||
|
||||
IsoObject _isoObject = null;
|
||||
Vector3 _lastPosition = Vector3.zero;
|
||||
|
||||
public void Init(IsoObject iso_object) {
|
||||
_isoObject = iso_object;
|
||||
_lastPosition = iso_object.position;
|
||||
transform.position = iso_object.position;
|
||||
}
|
||||
|
||||
public IsoObject isoObject {
|
||||
get { return _isoObject; }
|
||||
}
|
||||
|
||||
void CheckLayers() {
|
||||
var iso_object_layer = isoObject.gameObject.layer;
|
||||
if ( gameObject.layer != iso_object_layer ) {
|
||||
gameObject.layer = iso_object_layer;
|
||||
}
|
||||
}
|
||||
|
||||
void FixedUpdate() {
|
||||
CheckLayers();
|
||||
if ( _lastPosition != isoObject.position ) {
|
||||
_lastPosition = transform.position = isoObject.position;
|
||||
} else if ( _lastPosition != transform.position ) {
|
||||
_lastPosition = isoObject.position = transform.position;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 84780b4561da348638be7996e45f96aa
|
||||
timeCreated: 1434281884
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
18
Assets/IsoTools/Addons/Physics/Internal/IsoFakeRigidbody.cs
Normal file
18
Assets/IsoTools/Addons/Physics/Internal/IsoFakeRigidbody.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace IsoTools.Physics.Internal {
|
||||
[AddComponentMenu("")]
|
||||
public class IsoFakeRigidbody : MonoBehaviour {
|
||||
|
||||
IsoRigidbody _isoRigidbody = null;
|
||||
|
||||
public IsoFakeRigidbody Init(IsoRigidbody iso_rigidbody) {
|
||||
_isoRigidbody = iso_rigidbody;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IsoRigidbody isoRigidbody {
|
||||
get { return _isoRigidbody; }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c68ba79b8c53c4643b17ed586ffbbab8
|
||||
timeCreated: 1436374575
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,28 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace IsoTools.Physics.Internal {
|
||||
[AddComponentMenu("")]
|
||||
public class IsoFakeTriggerListener : MonoBehaviour {
|
||||
|
||||
GameObject _realGameObject = null;
|
||||
|
||||
public IsoFakeTriggerListener Init(IsoTriggerListener iso_listener) {
|
||||
_realGameObject = iso_listener.gameObject;
|
||||
return this;
|
||||
}
|
||||
|
||||
void OnTriggerEnter(Collider collider) {
|
||||
_realGameObject.SendMessage(
|
||||
"OnIsoTriggerEnter",
|
||||
IsoPhysicsUtils.IsoConvertCollider(collider),
|
||||
SendMessageOptions.DontRequireReceiver);
|
||||
}
|
||||
|
||||
void OnTriggerExit(Collider collider) {
|
||||
_realGameObject.SendMessage(
|
||||
"OnIsoTriggerExit",
|
||||
IsoPhysicsUtils.IsoConvertCollider(collider),
|
||||
SendMessageOptions.DontRequireReceiver);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 85a92cf713a8c4da68454e88e803bbce
|
||||
timeCreated: 1461097013
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
32
Assets/IsoTools/Addons/Physics/Internal/IsoPhysicsHelper.cs
Normal file
32
Assets/IsoTools/Addons/Physics/Internal/IsoPhysicsHelper.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace IsoTools.Physics.Internal {
|
||||
[AddComponentMenu("")]
|
||||
[DisallowMultipleComponent]
|
||||
[RequireComponent(typeof(IsoObject))]
|
||||
public class IsoPhysicsHelper : MonoBehaviour {
|
||||
|
||||
GameObject _isoFakeObject = null;
|
||||
public GameObject isoFakeObject {
|
||||
get { return _isoFakeObject; }
|
||||
}
|
||||
|
||||
void Awake() {
|
||||
hideFlags = HideFlags.HideInInspector;
|
||||
var iso_object = GetComponent<IsoObject>();
|
||||
if ( iso_object ) {
|
||||
_isoFakeObject = new GameObject("_Fake" + gameObject.name);
|
||||
_isoFakeObject.AddComponent<IsoFakeObject>().Init(iso_object);
|
||||
_isoFakeObject.hideFlags = HideFlags.HideInHierarchy | HideFlags.NotEditable;
|
||||
GameObject.DontDestroyOnLoad(_isoFakeObject);
|
||||
}
|
||||
}
|
||||
|
||||
void OnDestroy() {
|
||||
if ( _isoFakeObject ) {
|
||||
DestroyImmediate(_isoFakeObject);
|
||||
_isoFakeObject = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 02be875c33a5b4b2799ff198d4c93806
|
||||
timeCreated: 1434298128
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,27 @@
|
||||
using UnityEngine;
|
||||
using IsoTools.Internal;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace IsoTools.Physics.Internal {
|
||||
[AddComponentMenu("")]
|
||||
public class IsoPhysicsHelperHolder : MonoBehaviour {
|
||||
|
||||
static List<IsoPhysicsHelperHolder> _tmpHolders = new List<IsoPhysicsHelperHolder>(7);
|
||||
|
||||
protected GameObject fakeObject {
|
||||
get { return physicsHelper.isoFakeObject; }
|
||||
}
|
||||
|
||||
protected IsoPhysicsHelper physicsHelper {
|
||||
get { return IsoUtils.GetOrCreateComponent<IsoPhysicsHelper>(gameObject); }
|
||||
}
|
||||
|
||||
protected void DestroyUnnecessaryCheck() {
|
||||
GetComponents<IsoPhysicsHelperHolder>(_tmpHolders);
|
||||
if ( _tmpHolders.Count == 1 && _tmpHolders[0] == this ) {
|
||||
Destroy(physicsHelper);
|
||||
}
|
||||
_tmpHolders.Clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 24e253f6697d448229f535a2e796f72b
|
||||
timeCreated: 1461163442
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
37
Assets/IsoTools/Addons/Physics/Internal/IsoPhysicsUtils.cs
Normal file
37
Assets/IsoTools/Addons/Physics/Internal/IsoPhysicsUtils.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace IsoTools.Physics.Internal {
|
||||
public static class IsoPhysicsUtils {
|
||||
public static IsoCollider IsoConvertCollider(Collider collider) {
|
||||
var fake_collider = collider ? collider.GetComponent<IsoFakeCollider>() : null;
|
||||
return fake_collider ? fake_collider.isoCollider : null;
|
||||
}
|
||||
|
||||
public static IsoRigidbody IsoConvertRigidbody(Rigidbody rigidbody) {
|
||||
var fake_rigidbody = rigidbody ? rigidbody.GetComponent<IsoFakeRigidbody>() : null;
|
||||
return fake_rigidbody ? fake_rigidbody.isoRigidbody : null;
|
||||
}
|
||||
|
||||
public static GameObject IsoConvertGameObject(GameObject game_object) {
|
||||
var fake_object = game_object ? game_object.GetComponent<IsoFakeObject>() : null;
|
||||
var iso_object = fake_object ? fake_object.isoObject : null;
|
||||
return iso_object ? iso_object.gameObject : null;
|
||||
}
|
||||
|
||||
public static IsoContactPoint[] IsoConvertContactPoints(ContactPoint[] points) {
|
||||
var iso_points = new IsoContactPoint[points.Length];
|
||||
for ( int i = 0, e = points.Length; i < e; ++i ) {
|
||||
iso_points[i] = new IsoContactPoint(points[i]);
|
||||
}
|
||||
return iso_points;
|
||||
}
|
||||
|
||||
public static IsoRaycastHit[] IsoConvertRaycastHits(RaycastHit[] hits) {
|
||||
var iso_hits = new IsoRaycastHit[hits.Length];
|
||||
for ( int i = 0, e = hits.Length; i < e; ++i ) {
|
||||
iso_hits[i] = new IsoRaycastHit(hits[i]);
|
||||
}
|
||||
return iso_hits;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0d44532ca15804cdc997583d81cf4df1
|
||||
timeCreated: 1480196616
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
77
Assets/IsoTools/Addons/Physics/IsoBoxCollider.cs
Normal file
77
Assets/IsoTools/Addons/Physics/IsoBoxCollider.cs
Normal file
@@ -0,0 +1,77 @@
|
||||
using UnityEngine;
|
||||
using IsoTools.Internal;
|
||||
|
||||
#if UNITY_EDITOR
|
||||
using UnityEditor;
|
||||
#endif
|
||||
|
||||
namespace IsoTools.Physics {
|
||||
[RequireComponent(typeof(IsoObject))]
|
||||
public class IsoBoxCollider : IsoCollider {
|
||||
|
||||
[SerializeField]
|
||||
public Vector3 _size = Vector3.zero;
|
||||
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 CreateRealCollider(GameObject target) {
|
||||
var collider = target.AddComponent<BoxCollider>();
|
||||
collider.size = size;
|
||||
collider.center = offset;
|
||||
return collider;
|
||||
}
|
||||
|
||||
public BoxCollider realBoxCollider {
|
||||
get { return realCollider as BoxCollider; }
|
||||
}
|
||||
|
||||
#if UNITY_EDITOR
|
||||
protected override void Reset() {
|
||||
base.Reset();
|
||||
var iso_object = GetComponent<IsoObject>();
|
||||
var iso_object_size = iso_object ? iso_object.size : Vector3.zero;
|
||||
size = iso_object_size;
|
||||
offset = iso_object_size * 0.5f;
|
||||
EditorUtility.SetDirty(this);
|
||||
}
|
||||
|
||||
protected override void OnValidate() {
|
||||
base.OnValidate();
|
||||
if ( realBoxCollider ) {
|
||||
realBoxCollider.size = size;
|
||||
realBoxCollider.center = offset;
|
||||
}
|
||||
}
|
||||
|
||||
void OnDrawGizmosSelected() {
|
||||
var iso_object = GetComponent<IsoObject>();
|
||||
if ( iso_object && iso_object.isoWorld ) {
|
||||
IsoUtils.DrawIsoCube(
|
||||
iso_object.isoWorld,
|
||||
iso_object.position + offset,
|
||||
size,
|
||||
Color.green);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
12
Assets/IsoTools/Addons/Physics/IsoBoxCollider.cs.meta
Normal file
12
Assets/IsoTools/Addons/Physics/IsoBoxCollider.cs.meta
Normal file
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b256250c588ee4e4590a3e58eaa69b1d
|
||||
timeCreated: 1434220443
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
111
Assets/IsoTools/Addons/Physics/IsoCapsuleCollider.cs
Normal file
111
Assets/IsoTools/Addons/Physics/IsoCapsuleCollider.cs
Normal file
@@ -0,0 +1,111 @@
|
||||
using UnityEngine;
|
||||
using IsoTools.Internal;
|
||||
|
||||
#if UNITY_EDITOR
|
||||
using UnityEditor;
|
||||
#endif
|
||||
|
||||
namespace IsoTools.Physics {
|
||||
[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<CapsuleCollider>();
|
||||
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<IsoObject>();
|
||||
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<IsoObject>();
|
||||
if ( iso_object && iso_object.isoWorld ) {
|
||||
if ( radius * 2 < height ) {
|
||||
IsoUtils.DrawIsoCube(
|
||||
iso_object.isoWorld,
|
||||
iso_object.position + offset,
|
||||
new Vector3(radius * 2.0f, radius * 2.0f, height - radius),
|
||||
Color.green);
|
||||
IsoUtils.DrawIsoSphere(
|
||||
iso_object.isoWorld,
|
||||
iso_object.position + offset - IsoUtils.Vec3FromZ(height * 0.5f - radius),
|
||||
radius,
|
||||
Color.green);
|
||||
IsoUtils.DrawIsoSphere(
|
||||
iso_object.isoWorld,
|
||||
iso_object.position + offset + IsoUtils.Vec3FromZ(height * 0.5f - radius),
|
||||
radius,
|
||||
Color.green);
|
||||
} else {
|
||||
IsoUtils.DrawIsoSphere(
|
||||
iso_object.isoWorld,
|
||||
iso_object.position + offset,
|
||||
radius,
|
||||
Color.green);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
12
Assets/IsoTools/Addons/Physics/IsoCapsuleCollider.cs.meta
Normal file
12
Assets/IsoTools/Addons/Physics/IsoCapsuleCollider.cs.meta
Normal file
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d4d35c70ee62a44288b95ff88ca8e87c
|
||||
timeCreated: 1461359219
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
129
Assets/IsoTools/Addons/Physics/IsoCollider.cs
Normal file
129
Assets/IsoTools/Addons/Physics/IsoCollider.cs
Normal file
@@ -0,0 +1,129 @@
|
||||
using UnityEngine;
|
||||
using IsoTools.Physics.Internal;
|
||||
|
||||
#if UNITY_EDITOR
|
||||
using UnityEditor;
|
||||
#endif
|
||||
|
||||
namespace IsoTools.Physics {
|
||||
[RequireComponent(typeof(IsoObject))]
|
||||
public abstract class IsoCollider : IsoPhysicsHelperHolder {
|
||||
protected abstract Collider CreateRealCollider(GameObject target);
|
||||
|
||||
IsoFakeCollider _fakeCollider;
|
||||
|
||||
Collider _realCollider = null;
|
||||
public Collider realCollider {
|
||||
get { return _realCollider; }
|
||||
}
|
||||
|
||||
[SerializeField]
|
||||
public PhysicMaterial _material = null;
|
||||
public PhysicMaterial material {
|
||||
get { return _material; }
|
||||
set {
|
||||
_material = value;
|
||||
if ( realCollider ) {
|
||||
realCollider.material = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[SerializeField]
|
||||
public bool _isTrigger = false;
|
||||
public bool isTrigger {
|
||||
get { return _isTrigger; }
|
||||
set {
|
||||
_isTrigger = value;
|
||||
if ( realCollider ) {
|
||||
realCollider.isTrigger = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public IsoRigidbody attachedRigidbody {
|
||||
get {
|
||||
return realCollider
|
||||
? IsoPhysicsUtils.IsoConvertRigidbody(realCollider.attachedRigidbody)
|
||||
: null;
|
||||
}
|
||||
}
|
||||
|
||||
public Bounds bounds {
|
||||
get {
|
||||
return realCollider
|
||||
? realCollider.bounds
|
||||
: new Bounds();
|
||||
}
|
||||
}
|
||||
|
||||
public float contactOffset {
|
||||
get {
|
||||
return realCollider
|
||||
? realCollider.contactOffset
|
||||
: 0.0f;
|
||||
} set {
|
||||
if ( realCollider ) {
|
||||
realCollider.contactOffset = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public Vector3 ClosestPointOnBounds(Vector3 position) {
|
||||
return realCollider
|
||||
? realCollider.ClosestPointOnBounds(position)
|
||||
: Vector3.zero;
|
||||
}
|
||||
|
||||
public bool Raycast(Ray ray, out IsoRaycastHit iso_hit_info, float max_distance) {
|
||||
var hit_info = new RaycastHit();
|
||||
var result = realCollider
|
||||
? realCollider.Raycast(ray, out hit_info, max_distance)
|
||||
: false;
|
||||
iso_hit_info = result ? new IsoRaycastHit(hit_info) : new IsoRaycastHit();
|
||||
return result;
|
||||
}
|
||||
|
||||
void Awake() {
|
||||
_fakeCollider = fakeObject.AddComponent<IsoFakeCollider>().Init(this);
|
||||
_realCollider = CreateRealCollider(fakeObject);
|
||||
_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);
|
||||
}
|
||||
if ( _fakeCollider ) {
|
||||
Destroy(_fakeCollider);
|
||||
}
|
||||
DestroyUnnecessaryCheck();
|
||||
}
|
||||
|
||||
#if UNITY_EDITOR
|
||||
protected virtual void Reset() {
|
||||
material = null;
|
||||
isTrigger = false;
|
||||
EditorUtility.SetDirty(this);
|
||||
}
|
||||
|
||||
protected virtual void OnValidate() {
|
||||
material = _material;
|
||||
isTrigger = _isTrigger;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
12
Assets/IsoTools/Addons/Physics/IsoCollider.cs.meta
Normal file
12
Assets/IsoTools/Addons/Physics/IsoCollider.cs.meta
Normal file
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7bea029ebf6f04de6881354d27cb4193
|
||||
timeCreated: 1434264681
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
23
Assets/IsoTools/Addons/Physics/IsoCollision.cs
Normal file
23
Assets/IsoTools/Addons/Physics/IsoCollision.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using UnityEngine;
|
||||
using IsoTools.Physics.Internal;
|
||||
|
||||
namespace IsoTools.Physics {
|
||||
public class IsoCollision {
|
||||
|
||||
public IsoCollider collider { get; private set; }
|
||||
public IsoContactPoint[] contacts { get; private set; }
|
||||
public GameObject gameObject { get; private set; }
|
||||
public Vector3 impulse { get; private set; }
|
||||
public Vector3 relativeVelocity { get; private set; }
|
||||
public IsoRigidbody rigidbody { get; private set; }
|
||||
|
||||
public IsoCollision(Collision collision) {
|
||||
collider = IsoPhysicsUtils.IsoConvertCollider(collision.collider);
|
||||
contacts = IsoPhysicsUtils.IsoConvertContactPoints(collision.contacts);
|
||||
gameObject = IsoPhysicsUtils.IsoConvertGameObject(collision.gameObject);
|
||||
impulse = collision.impulse;
|
||||
relativeVelocity = collision.relativeVelocity;
|
||||
rigidbody = IsoPhysicsUtils.IsoConvertRigidbody(collision.rigidbody);
|
||||
}
|
||||
}
|
||||
}
|
||||
12
Assets/IsoTools/Addons/Physics/IsoCollision.cs.meta
Normal file
12
Assets/IsoTools/Addons/Physics/IsoCollision.cs.meta
Normal file
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6a0c6ad7ad6d84258be23c24fad58b84
|
||||
timeCreated: 1436119603
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
22
Assets/IsoTools/Addons/Physics/IsoCollisionListener.cs
Normal file
22
Assets/IsoTools/Addons/Physics/IsoCollisionListener.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using UnityEngine;
|
||||
using IsoTools.Physics.Internal;
|
||||
|
||||
namespace IsoTools.Physics {
|
||||
[DisallowMultipleComponent]
|
||||
[RequireComponent(typeof(IsoObject))]
|
||||
public class IsoCollisionListener : IsoPhysicsHelperHolder {
|
||||
|
||||
IsoFakeCollisionListener _fakeListener;
|
||||
|
||||
void Awake() {
|
||||
_fakeListener = fakeObject.AddComponent<IsoFakeCollisionListener>().Init(this);
|
||||
}
|
||||
|
||||
void OnDestroy() {
|
||||
if ( _fakeListener ) {
|
||||
Destroy(_fakeListener);
|
||||
}
|
||||
DestroyUnnecessaryCheck();
|
||||
}
|
||||
}
|
||||
}
|
||||
12
Assets/IsoTools/Addons/Physics/IsoCollisionListener.cs.meta
Normal file
12
Assets/IsoTools/Addons/Physics/IsoCollisionListener.cs.meta
Normal file
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c9634e461d1e942de8174ee80528a2d3
|
||||
timeCreated: 1461096905
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
21
Assets/IsoTools/Addons/Physics/IsoContactPoint.cs
Normal file
21
Assets/IsoTools/Addons/Physics/IsoContactPoint.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using UnityEngine;
|
||||
using IsoTools.Physics.Internal;
|
||||
|
||||
namespace IsoTools.Physics {
|
||||
public struct IsoContactPoint {
|
||||
|
||||
public Vector3 normal { get; private set; }
|
||||
public IsoCollider otherCollider { get; private set; }
|
||||
public Vector3 point { get; private set; }
|
||||
public float separation { get; private set; }
|
||||
public IsoCollider thisCollider { get; private set; }
|
||||
|
||||
public IsoContactPoint(ContactPoint contact_point) : this() {
|
||||
normal = contact_point.normal;
|
||||
otherCollider = IsoPhysicsUtils.IsoConvertCollider(contact_point.otherCollider);
|
||||
point = contact_point.point;
|
||||
separation = contact_point.separation;
|
||||
thisCollider = IsoPhysicsUtils.IsoConvertCollider(contact_point.thisCollider);
|
||||
}
|
||||
}
|
||||
}
|
||||
12
Assets/IsoTools/Addons/Physics/IsoContactPoint.cs.meta
Normal file
12
Assets/IsoTools/Addons/Physics/IsoContactPoint.cs.meta
Normal file
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 121a2248ec18d4aa4be6bec03265e86e
|
||||
timeCreated: 1436119761
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
328
Assets/IsoTools/Addons/Physics/IsoPhysics.cs
Normal file
328
Assets/IsoTools/Addons/Physics/IsoPhysics.cs
Normal file
@@ -0,0 +1,328 @@
|
||||
using UnityEngine;
|
||||
using IsoTools.Physics.Internal;
|
||||
|
||||
namespace IsoTools.Physics {
|
||||
public static class IsoPhysics {
|
||||
|
||||
//
|
||||
// Ignore collision helpers
|
||||
//
|
||||
|
||||
public static bool GetIgnoreLayerCollision(int layer1, int layer2) {
|
||||
return UnityEngine.Physics.GetIgnoreLayerCollision(layer1, layer2);
|
||||
}
|
||||
|
||||
public static void IgnoreCollision(IsoCollider iso_collider1, IsoCollider iso_collider2,
|
||||
bool ignore = true)
|
||||
{
|
||||
UnityEngine.Physics.IgnoreCollision(
|
||||
iso_collider1.realCollider, iso_collider2.realCollider, ignore);
|
||||
}
|
||||
|
||||
public static void IgnoreLayerCollision(int layer1, int layer2,
|
||||
bool ignore = true)
|
||||
{
|
||||
UnityEngine.Physics.IgnoreLayerCollision(layer1, layer2, ignore);
|
||||
}
|
||||
|
||||
//
|
||||
// Raycast
|
||||
//
|
||||
|
||||
public static bool Raycast(Ray ray, out IsoRaycastHit iso_hit_info,
|
||||
float max_distance = Mathf.Infinity,
|
||||
int layer_mask = UnityEngine.Physics.DefaultRaycastLayers,
|
||||
QueryTriggerInteraction query_trigger_interaction = QueryTriggerInteraction.UseGlobal)
|
||||
{
|
||||
var hit_info = new RaycastHit();
|
||||
var result = UnityEngine.Physics.Raycast(ray, out hit_info,
|
||||
max_distance,
|
||||
layer_mask,
|
||||
query_trigger_interaction);
|
||||
iso_hit_info = result ? new IsoRaycastHit(hit_info) : new IsoRaycastHit();
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
// RaycastNonAlloc
|
||||
//
|
||||
|
||||
public static int RaycastNonAlloc(Ray ray, IsoRaycastHit[] results,
|
||||
float max_distance = Mathf.Infinity,
|
||||
int layer_mask = UnityEngine.Physics.DefaultRaycastLayers,
|
||||
QueryTriggerInteraction query_trigger_interaction = QueryTriggerInteraction.UseGlobal)
|
||||
{
|
||||
do {
|
||||
var hit_count = UnityEngine.Physics.RaycastNonAlloc(ray, _raycastNonAllocBuffer,
|
||||
max_distance,
|
||||
layer_mask,
|
||||
query_trigger_interaction);
|
||||
if ( hit_count >= results.Length || hit_count < _raycastNonAllocBuffer.Length ) {
|
||||
return RaycastBufferToIsoRaycastHits(hit_count, results);
|
||||
} else {
|
||||
_raycastNonAllocBuffer = new RaycastHit[_raycastNonAllocBuffer.Length * 2];
|
||||
}
|
||||
} while ( true );
|
||||
}
|
||||
|
||||
//
|
||||
// Linecast
|
||||
//
|
||||
|
||||
public static bool Linecast(
|
||||
Vector3 start, Vector3 end, out IsoRaycastHit iso_hit_info,
|
||||
int layer_mask = UnityEngine.Physics.DefaultRaycastLayers,
|
||||
QueryTriggerInteraction query_trigger_interaction = QueryTriggerInteraction.UseGlobal)
|
||||
{
|
||||
var hit_info = new RaycastHit();
|
||||
var result = UnityEngine.Physics.Linecast(start, end, out hit_info,
|
||||
layer_mask,
|
||||
query_trigger_interaction);
|
||||
iso_hit_info = result ? new IsoRaycastHit(hit_info) : new IsoRaycastHit();
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
// CheckBox
|
||||
//
|
||||
|
||||
public static bool CheckBox(
|
||||
Vector3 center, Vector3 half_extents,
|
||||
int layer_mask = UnityEngine.Physics.DefaultRaycastLayers,
|
||||
QueryTriggerInteraction query_trigger_interaction = QueryTriggerInteraction.UseGlobal)
|
||||
{
|
||||
return UnityEngine.Physics.CheckBox(
|
||||
center, half_extents,
|
||||
Quaternion.identity,
|
||||
layer_mask,
|
||||
query_trigger_interaction);
|
||||
}
|
||||
|
||||
//
|
||||
// CheckCapsule
|
||||
//
|
||||
|
||||
public static bool CheckCapsule(
|
||||
Vector3 start, Vector3 end, float radius,
|
||||
int layer_mask = UnityEngine.Physics.DefaultRaycastLayers,
|
||||
QueryTriggerInteraction query_trigger_interaction = QueryTriggerInteraction.UseGlobal)
|
||||
{
|
||||
return UnityEngine.Physics.CheckCapsule(
|
||||
start, end, radius,
|
||||
layer_mask,
|
||||
query_trigger_interaction);
|
||||
}
|
||||
|
||||
//
|
||||
// CheckSphere
|
||||
//
|
||||
|
||||
public static bool CheckSphere(
|
||||
Vector3 position, float radius,
|
||||
int layer_mask = UnityEngine.Physics.DefaultRaycastLayers,
|
||||
QueryTriggerInteraction query_trigger_interaction = QueryTriggerInteraction.UseGlobal)
|
||||
{
|
||||
return UnityEngine.Physics.CheckSphere(
|
||||
position, radius,
|
||||
layer_mask,
|
||||
query_trigger_interaction);
|
||||
}
|
||||
|
||||
//
|
||||
// BoxCast
|
||||
//
|
||||
|
||||
public static bool BoxCast(
|
||||
Vector3 center, Vector3 half_extents, Vector3 direction, out IsoRaycastHit iso_hit_info,
|
||||
float max_distance = Mathf.Infinity,
|
||||
int layer_mask = UnityEngine.Physics.DefaultRaycastLayers,
|
||||
QueryTriggerInteraction query_trigger_interaction = QueryTriggerInteraction.UseGlobal)
|
||||
{
|
||||
var hit_info = new RaycastHit();
|
||||
var result = UnityEngine.Physics.BoxCast(
|
||||
center, half_extents, direction, out hit_info,
|
||||
Quaternion.identity,
|
||||
max_distance,
|
||||
layer_mask,
|
||||
query_trigger_interaction);
|
||||
iso_hit_info = result ? new IsoRaycastHit(hit_info) : new IsoRaycastHit();
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
// BoxCastNonAlloc
|
||||
//
|
||||
|
||||
public static int BoxCastNonAlloc(
|
||||
Vector3 center, Vector3 half_extents, Vector3 direction, IsoRaycastHit[] results,
|
||||
float max_distance = Mathf.Infinity,
|
||||
int layer_mask = UnityEngine.Physics.DefaultRaycastLayers,
|
||||
QueryTriggerInteraction query_trigger_interaction = QueryTriggerInteraction.UseGlobal)
|
||||
{
|
||||
var hit_count = UnityEngine.Physics.BoxCastNonAlloc(
|
||||
center, half_extents, direction, _raycastNonAllocBuffer,
|
||||
Quaternion.identity,
|
||||
max_distance,
|
||||
layer_mask,
|
||||
query_trigger_interaction);
|
||||
return RaycastBufferToIsoRaycastHits(hit_count, results);
|
||||
}
|
||||
|
||||
//
|
||||
// CapsuleCast
|
||||
//
|
||||
|
||||
public static bool CapsuleCast(
|
||||
Vector3 point1, Vector3 point2, float radius, Vector3 direction, out IsoRaycastHit iso_hit_info,
|
||||
float max_distance = Mathf.Infinity,
|
||||
int layer_mask = UnityEngine.Physics.DefaultRaycastLayers,
|
||||
QueryTriggerInteraction query_trigger_interaction = QueryTriggerInteraction.UseGlobal)
|
||||
{
|
||||
var hit_info = new RaycastHit();
|
||||
var result = UnityEngine.Physics.CapsuleCast(
|
||||
point1, point2, radius, direction, out hit_info,
|
||||
max_distance,
|
||||
layer_mask,
|
||||
query_trigger_interaction);
|
||||
iso_hit_info = result ? new IsoRaycastHit(hit_info) : new IsoRaycastHit();
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
// CapsuleCastNonAlloc
|
||||
//
|
||||
|
||||
public static int CapsuleCastNonAlloc(
|
||||
Vector3 point1, Vector3 point2, float radius, Vector3 direction, IsoRaycastHit[] results,
|
||||
float max_distance = Mathf.Infinity,
|
||||
int layer_mask = UnityEngine.Physics.DefaultRaycastLayers,
|
||||
QueryTriggerInteraction query_trigger_interaction = QueryTriggerInteraction.UseGlobal)
|
||||
{
|
||||
var hit_count = UnityEngine.Physics.CapsuleCastNonAlloc(
|
||||
point1, point2, radius, direction, _raycastNonAllocBuffer,
|
||||
max_distance,
|
||||
layer_mask,
|
||||
query_trigger_interaction);
|
||||
return RaycastBufferToIsoRaycastHits(hit_count, results);
|
||||
}
|
||||
|
||||
//
|
||||
// SphereCast
|
||||
//
|
||||
|
||||
public static bool SphereCast(
|
||||
Vector3 origin, float radius, Vector3 direction, out IsoRaycastHit iso_hit_info,
|
||||
float max_distance = Mathf.Infinity,
|
||||
int layer_mask = UnityEngine.Physics.DefaultRaycastLayers,
|
||||
QueryTriggerInteraction query_trigger_interaction = QueryTriggerInteraction.UseGlobal)
|
||||
{
|
||||
var hit_info = new RaycastHit();
|
||||
var result = UnityEngine.Physics.SphereCast(
|
||||
origin, radius, direction, out hit_info,
|
||||
max_distance,
|
||||
layer_mask,
|
||||
query_trigger_interaction);
|
||||
iso_hit_info = result ? new IsoRaycastHit(hit_info) : new IsoRaycastHit();
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
// SphereCastNonAlloc
|
||||
//
|
||||
|
||||
public static int SphereCastNonAlloc(
|
||||
Vector3 origin, float radius, Vector3 direction, IsoRaycastHit[] results,
|
||||
float max_distance = Mathf.Infinity,
|
||||
int layer_mask = UnityEngine.Physics.DefaultRaycastLayers,
|
||||
QueryTriggerInteraction query_trigger_interaction = QueryTriggerInteraction.UseGlobal)
|
||||
{
|
||||
var hit_count = UnityEngine.Physics.SphereCastNonAlloc(
|
||||
origin, radius, direction, _raycastNonAllocBuffer,
|
||||
max_distance,
|
||||
layer_mask,
|
||||
query_trigger_interaction);
|
||||
return RaycastBufferToIsoRaycastHits(hit_count, results);
|
||||
}
|
||||
|
||||
//
|
||||
// OverlapBoxNonAlloc
|
||||
//
|
||||
|
||||
public static int OverlapBoxNonAlloc(
|
||||
Vector3 center, Vector3 half_extents, IsoCollider[] results,
|
||||
int layer_mask = UnityEngine.Physics.AllLayers,
|
||||
QueryTriggerInteraction query_trigger_interaction = QueryTriggerInteraction.UseGlobal)
|
||||
{
|
||||
do {
|
||||
var collider_count = UnityEngine.Physics.OverlapBoxNonAlloc(
|
||||
center, half_extents, _overlapNonAllocBuffer,
|
||||
Quaternion.identity,
|
||||
layer_mask,
|
||||
query_trigger_interaction);
|
||||
if ( collider_count >= results.Length || collider_count < _overlapNonAllocBuffer.Length ) {
|
||||
return OverlapBufferToIsoColliders(collider_count, results);
|
||||
} else {
|
||||
_overlapNonAllocBuffer = new Collider[_overlapNonAllocBuffer.Length * 2];
|
||||
}
|
||||
} while ( true );
|
||||
}
|
||||
|
||||
//
|
||||
// OverlapCapsuleNonAlloc
|
||||
//
|
||||
|
||||
public static int OverlapCapsuleNonAlloc(
|
||||
Vector3 point0, Vector3 point1, float radius, IsoCollider[] results,
|
||||
int layer_mask = UnityEngine.Physics.AllLayers,
|
||||
QueryTriggerInteraction query_trigger_interaction = QueryTriggerInteraction.UseGlobal)
|
||||
{
|
||||
var collider_count = UnityEngine.Physics.OverlapCapsuleNonAlloc(
|
||||
point0, point1, radius, _overlapNonAllocBuffer,
|
||||
layer_mask,
|
||||
query_trigger_interaction);
|
||||
return OverlapBufferToIsoColliders(collider_count, results);
|
||||
}
|
||||
|
||||
//
|
||||
// OverlapSphereNonAlloc
|
||||
//
|
||||
|
||||
public static int OverlapSphereNonAlloc(
|
||||
Vector3 position, float radius, IsoCollider[] results,
|
||||
int layer_mask = UnityEngine.Physics.AllLayers,
|
||||
QueryTriggerInteraction query_trigger_interaction = QueryTriggerInteraction.UseGlobal)
|
||||
{
|
||||
var collider_count = UnityEngine.Physics.OverlapSphereNonAlloc(
|
||||
position, radius, _overlapNonAllocBuffer,
|
||||
layer_mask,
|
||||
query_trigger_interaction);
|
||||
return OverlapBufferToIsoColliders(collider_count, results);
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------
|
||||
//
|
||||
// Private
|
||||
//
|
||||
// ---------------------------------------------------------------------
|
||||
|
||||
static RaycastHit[] _raycastNonAllocBuffer = new RaycastHit[128];
|
||||
static int RaycastBufferToIsoRaycastHits(int hit_count, IsoRaycastHit[] results) {
|
||||
var min_hit_count = Mathf.Min(hit_count, results.Length);
|
||||
for ( var i = 0; i < min_hit_count; ++i ) {
|
||||
results[i] = new IsoRaycastHit(_raycastNonAllocBuffer[i]);
|
||||
}
|
||||
System.Array.Clear(_raycastNonAllocBuffer, 0, hit_count);
|
||||
return min_hit_count;
|
||||
}
|
||||
|
||||
static Collider[] _overlapNonAllocBuffer = new Collider[128];
|
||||
static int OverlapBufferToIsoColliders(int collider_count, IsoCollider[] results) {
|
||||
var min_collider_count = Mathf.Min(collider_count, results.Length);
|
||||
for ( var i = 0; i < min_collider_count; ++i ) {
|
||||
results[i] = IsoPhysicsUtils.IsoConvertCollider(_overlapNonAllocBuffer[i]);
|
||||
}
|
||||
System.Array.Clear(_overlapNonAllocBuffer, 0, collider_count);
|
||||
return min_collider_count;
|
||||
}
|
||||
}
|
||||
}
|
||||
12
Assets/IsoTools/Addons/Physics/IsoPhysics.cs.meta
Normal file
12
Assets/IsoTools/Addons/Physics/IsoPhysics.cs.meta
Normal file
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 40ab1c30204174ffa8d877e00af23a62
|
||||
timeCreated: 1480174712
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
21
Assets/IsoTools/Addons/Physics/IsoRaycastHit.cs
Normal file
21
Assets/IsoTools/Addons/Physics/IsoRaycastHit.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using UnityEngine;
|
||||
using IsoTools.Physics.Internal;
|
||||
|
||||
namespace IsoTools.Physics {
|
||||
public struct IsoRaycastHit {
|
||||
|
||||
public IsoCollider collider { get; private set; }
|
||||
public float distance { get; private set; }
|
||||
public Vector3 normal { get; private set; }
|
||||
public Vector3 point { get; private set; }
|
||||
public IsoRigidbody rigidbody { get; private set; }
|
||||
|
||||
public IsoRaycastHit(RaycastHit hit_info) : this() {
|
||||
collider = IsoPhysicsUtils.IsoConvertCollider(hit_info.collider);
|
||||
distance = hit_info.distance;
|
||||
normal = hit_info.normal;
|
||||
point = hit_info.point;
|
||||
rigidbody = IsoPhysicsUtils.IsoConvertRigidbody(hit_info.rigidbody);
|
||||
}
|
||||
}
|
||||
}
|
||||
12
Assets/IsoTools/Addons/Physics/IsoRaycastHit.cs.meta
Normal file
12
Assets/IsoTools/Addons/Physics/IsoRaycastHit.cs.meta
Normal file
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 46f4f6ce0e20940eab6088741047b2c1
|
||||
timeCreated: 1436363986
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
334
Assets/IsoTools/Addons/Physics/IsoRigidbody.cs
Normal file
334
Assets/IsoTools/Addons/Physics/IsoRigidbody.cs
Normal file
@@ -0,0 +1,334 @@
|
||||
using UnityEngine;
|
||||
using IsoTools.Physics.Internal;
|
||||
|
||||
#if UNITY_EDITOR
|
||||
using UnityEditor;
|
||||
#endif
|
||||
|
||||
namespace IsoTools.Physics {
|
||||
[DisallowMultipleComponent]
|
||||
[RequireComponent(typeof(IsoObject))]
|
||||
public class IsoRigidbody : IsoPhysicsHelperHolder {
|
||||
|
||||
IsoFakeRigidbody _fakeRigidbody;
|
||||
|
||||
Rigidbody _realRigidbody = null;
|
||||
Rigidbody realRigidbody {
|
||||
get { return _realRigidbody; }
|
||||
}
|
||||
|
||||
[SerializeField]
|
||||
public float _mass = 1.0f;
|
||||
public float mass {
|
||||
get { return _mass; }
|
||||
set {
|
||||
_mass = value;
|
||||
if ( realRigidbody ) {
|
||||
realRigidbody.mass = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[SerializeField]
|
||||
public float _drag = 0.0f;
|
||||
public float drag {
|
||||
get { return _drag; }
|
||||
set {
|
||||
_drag = value;
|
||||
if ( realRigidbody ) {
|
||||
realRigidbody.drag = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[SerializeField]
|
||||
public bool _useGravity = true;
|
||||
public bool useGravity {
|
||||
get { return _useGravity; }
|
||||
set {
|
||||
_useGravity = value;
|
||||
if ( realRigidbody ) {
|
||||
realRigidbody.useGravity = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[SerializeField]
|
||||
public bool _isKinematic = false;
|
||||
public bool isKinematic {
|
||||
get { return _isKinematic; }
|
||||
set {
|
||||
_isKinematic = value;
|
||||
if ( realRigidbody ) {
|
||||
realRigidbody.isKinematic = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public Vector3 centerOfMass {
|
||||
get { return realRigidbody ? realRigidbody.centerOfMass : Vector3.zero; }
|
||||
set {
|
||||
if ( realRigidbody ) {
|
||||
realRigidbody.centerOfMass = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public Vector3 inertiaTensor {
|
||||
get { return realRigidbody ? realRigidbody.inertiaTensor : Vector3.zero; }
|
||||
set {
|
||||
if ( realRigidbody ) {
|
||||
realRigidbody.inertiaTensor = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public float maxDepenetrationVelocity {
|
||||
get { return realRigidbody ? realRigidbody.maxDepenetrationVelocity : 0.0f; }
|
||||
set {
|
||||
if ( realRigidbody ) {
|
||||
realRigidbody.maxDepenetrationVelocity = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public float sleepThreshold {
|
||||
get { return realRigidbody ? realRigidbody.sleepThreshold : 0.0f; }
|
||||
set {
|
||||
if ( realRigidbody ) {
|
||||
realRigidbody.sleepThreshold = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public int solverIterations {
|
||||
get { return realRigidbody ? realRigidbody.solverIterations : 0; }
|
||||
set {
|
||||
if ( realRigidbody ) {
|
||||
realRigidbody.solverIterations = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public int solverVelocityIterations {
|
||||
get { return realRigidbody ? realRigidbody.solverVelocityIterations : 0; }
|
||||
set {
|
||||
if ( realRigidbody ) {
|
||||
realRigidbody.solverVelocityIterations = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public Vector3 velocity {
|
||||
get { return realRigidbody ? realRigidbody.velocity : Vector3.zero; }
|
||||
set {
|
||||
if ( realRigidbody ) {
|
||||
realRigidbody.velocity = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public Vector3 worldCenterOfMass {
|
||||
get { return realRigidbody ? realRigidbody.worldCenterOfMass : Vector3.zero; }
|
||||
}
|
||||
|
||||
public void AddExplosionForce(
|
||||
float explosion_force, Vector3 explosion_position, float explosion_radius,
|
||||
float upwards_modifier = 0.0f,
|
||||
ForceMode mode = ForceMode.Force)
|
||||
{
|
||||
if ( realRigidbody ) {
|
||||
realRigidbody.AddExplosionForce(
|
||||
explosion_force, explosion_position, explosion_radius,
|
||||
upwards_modifier, mode);
|
||||
}
|
||||
}
|
||||
|
||||
public void AddForce(Vector3 force,
|
||||
ForceMode mode = ForceMode.Force)
|
||||
{
|
||||
if ( realRigidbody ) {
|
||||
realRigidbody.AddForce(force, mode);
|
||||
}
|
||||
}
|
||||
|
||||
public void AddForceAtPosition(Vector3 force, Vector3 position,
|
||||
ForceMode mode = ForceMode.Force)
|
||||
{
|
||||
if ( realRigidbody ) {
|
||||
realRigidbody.AddForceAtPosition(force, position, mode);
|
||||
}
|
||||
}
|
||||
|
||||
public void AddRelativeForce(Vector3 force,
|
||||
ForceMode mode = ForceMode.Force)
|
||||
{
|
||||
if ( realRigidbody ) {
|
||||
realRigidbody.AddRelativeForce(force, mode);
|
||||
}
|
||||
}
|
||||
|
||||
public Vector3 ClosestPointOnBounds(Vector3 position) {
|
||||
return realRigidbody
|
||||
? realRigidbody.ClosestPointOnBounds(position)
|
||||
: Vector3.zero;
|
||||
}
|
||||
|
||||
public Vector3 GetPointVelocity(Vector3 world_point) {
|
||||
return realRigidbody
|
||||
? realRigidbody.GetPointVelocity(world_point)
|
||||
: Vector3.zero;
|
||||
}
|
||||
|
||||
public Vector3 GetRelativePointVelocity(Vector3 relative_point) {
|
||||
return realRigidbody
|
||||
? realRigidbody.GetRelativePointVelocity(relative_point)
|
||||
: Vector3.zero;
|
||||
}
|
||||
|
||||
public bool IsSleeping() {
|
||||
return realRigidbody
|
||||
? realRigidbody.IsSleeping()
|
||||
: false;
|
||||
}
|
||||
|
||||
public void MovePosition(Vector3 position) {
|
||||
if ( realRigidbody ) {
|
||||
realRigidbody.MovePosition(position);
|
||||
}
|
||||
}
|
||||
|
||||
public void ResetCenterOfMass() {
|
||||
if ( realRigidbody ) {
|
||||
realRigidbody.ResetCenterOfMass();
|
||||
}
|
||||
}
|
||||
|
||||
public void ResetInertiaTensor() {
|
||||
if ( realRigidbody ) {
|
||||
realRigidbody.ResetInertiaTensor();
|
||||
}
|
||||
}
|
||||
|
||||
public void SetDensity(float density) {
|
||||
if ( realRigidbody ) {
|
||||
realRigidbody.SetDensity(density);
|
||||
}
|
||||
}
|
||||
|
||||
public void Sleep() {
|
||||
if ( realRigidbody ) {
|
||||
realRigidbody.Sleep();
|
||||
}
|
||||
}
|
||||
|
||||
public bool SweepTest(Vector3 direction, out IsoRaycastHit iso_hit_info,
|
||||
float max_distance = Mathf.Infinity,
|
||||
QueryTriggerInteraction query_trigger_interaction = QueryTriggerInteraction.UseGlobal)
|
||||
{
|
||||
var hit_info = new RaycastHit();
|
||||
var result = realRigidbody
|
||||
? realRigidbody.SweepTest(direction, out hit_info, max_distance, query_trigger_interaction)
|
||||
: false;
|
||||
iso_hit_info = result ? new IsoRaycastHit(hit_info) : new IsoRaycastHit();
|
||||
return result;
|
||||
}
|
||||
|
||||
public IsoRaycastHit[] SweepTestAll(Vector3 direction,
|
||||
float max_distance = Mathf.Infinity,
|
||||
QueryTriggerInteraction query_trigger_interaction = QueryTriggerInteraction.UseGlobal)
|
||||
{
|
||||
return realRigidbody
|
||||
? IsoPhysicsUtils.IsoConvertRaycastHits(
|
||||
realRigidbody.SweepTestAll(direction, max_distance, query_trigger_interaction))
|
||||
: new IsoRaycastHit[0];
|
||||
}
|
||||
|
||||
public void WakeUp() {
|
||||
if ( realRigidbody ) {
|
||||
realRigidbody.WakeUp();
|
||||
}
|
||||
}
|
||||
|
||||
void Awake() {
|
||||
_fakeRigidbody = fakeObject.AddComponent<IsoFakeRigidbody>().Init(this);
|
||||
_realRigidbody = fakeObject.AddComponent<Rigidbody>();
|
||||
_realRigidbody.freezeRotation = true;
|
||||
_realRigidbody.mass = mass;
|
||||
_realRigidbody.drag = drag;
|
||||
_realRigidbody.useGravity = useGravity;
|
||||
_realRigidbody.isKinematic = isKinematic;
|
||||
_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);
|
||||
}
|
||||
if ( _fakeRigidbody ) {
|
||||
Destroy(_fakeRigidbody);
|
||||
}
|
||||
DestroyUnnecessaryCheck();
|
||||
}
|
||||
|
||||
#if UNITY_EDITOR
|
||||
void Reset() {
|
||||
mass = 1.0f;
|
||||
drag = 0.0f;
|
||||
useGravity = true;
|
||||
isKinematic = false;
|
||||
interpolation = RigidbodyInterpolation.None;
|
||||
collisionDetectionMode = CollisionDetectionMode.Discrete;
|
||||
EditorUtility.SetDirty(this);
|
||||
}
|
||||
|
||||
void OnValidate() {
|
||||
if ( realRigidbody ) {
|
||||
realRigidbody.mass = mass;
|
||||
realRigidbody.drag = drag;
|
||||
realRigidbody.useGravity = useGravity;
|
||||
realRigidbody.isKinematic = isKinematic;
|
||||
realRigidbody.interpolation = interpolation;
|
||||
realRigidbody.collisionDetectionMode = collisionDetectionMode;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
12
Assets/IsoTools/Addons/Physics/IsoRigidbody.cs.meta
Normal file
12
Assets/IsoTools/Addons/Physics/IsoRigidbody.cs.meta
Normal file
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4febe544112bb4678bdd59fa963c802d
|
||||
timeCreated: 1434220421
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
77
Assets/IsoTools/Addons/Physics/IsoSphereCollider.cs
Normal file
77
Assets/IsoTools/Addons/Physics/IsoSphereCollider.cs
Normal file
@@ -0,0 +1,77 @@
|
||||
using UnityEngine;
|
||||
using IsoTools.Internal;
|
||||
|
||||
#if UNITY_EDITOR
|
||||
using UnityEditor;
|
||||
#endif
|
||||
|
||||
namespace IsoTools.Physics {
|
||||
[RequireComponent(typeof(IsoObject))]
|
||||
public class IsoSphereCollider : IsoCollider {
|
||||
|
||||
[SerializeField]
|
||||
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 CreateRealCollider(GameObject target) {
|
||||
var collider = target.AddComponent<SphereCollider>();
|
||||
collider.radius = radius;
|
||||
collider.center = offset;
|
||||
return collider;
|
||||
}
|
||||
|
||||
public SphereCollider realSphereCollider {
|
||||
get { return realCollider as SphereCollider; }
|
||||
}
|
||||
|
||||
#if UNITY_EDITOR
|
||||
protected override void Reset() {
|
||||
base.Reset();
|
||||
var iso_object = GetComponent<IsoObject>();
|
||||
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);
|
||||
}
|
||||
|
||||
protected override void OnValidate() {
|
||||
base.OnValidate();
|
||||
if ( realSphereCollider ) {
|
||||
realSphereCollider.radius = radius;
|
||||
realSphereCollider.center = offset;
|
||||
}
|
||||
}
|
||||
|
||||
void OnDrawGizmosSelected() {
|
||||
var iso_object = GetComponent<IsoObject>();
|
||||
if ( iso_object && iso_object.isoWorld ) {
|
||||
IsoUtils.DrawIsoSphere(
|
||||
iso_object.isoWorld,
|
||||
iso_object.position + offset,
|
||||
radius,
|
||||
Color.green);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
12
Assets/IsoTools/Addons/Physics/IsoSphereCollider.cs.meta
Normal file
12
Assets/IsoTools/Addons/Physics/IsoSphereCollider.cs.meta
Normal file
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9ec3a3f10718e4e62b5c518c8b960d55
|
||||
timeCreated: 1434220433
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
22
Assets/IsoTools/Addons/Physics/IsoTriggerListener.cs
Normal file
22
Assets/IsoTools/Addons/Physics/IsoTriggerListener.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using UnityEngine;
|
||||
using IsoTools.Physics.Internal;
|
||||
|
||||
namespace IsoTools.Physics {
|
||||
[DisallowMultipleComponent]
|
||||
[RequireComponent(typeof(IsoObject))]
|
||||
public class IsoTriggerListener : IsoPhysicsHelperHolder {
|
||||
|
||||
IsoFakeTriggerListener _fakeListener;
|
||||
|
||||
void Awake() {
|
||||
_fakeListener = fakeObject.AddComponent<IsoFakeTriggerListener>().Init(this);
|
||||
}
|
||||
|
||||
void OnDestroy() {
|
||||
if ( _fakeListener ) {
|
||||
Destroy(_fakeListener);
|
||||
}
|
||||
DestroyUnnecessaryCheck();
|
||||
}
|
||||
}
|
||||
}
|
||||
12
Assets/IsoTools/Addons/Physics/IsoTriggerListener.cs.meta
Normal file
12
Assets/IsoTools/Addons/Physics/IsoTriggerListener.cs.meta
Normal file
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1925507eee33e42c2a04a1ae1eaa1ec5
|
||||
timeCreated: 1461096892
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
9
Assets/IsoTools/Addons/PlayMaker.meta
Normal file
9
Assets/IsoTools/Addons/PlayMaker.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a3264192dd6f94e708ddbcd72bf32a61
|
||||
folderAsset: yes
|
||||
timeCreated: 1477130201
|
||||
licenseType: Free
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
9
Assets/IsoTools/Addons/PlayMaker/Actions.meta
Normal file
9
Assets/IsoTools/Addons/PlayMaker/Actions.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8a23c47afc2e94d18abf9f1cb58fb612
|
||||
folderAsset: yes
|
||||
timeCreated: 1449997824
|
||||
licenseType: Free
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,81 @@
|
||||
#if PLAYMAKER
|
||||
using UnityEngine;
|
||||
using IsoTools.Physics;
|
||||
using HutongGames.PlayMaker;
|
||||
using IsoTools.PlayMaker.Internal;
|
||||
|
||||
namespace IsoTools.PlayMaker.Actions {
|
||||
[ActionCategory("IsoTools.Physics")]
|
||||
[HutongGames.PlayMaker.Tooltip(
|
||||
"Applies a force to a IsoRigidbody that simulates explosion effects. " +
|
||||
"The explosion force will fall off linearly with distance.")]
|
||||
public class IsoAddExplosionForce : IsoComponentAction<IsoRigidbody> {
|
||||
[RequiredField]
|
||||
[CheckForComponent(typeof(IsoRigidbody))]
|
||||
[HutongGames.PlayMaker.Tooltip(
|
||||
"The IsoRigidbody to add the explosion force to.")]
|
||||
public FsmOwnerDefault gameObject;
|
||||
|
||||
[RequiredField]
|
||||
[HutongGames.PlayMaker.Tooltip(
|
||||
"The center of the explosion.")]
|
||||
public FsmVector3 center;
|
||||
|
||||
[RequiredField]
|
||||
[HutongGames.PlayMaker.Tooltip(
|
||||
"The strength of the explosion.")]
|
||||
public FsmFloat force;
|
||||
|
||||
[RequiredField]
|
||||
[HutongGames.PlayMaker.Tooltip(
|
||||
"The radius of the explosion.")]
|
||||
public FsmFloat radius;
|
||||
|
||||
[HutongGames.PlayMaker.Tooltip(
|
||||
"Applies the force as if it was applied from beneath the object.")]
|
||||
public FsmFloat upwardsModifier;
|
||||
|
||||
[HutongGames.PlayMaker.Tooltip(
|
||||
"The type of force to apply.")]
|
||||
public ForceMode forceMode;
|
||||
|
||||
[HutongGames.PlayMaker.Tooltip(
|
||||
"Repeat every frame.")]
|
||||
public bool everyFrame;
|
||||
|
||||
public override void Reset() {
|
||||
gameObject = null;
|
||||
center = null;
|
||||
force = null;
|
||||
radius = null;
|
||||
upwardsModifier = 0.0f;
|
||||
forceMode = ForceMode.Force;
|
||||
everyFrame = false;
|
||||
}
|
||||
|
||||
public override void OnPreprocess() {
|
||||
Fsm.HandleFixedUpdate = true;
|
||||
}
|
||||
|
||||
public override void OnEnter() {
|
||||
DoAction();
|
||||
if ( !everyFrame ) {
|
||||
Finish();
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnFixedUpdate() {
|
||||
DoAction();
|
||||
}
|
||||
|
||||
void DoAction() {
|
||||
var go = Fsm.GetOwnerDefaultTarget(gameObject);
|
||||
if ( UpdateCache(go) ) {
|
||||
isoRigidbody.AddExplosionForce(
|
||||
force.Value, center.Value, radius.Value,
|
||||
upwardsModifier.Value, forceMode);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8925808e9509b47b187c8890c644ba0c
|
||||
timeCreated: 1450615607
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
102
Assets/IsoTools/Addons/PlayMaker/Actions/IsoAddForce.cs
Normal file
102
Assets/IsoTools/Addons/PlayMaker/Actions/IsoAddForce.cs
Normal file
@@ -0,0 +1,102 @@
|
||||
#if PLAYMAKER
|
||||
using UnityEngine;
|
||||
using IsoTools.Physics;
|
||||
using HutongGames.PlayMaker;
|
||||
using IsoTools.PlayMaker.Internal;
|
||||
|
||||
namespace IsoTools.PlayMaker.Actions {
|
||||
[ActionCategory("IsoTools.Physics")]
|
||||
[HutongGames.PlayMaker.Tooltip(
|
||||
"Adds a force to a IsoRigidbody. " +
|
||||
"Use Vector3 variable and/or Float variables for each axis.")]
|
||||
public class IsoAddForce : IsoComponentAction<IsoRigidbody> {
|
||||
[RequiredField]
|
||||
[CheckForComponent(typeof(IsoRigidbody))]
|
||||
[HutongGames.PlayMaker.Tooltip(
|
||||
"The IsoRigidbody to apply the force to.")]
|
||||
public FsmOwnerDefault gameObject;
|
||||
|
||||
[UIHint(UIHint.Variable)]
|
||||
[HutongGames.PlayMaker.Tooltip(
|
||||
"Optionally apply the force at a position on the object.")]
|
||||
public FsmVector3 atPosition;
|
||||
|
||||
[UIHint(UIHint.Variable)]
|
||||
[HutongGames.PlayMaker.Tooltip(
|
||||
"A Vector3 force to add. " +
|
||||
"Optionally override any axis with the X, Y, Z parameters.")]
|
||||
public FsmVector3 vector;
|
||||
|
||||
[HutongGames.PlayMaker.Tooltip(
|
||||
"Force along the X axis. To leave unchanged, set to 'None'.")]
|
||||
public FsmFloat x;
|
||||
|
||||
[HutongGames.PlayMaker.Tooltip(
|
||||
"Force along the Y axis. To leave unchanged, set to 'None'.")]
|
||||
public FsmFloat y;
|
||||
|
||||
[HutongGames.PlayMaker.Tooltip(
|
||||
"Force along the Z axis. To leave unchanged, set to 'None'.")]
|
||||
public FsmFloat z;
|
||||
|
||||
[HutongGames.PlayMaker.Tooltip(
|
||||
"Apply the force in world or local space.")]
|
||||
public Space space;
|
||||
|
||||
[HutongGames.PlayMaker.Tooltip(
|
||||
"The type of force to apply.")]
|
||||
public ForceMode forceMode;
|
||||
|
||||
[HutongGames.PlayMaker.Tooltip(
|
||||
"Repeat every frame.")]
|
||||
public bool everyFrame;
|
||||
|
||||
public override void Reset() {
|
||||
gameObject = null;
|
||||
atPosition = new FsmVector3{UseVariable = true};
|
||||
vector = null;
|
||||
x = new FsmFloat{UseVariable = true};
|
||||
y = new FsmFloat{UseVariable = true};
|
||||
z = new FsmFloat{UseVariable = true};
|
||||
space = Space.World;
|
||||
forceMode = ForceMode.Force;
|
||||
everyFrame = false;
|
||||
}
|
||||
|
||||
public override void OnPreprocess() {
|
||||
Fsm.HandleFixedUpdate = true;
|
||||
}
|
||||
|
||||
public override void OnEnter() {
|
||||
DoAction();
|
||||
if ( !everyFrame ) {
|
||||
Finish();
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnFixedUpdate() {
|
||||
DoAction();
|
||||
}
|
||||
|
||||
void DoAction() {
|
||||
var go = Fsm.GetOwnerDefaultTarget(gameObject);
|
||||
if ( UpdateCache(go) ) {
|
||||
var value = vector.IsNone ? Vector3.zero : vector.Value;
|
||||
if ( !x.IsNone ) { value.x = x.Value; }
|
||||
if ( !y.IsNone ) { value.y = y.Value; }
|
||||
if ( !z.IsNone ) { value.z = z.Value; }
|
||||
if ( space == Space.World ) {
|
||||
if ( atPosition.IsNone ) {
|
||||
isoRigidbody.AddForce(value, forceMode);
|
||||
} else {
|
||||
isoRigidbody.AddForceAtPosition(
|
||||
value, atPosition.Value, forceMode);
|
||||
}
|
||||
} else {
|
||||
isoRigidbody.AddRelativeForce(value, forceMode);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
12
Assets/IsoTools/Addons/PlayMaker/Actions/IsoAddForce.cs.meta
Normal file
12
Assets/IsoTools/Addons/PlayMaker/Actions/IsoAddForce.cs.meta
Normal file
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f982e9e34e40d48b4a0645425b0d6c3a
|
||||
timeCreated: 1450614193
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,68 @@
|
||||
#if PLAYMAKER
|
||||
using UnityEngine;
|
||||
using HutongGames.PlayMaker;
|
||||
using IsoTools.PlayMaker.Internal;
|
||||
|
||||
namespace IsoTools.PlayMaker.Actions {
|
||||
[ActionCategory("IsoTools")]
|
||||
[HutongGames.PlayMaker.Tooltip(
|
||||
"Convert Isometric Vector3 Variable to ScreenSpace Vector2 Variable")]
|
||||
public class IsoConvertIsometricToScreen : IsoComponentAction<IsoWorld> {
|
||||
[RequiredField]
|
||||
[CheckForComponent(typeof(IsoWorld))]
|
||||
[HutongGames.PlayMaker.Title("IsoWorld (In)")]
|
||||
[HutongGames.PlayMaker.Tooltip("The IsoWorld for convertation.")]
|
||||
public FsmOwnerDefault gameObject;
|
||||
|
||||
[RequiredField]
|
||||
[UIHint(UIHint.Variable)]
|
||||
[HutongGames.PlayMaker.Title("Isometric Vector (In)")]
|
||||
public FsmVector3 isometricVector;
|
||||
|
||||
[UIHint(UIHint.Variable)]
|
||||
[HutongGames.PlayMaker.Title("Store Screen Vector (Out)")]
|
||||
public FsmVector2 storeScreenVector;
|
||||
|
||||
[UIHint(UIHint.Variable)]
|
||||
[HutongGames.PlayMaker.Title("Store Screen X (Out)")]
|
||||
public FsmFloat storeScreenX;
|
||||
|
||||
[UIHint(UIHint.Variable)]
|
||||
[HutongGames.PlayMaker.Title("Store Screen Y (Out)")]
|
||||
public FsmFloat storeScreenY;
|
||||
|
||||
[HutongGames.PlayMaker.Tooltip("Repeat every frame.")]
|
||||
public bool everyFrame;
|
||||
|
||||
public override void Reset() {
|
||||
gameObject = null;
|
||||
isometricVector = null;
|
||||
storeScreenVector = null;
|
||||
storeScreenX = null;
|
||||
storeScreenY = null;
|
||||
everyFrame = false;
|
||||
}
|
||||
|
||||
public override void OnEnter() {
|
||||
DoAction();
|
||||
if ( !everyFrame ) {
|
||||
Finish();
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnUpdate() {
|
||||
DoAction();
|
||||
}
|
||||
|
||||
void DoAction() {
|
||||
var go = Fsm.GetOwnerDefaultTarget(gameObject);
|
||||
if ( UpdateCache(go) ) {
|
||||
var value = isoWorld.IsoToScreen(isometricVector.Value);
|
||||
storeScreenVector.Value = value;
|
||||
storeScreenX.Value = value.x;
|
||||
storeScreenY.Value = value.y;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2b59e8593133b453bb434f86de86993a
|
||||
timeCreated: 1450193215
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,81 @@
|
||||
#if PLAYMAKER
|
||||
using UnityEngine;
|
||||
using HutongGames.PlayMaker;
|
||||
using IsoTools.PlayMaker.Internal;
|
||||
|
||||
namespace IsoTools.PlayMaker.Actions {
|
||||
[ActionCategory("IsoTools")]
|
||||
[HutongGames.PlayMaker.Tooltip(
|
||||
"Convert ScreenSpace Vector2 Variable to Isometric Vector3 Variable")]
|
||||
public class IsoConvertScreenToIsometric : IsoComponentAction<IsoWorld> {
|
||||
[RequiredField]
|
||||
[CheckForComponent(typeof(IsoWorld))]
|
||||
[HutongGames.PlayMaker.Title("IsoWorld (In)")]
|
||||
[HutongGames.PlayMaker.Tooltip("The IsoWorld for convertation.")]
|
||||
public FsmOwnerDefault gameObject;
|
||||
|
||||
[RequiredField]
|
||||
[UIHint(UIHint.Variable)]
|
||||
[HutongGames.PlayMaker.Title("Screen Vector (In)")]
|
||||
public FsmVector2 screenVector;
|
||||
|
||||
[HutongGames.PlayMaker.Title("Specific Isometric Z (In)")]
|
||||
[HutongGames.PlayMaker.Tooltip("Specific Isometric Z or 0.0f for 'None'")]
|
||||
public FsmFloat specificIsometricZ;
|
||||
|
||||
[UIHint(UIHint.Variable)]
|
||||
[HutongGames.PlayMaker.Title("Store Isometric Vector (Out)")]
|
||||
public FsmVector3 storeIsometricVector;
|
||||
|
||||
[UIHint(UIHint.Variable)]
|
||||
[HutongGames.PlayMaker.Title("Store Isometric X (Out)")]
|
||||
public FsmFloat storeIsometricX;
|
||||
|
||||
[UIHint(UIHint.Variable)]
|
||||
[HutongGames.PlayMaker.Title("Store Isometric Y (Out)")]
|
||||
public FsmFloat storeIsometricY;
|
||||
|
||||
[UIHint(UIHint.Variable)]
|
||||
[HutongGames.PlayMaker.Title("Store Isometric Z (Out)")]
|
||||
public FsmFloat storeIsometricZ;
|
||||
|
||||
[HutongGames.PlayMaker.Tooltip("Repeat every frame.")]
|
||||
public bool everyFrame;
|
||||
|
||||
public override void Reset() {
|
||||
gameObject = null;
|
||||
screenVector = null;
|
||||
specificIsometricZ = 0.0f;
|
||||
storeIsometricVector = null;
|
||||
storeIsometricX = null;
|
||||
storeIsometricY = null;
|
||||
storeIsometricZ = null;
|
||||
everyFrame = false;
|
||||
}
|
||||
|
||||
public override void OnEnter() {
|
||||
DoAction();
|
||||
if ( !everyFrame ) {
|
||||
Finish();
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnUpdate() {
|
||||
DoAction();
|
||||
}
|
||||
|
||||
void DoAction() {
|
||||
var go = Fsm.GetOwnerDefaultTarget(gameObject);
|
||||
if ( UpdateCache(go) ) {
|
||||
var value = specificIsometricZ.IsNone
|
||||
? isoWorld.ScreenToIso(screenVector.Value)
|
||||
: isoWorld.ScreenToIso(screenVector.Value, specificIsometricZ.Value);
|
||||
storeIsometricVector.Value = value;
|
||||
storeIsometricX.Value = value.x;
|
||||
storeIsometricY.Value = value.y;
|
||||
storeIsometricZ.Value = value.z;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 693a3d4871bd64c19a94cce4a562f96a
|
||||
timeCreated: 1450193231
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
47
Assets/IsoTools/Addons/PlayMaker/Actions/IsoGetDrag.cs
Normal file
47
Assets/IsoTools/Addons/PlayMaker/Actions/IsoGetDrag.cs
Normal file
@@ -0,0 +1,47 @@
|
||||
#if PLAYMAKER
|
||||
using UnityEngine;
|
||||
using IsoTools.Physics;
|
||||
using HutongGames.PlayMaker;
|
||||
using IsoTools.PlayMaker.Internal;
|
||||
|
||||
namespace IsoTools.PlayMaker.Actions {
|
||||
[ActionCategory("IsoTools.Physics")]
|
||||
[HutongGames.PlayMaker.Tooltip(
|
||||
"Gets the Drag of a IsoRigidbody and stores it in a Float Variable.")]
|
||||
public class IsoGetDrag : IsoComponentAction<IsoRigidbody> {
|
||||
[RequiredField]
|
||||
[CheckForComponent(typeof(IsoRigidbody))]
|
||||
public FsmOwnerDefault gameObject;
|
||||
|
||||
[RequiredField]
|
||||
[UIHint(UIHint.Variable)]
|
||||
public FsmFloat storeResult;
|
||||
|
||||
public bool everyFrame;
|
||||
|
||||
public override void Reset() {
|
||||
gameObject = null;
|
||||
storeResult = null;
|
||||
everyFrame = false;
|
||||
}
|
||||
|
||||
public override void OnEnter() {
|
||||
DoAction();
|
||||
if ( !everyFrame ) {
|
||||
Finish();
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnUpdate() {
|
||||
DoAction();
|
||||
}
|
||||
|
||||
void DoAction() {
|
||||
var go = Fsm.GetOwnerDefaultTarget(gameObject);
|
||||
if ( UpdateCache(go) ) {
|
||||
storeResult.Value = isoRigidbody.drag;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
12
Assets/IsoTools/Addons/PlayMaker/Actions/IsoGetDrag.cs.meta
Normal file
12
Assets/IsoTools/Addons/PlayMaker/Actions/IsoGetDrag.cs.meta
Normal file
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b325fb1bc25fa4247b1102fe5ca8aa13
|
||||
timeCreated: 1450621080
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
47
Assets/IsoTools/Addons/PlayMaker/Actions/IsoGetMass.cs
Normal file
47
Assets/IsoTools/Addons/PlayMaker/Actions/IsoGetMass.cs
Normal file
@@ -0,0 +1,47 @@
|
||||
#if PLAYMAKER
|
||||
using UnityEngine;
|
||||
using IsoTools.Physics;
|
||||
using HutongGames.PlayMaker;
|
||||
using IsoTools.PlayMaker.Internal;
|
||||
|
||||
namespace IsoTools.PlayMaker.Actions {
|
||||
[ActionCategory("IsoTools.Physics")]
|
||||
[HutongGames.PlayMaker.Tooltip(
|
||||
"Gets the Mass of a IsoRigidbody and stores it in a Float Variable.")]
|
||||
public class IsoGetMass : IsoComponentAction<IsoRigidbody> {
|
||||
[RequiredField]
|
||||
[CheckForComponent(typeof(IsoRigidbody))]
|
||||
public FsmOwnerDefault gameObject;
|
||||
|
||||
[RequiredField]
|
||||
[UIHint(UIHint.Variable)]
|
||||
public FsmFloat storeResult;
|
||||
|
||||
public bool everyFrame;
|
||||
|
||||
public override void Reset() {
|
||||
gameObject = null;
|
||||
storeResult = null;
|
||||
everyFrame = false;
|
||||
}
|
||||
|
||||
public override void OnEnter() {
|
||||
DoAction();
|
||||
if ( !everyFrame ) {
|
||||
Finish();
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnUpdate() {
|
||||
DoAction();
|
||||
}
|
||||
|
||||
void DoAction() {
|
||||
var go = Fsm.GetOwnerDefaultTarget(gameObject);
|
||||
if ( UpdateCache(go) ) {
|
||||
storeResult.Value = isoRigidbody.mass;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
12
Assets/IsoTools/Addons/PlayMaker/Actions/IsoGetMass.cs.meta
Normal file
12
Assets/IsoTools/Addons/PlayMaker/Actions/IsoGetMass.cs.meta
Normal file
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: daefced600ce84c6a955e1697b458114
|
||||
timeCreated: 1450621053
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,80 @@
|
||||
#if PLAYMAKER
|
||||
using UnityEngine;
|
||||
using HutongGames.PlayMaker;
|
||||
using IsoTools.PlayMaker.Internal;
|
||||
|
||||
namespace IsoTools.PlayMaker.Actions {
|
||||
[ActionCategory("IsoTools")]
|
||||
[HutongGames.PlayMaker.Tooltip(
|
||||
"Gets a mouse isometric position.")]
|
||||
public class IsoGetMouseIsoPosition : IsoComponentAction<IsoWorld> {
|
||||
[RequiredField]
|
||||
[CheckForComponent(typeof(IsoWorld))]
|
||||
[HutongGames.PlayMaker.Title("IsoWorld (In)")]
|
||||
public FsmOwnerDefault gameObject;
|
||||
|
||||
[CheckForComponent(typeof(Camera))]
|
||||
[HutongGames.PlayMaker.Title("Camera (In)")]
|
||||
[HutongGames.PlayMaker.Tooltip("Specific camera or main camera for 'None'.")]
|
||||
public FsmGameObject camera;
|
||||
|
||||
[HutongGames.PlayMaker.Title("Specific Isometric Z (In)")]
|
||||
[HutongGames.PlayMaker.Tooltip("Specific Isometric Z or 0.0f for 'None'")]
|
||||
public FsmFloat specificIsometricZ;
|
||||
|
||||
[UIHint(UIHint.Variable)]
|
||||
[HutongGames.PlayMaker.Title("Store Position (Out)")]
|
||||
public FsmVector3 storeVector;
|
||||
|
||||
[UIHint(UIHint.Variable)]
|
||||
[HutongGames.PlayMaker.Title("Store Position X (Out)")]
|
||||
public FsmFloat storeX;
|
||||
|
||||
[UIHint(UIHint.Variable)]
|
||||
[HutongGames.PlayMaker.Title("Store Position Y (Out)")]
|
||||
public FsmFloat storeY;
|
||||
|
||||
[UIHint(UIHint.Variable)]
|
||||
[HutongGames.PlayMaker.Title("Store Position Z (Out)")]
|
||||
public FsmFloat storeZ;
|
||||
|
||||
[HutongGames.PlayMaker.Tooltip("Repeat every frame.")]
|
||||
public bool everyFrame;
|
||||
|
||||
public override void Reset() {
|
||||
gameObject = null;
|
||||
camera = null;
|
||||
specificIsometricZ = null;
|
||||
storeVector = null;
|
||||
storeX = null;
|
||||
storeY = null;
|
||||
storeZ = null;
|
||||
everyFrame = false;
|
||||
}
|
||||
|
||||
public override void OnEnter() {
|
||||
DoAction();
|
||||
if ( !everyFrame ) {
|
||||
Finish();
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnUpdate() {
|
||||
DoAction();
|
||||
}
|
||||
|
||||
void DoAction() {
|
||||
var go = Fsm.GetOwnerDefaultTarget(gameObject);
|
||||
if ( UpdateCache(go) ) {
|
||||
var value = isoWorld.MouseIsoPosition(
|
||||
camera.IsNone ? Camera.main : camera.Value.GetComponent<Camera>(),
|
||||
specificIsometricZ.IsNone ? 0.0f : specificIsometricZ.Value);
|
||||
storeVector.Value = value;
|
||||
storeX.Value = value.x;
|
||||
storeY.Value = value.y;
|
||||
storeZ.Value = value.z;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2dffeb7d382404baa9daf01f1da629a1
|
||||
timeCreated: 1450288005
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,80 @@
|
||||
#if PLAYMAKER
|
||||
using UnityEngine;
|
||||
using HutongGames.PlayMaker;
|
||||
using IsoTools.PlayMaker.Internal;
|
||||
|
||||
namespace IsoTools.PlayMaker.Actions {
|
||||
[ActionCategory("IsoTools")]
|
||||
[HutongGames.PlayMaker.Tooltip(
|
||||
"Gets a mouse isometric tile position.")]
|
||||
public class IsoGetMouseIsoTilePosition : IsoComponentAction<IsoWorld> {
|
||||
[RequiredField]
|
||||
[CheckForComponent(typeof(IsoWorld))]
|
||||
[HutongGames.PlayMaker.Title("IsoWorld (In)")]
|
||||
public FsmOwnerDefault gameObject;
|
||||
|
||||
[CheckForComponent(typeof(Camera))]
|
||||
[HutongGames.PlayMaker.Title("Camera (In)")]
|
||||
[HutongGames.PlayMaker.Tooltip("Specific camera or main camera for 'None'.")]
|
||||
public FsmGameObject camera;
|
||||
|
||||
[HutongGames.PlayMaker.Title("Specific Isometric Z (In)")]
|
||||
[HutongGames.PlayMaker.Tooltip("Specific Isometric Z or 0.0f for 'None'")]
|
||||
public FsmFloat specificIsometricZ;
|
||||
|
||||
[UIHint(UIHint.Variable)]
|
||||
[HutongGames.PlayMaker.Title("Store Tile Position (Out)")]
|
||||
public FsmVector3 storeVector;
|
||||
|
||||
[UIHint(UIHint.Variable)]
|
||||
[HutongGames.PlayMaker.Title("Store Tile Position X (Out)")]
|
||||
public FsmFloat storeX;
|
||||
|
||||
[UIHint(UIHint.Variable)]
|
||||
[HutongGames.PlayMaker.Title("Store Tile Position Y (Out)")]
|
||||
public FsmFloat storeY;
|
||||
|
||||
[UIHint(UIHint.Variable)]
|
||||
[HutongGames.PlayMaker.Title("Store Tile Position Z (Out)")]
|
||||
public FsmFloat storeZ;
|
||||
|
||||
[HutongGames.PlayMaker.Tooltip("Repeat every frame.")]
|
||||
public bool everyFrame;
|
||||
|
||||
public override void Reset() {
|
||||
gameObject = null;
|
||||
camera = null;
|
||||
specificIsometricZ = null;
|
||||
storeVector = null;
|
||||
storeX = null;
|
||||
storeY = null;
|
||||
storeZ = null;
|
||||
everyFrame = false;
|
||||
}
|
||||
|
||||
public override void OnEnter() {
|
||||
DoAction();
|
||||
if ( !everyFrame ) {
|
||||
Finish();
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnUpdate() {
|
||||
DoAction();
|
||||
}
|
||||
|
||||
void DoAction() {
|
||||
var go = Fsm.GetOwnerDefaultTarget(gameObject);
|
||||
if ( UpdateCache(go) ) {
|
||||
var value = isoWorld.MouseIsoTilePosition(
|
||||
camera.IsNone ? Camera.main : camera.Value.GetComponent<Camera>(),
|
||||
specificIsometricZ.IsNone ? 0.0f : specificIsometricZ.Value);
|
||||
storeVector.Value = value;
|
||||
storeX.Value = value.x;
|
||||
storeY.Value = value.y;
|
||||
storeZ.Value = value.z;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 52e132a4a0d844bbd84f8b1fbd61aa12
|
||||
timeCreated: 1450288016
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
68
Assets/IsoTools/Addons/PlayMaker/Actions/IsoGetPosition.cs
Normal file
68
Assets/IsoTools/Addons/PlayMaker/Actions/IsoGetPosition.cs
Normal file
@@ -0,0 +1,68 @@
|
||||
#if PLAYMAKER
|
||||
using UnityEngine;
|
||||
using HutongGames.PlayMaker;
|
||||
using IsoTools.PlayMaker.Internal;
|
||||
|
||||
namespace IsoTools.PlayMaker.Actions {
|
||||
[ActionCategory("IsoTools")]
|
||||
[HutongGames.PlayMaker.Tooltip(
|
||||
"Gets the Position of a IsoObject and stores it " +
|
||||
"in a Vector3 Variable or each Axis in a Float Variable")]
|
||||
public class IsoGetPosition : IsoComponentAction<IsoObject> {
|
||||
[RequiredField]
|
||||
[CheckForComponent(typeof(IsoObject))]
|
||||
[HutongGames.PlayMaker.Title("IsoObject (In)")]
|
||||
public FsmOwnerDefault gameObject;
|
||||
|
||||
[UIHint(UIHint.Variable)]
|
||||
[HutongGames.PlayMaker.Title("Store Position Vector (Out)")]
|
||||
public FsmVector3 storeVector;
|
||||
|
||||
[UIHint(UIHint.Variable)]
|
||||
[HutongGames.PlayMaker.Title("Store Position X (Out)")]
|
||||
public FsmFloat storeX;
|
||||
|
||||
[UIHint(UIHint.Variable)]
|
||||
[HutongGames.PlayMaker.Title("Store Position Y (Out)")]
|
||||
public FsmFloat storeY;
|
||||
|
||||
[UIHint(UIHint.Variable)]
|
||||
[HutongGames.PlayMaker.Title("Store Position Z (Out)")]
|
||||
public FsmFloat storeZ;
|
||||
|
||||
[HutongGames.PlayMaker.Tooltip("Repeat every frame.")]
|
||||
public bool everyFrame;
|
||||
|
||||
public override void Reset() {
|
||||
gameObject = null;
|
||||
storeVector = null;
|
||||
storeX = null;
|
||||
storeY = null;
|
||||
storeZ = null;
|
||||
everyFrame = false;
|
||||
}
|
||||
|
||||
public override void OnEnter() {
|
||||
DoAction();
|
||||
if ( !everyFrame ) {
|
||||
Finish();
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnUpdate() {
|
||||
DoAction();
|
||||
}
|
||||
|
||||
void DoAction() {
|
||||
var go = Fsm.GetOwnerDefaultTarget(gameObject);
|
||||
if ( UpdateCache(go) ) {
|
||||
var value = isoObject.position;
|
||||
storeVector.Value = value;
|
||||
storeX.Value = value.x;
|
||||
storeY.Value = value.y;
|
||||
storeZ.Value = value.z;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c611ab0e954f04d81bb71728da293513
|
||||
timeCreated: 1450001517
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,40 @@
|
||||
#if PLAYMAKER
|
||||
using UnityEngine;
|
||||
using HutongGames.PlayMaker;
|
||||
using IsoTools.PlayMaker.Internal;
|
||||
|
||||
namespace IsoTools.PlayMaker.Actions {
|
||||
[ActionCategory("IsoTools")]
|
||||
[HutongGames.PlayMaker.Tooltip(
|
||||
"Gets the Renderers Mode of a IsoObject and stores it in a Enum Variable")]
|
||||
public class IsoGetMode : IsoComponentAction<IsoObject> {
|
||||
[RequiredField]
|
||||
[CheckForComponent(typeof(IsoObject))]
|
||||
[HutongGames.PlayMaker.Title("IsoObject (In)")]
|
||||
public FsmOwnerDefault gameObject;
|
||||
|
||||
[RequiredField]
|
||||
[ObjectType(typeof(IsoObject.RenderersMode))]
|
||||
[UIHint(UIHint.Variable)]
|
||||
[HutongGames.PlayMaker.Title("Store Renderers Mode (Out)")]
|
||||
public FsmEnum storeRenderersMode;
|
||||
|
||||
public override void Reset() {
|
||||
gameObject = null;
|
||||
storeRenderersMode = null;
|
||||
}
|
||||
|
||||
public override void OnEnter() {
|
||||
DoAction();
|
||||
Finish();
|
||||
}
|
||||
|
||||
void DoAction() {
|
||||
var go = Fsm.GetOwnerDefaultTarget(gameObject);
|
||||
if ( UpdateCache(go) ) {
|
||||
storeRenderersMode.Value = isoObject.renderersMode;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ee5d31a178d81452ea41e5945bdec367
|
||||
timeCreated: 1450021857
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
68
Assets/IsoTools/Addons/PlayMaker/Actions/IsoGetSize.cs
Normal file
68
Assets/IsoTools/Addons/PlayMaker/Actions/IsoGetSize.cs
Normal file
@@ -0,0 +1,68 @@
|
||||
#if PLAYMAKER
|
||||
using UnityEngine;
|
||||
using HutongGames.PlayMaker;
|
||||
using IsoTools.PlayMaker.Internal;
|
||||
|
||||
namespace IsoTools.PlayMaker.Actions {
|
||||
[ActionCategory("IsoTools")]
|
||||
[HutongGames.PlayMaker.Tooltip(
|
||||
"Gets the Size of a IsoObject and stores it " +
|
||||
"in a Vector3 Variable or each Axis in a Float Variable")]
|
||||
public class IsoGetSize : IsoComponentAction<IsoObject> {
|
||||
[RequiredField]
|
||||
[CheckForComponent(typeof(IsoObject))]
|
||||
[HutongGames.PlayMaker.Title("IsoObject (In)")]
|
||||
public FsmOwnerDefault gameObject;
|
||||
|
||||
[UIHint(UIHint.Variable)]
|
||||
[HutongGames.PlayMaker.Title("Store Size Vector (Out)")]
|
||||
public FsmVector3 storeVector;
|
||||
|
||||
[UIHint(UIHint.Variable)]
|
||||
[HutongGames.PlayMaker.Title("Store Size X (Out)")]
|
||||
public FsmFloat storeX;
|
||||
|
||||
[UIHint(UIHint.Variable)]
|
||||
[HutongGames.PlayMaker.Title("Store Size Y (Out)")]
|
||||
public FsmFloat storeY;
|
||||
|
||||
[UIHint(UIHint.Variable)]
|
||||
[HutongGames.PlayMaker.Title("Store Size Z (Out)")]
|
||||
public FsmFloat storeZ;
|
||||
|
||||
[HutongGames.PlayMaker.Tooltip("Repeat every frame.")]
|
||||
public bool everyFrame;
|
||||
|
||||
public override void Reset() {
|
||||
gameObject = null;
|
||||
storeVector = null;
|
||||
storeX = null;
|
||||
storeY = null;
|
||||
storeZ = null;
|
||||
everyFrame = false;
|
||||
}
|
||||
|
||||
public override void OnEnter() {
|
||||
DoAction();
|
||||
if ( !everyFrame ) {
|
||||
Finish();
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnUpdate() {
|
||||
DoAction();
|
||||
}
|
||||
|
||||
void DoAction() {
|
||||
var go = Fsm.GetOwnerDefaultTarget(gameObject);
|
||||
if ( UpdateCache(go) ) {
|
||||
var value = isoObject.size;
|
||||
storeVector.Value = value;
|
||||
storeX.Value = value.x;
|
||||
storeY.Value = value.y;
|
||||
storeZ.Value = value.z;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
12
Assets/IsoTools/Addons/PlayMaker/Actions/IsoGetSize.cs.meta
Normal file
12
Assets/IsoTools/Addons/PlayMaker/Actions/IsoGetSize.cs.meta
Normal file
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 786db15115e7f4363b18ae4aadcf2e3b
|
||||
timeCreated: 1450014652
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
47
Assets/IsoTools/Addons/PlayMaker/Actions/IsoGetSpeed.cs
Normal file
47
Assets/IsoTools/Addons/PlayMaker/Actions/IsoGetSpeed.cs
Normal file
@@ -0,0 +1,47 @@
|
||||
#if PLAYMAKER
|
||||
using UnityEngine;
|
||||
using IsoTools.Physics;
|
||||
using HutongGames.PlayMaker;
|
||||
using IsoTools.PlayMaker.Internal;
|
||||
|
||||
namespace IsoTools.PlayMaker.Actions {
|
||||
[ActionCategory("IsoTools.Physics")]
|
||||
[HutongGames.PlayMaker.Tooltip(
|
||||
"Gets the Speed of a IsoRigidbody and stores it in a Float Variable.")]
|
||||
public class IsoGetSpeed : IsoComponentAction<IsoRigidbody> {
|
||||
[RequiredField]
|
||||
[CheckForComponent(typeof(IsoRigidbody))]
|
||||
public FsmOwnerDefault gameObject;
|
||||
|
||||
[RequiredField]
|
||||
[UIHint(UIHint.Variable)]
|
||||
public FsmFloat storeResult;
|
||||
|
||||
public bool everyFrame;
|
||||
|
||||
public override void Reset() {
|
||||
gameObject = null;
|
||||
storeResult = null;
|
||||
everyFrame = false;
|
||||
}
|
||||
|
||||
public override void OnEnter() {
|
||||
DoAction();
|
||||
if ( !everyFrame ) {
|
||||
Finish();
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnUpdate() {
|
||||
DoAction();
|
||||
}
|
||||
|
||||
void DoAction() {
|
||||
var go = Fsm.GetOwnerDefaultTarget(gameObject);
|
||||
if ( UpdateCache(go) ) {
|
||||
storeResult.Value = isoRigidbody.velocity.magnitude;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
12
Assets/IsoTools/Addons/PlayMaker/Actions/IsoGetSpeed.cs.meta
Normal file
12
Assets/IsoTools/Addons/PlayMaker/Actions/IsoGetSpeed.cs.meta
Normal file
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 47bdbba00b58348cd9376287604f29ce
|
||||
timeCreated: 1450620446
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,68 @@
|
||||
#if PLAYMAKER
|
||||
using UnityEngine;
|
||||
using HutongGames.PlayMaker;
|
||||
using IsoTools.PlayMaker.Internal;
|
||||
|
||||
namespace IsoTools.PlayMaker.Actions {
|
||||
[ActionCategory("IsoTools")]
|
||||
[HutongGames.PlayMaker.Tooltip(
|
||||
"Gets the TilePosition of a IsoObject and stores it " +
|
||||
"in a Vector3 Variable or each Axis in a Float Variable")]
|
||||
public class IsoGetTilePosition : IsoComponentAction<IsoObject> {
|
||||
[RequiredField]
|
||||
[CheckForComponent(typeof(IsoObject))]
|
||||
[HutongGames.PlayMaker.Title("IsoObject (In)")]
|
||||
public FsmOwnerDefault gameObject;
|
||||
|
||||
[UIHint(UIHint.Variable)]
|
||||
[HutongGames.PlayMaker.Title("Store Tile Position Vector (Out)")]
|
||||
public FsmVector3 storeVector;
|
||||
|
||||
[UIHint(UIHint.Variable)]
|
||||
[HutongGames.PlayMaker.Title("Store Tile Position X (Out)")]
|
||||
public FsmFloat storeX;
|
||||
|
||||
[UIHint(UIHint.Variable)]
|
||||
[HutongGames.PlayMaker.Title("Store Tile Position Y (Out)")]
|
||||
public FsmFloat storeY;
|
||||
|
||||
[UIHint(UIHint.Variable)]
|
||||
[HutongGames.PlayMaker.Title("Store Tile Position Z (Out)")]
|
||||
public FsmFloat storeZ;
|
||||
|
||||
[HutongGames.PlayMaker.Tooltip("Repeat every frame.")]
|
||||
public bool everyFrame;
|
||||
|
||||
public override void Reset() {
|
||||
gameObject = null;
|
||||
storeVector = null;
|
||||
storeX = null;
|
||||
storeY = null;
|
||||
storeZ = null;
|
||||
everyFrame = false;
|
||||
}
|
||||
|
||||
public override void OnEnter() {
|
||||
DoAction();
|
||||
if ( !everyFrame ) {
|
||||
Finish();
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnUpdate() {
|
||||
DoAction();
|
||||
}
|
||||
|
||||
void DoAction() {
|
||||
var go = Fsm.GetOwnerDefaultTarget(gameObject);
|
||||
if ( UpdateCache(go) ) {
|
||||
var value = isoObject.tilePosition;
|
||||
storeVector.Value = value;
|
||||
storeX.Value = value.x;
|
||||
storeY.Value = value.y;
|
||||
storeZ.Value = value.z;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a4c5cff4e06894f2aae07daa307c76d9
|
||||
timeCreated: 1450207773
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,86 @@
|
||||
#if PLAYMAKER
|
||||
using UnityEngine;
|
||||
using HutongGames.PlayMaker;
|
||||
using IsoTools.PlayMaker.Internal;
|
||||
|
||||
namespace IsoTools.PlayMaker.Actions {
|
||||
[ActionCategory("IsoTools")]
|
||||
[HutongGames.PlayMaker.Tooltip(
|
||||
"Gets a touch isometric position.")]
|
||||
public class IsoGetTouchIsoPosition : IsoComponentAction<IsoWorld> {
|
||||
[RequiredField]
|
||||
[CheckForComponent(typeof(IsoWorld))]
|
||||
[HutongGames.PlayMaker.Title("IsoWorld (In)")]
|
||||
public FsmOwnerDefault gameObject;
|
||||
|
||||
[RequiredField]
|
||||
[HutongGames.PlayMaker.Title("Finger Id (In)")]
|
||||
public FsmInt fingerId;
|
||||
|
||||
[CheckForComponent(typeof(Camera))]
|
||||
[HutongGames.PlayMaker.Title("Camera (In)")]
|
||||
[HutongGames.PlayMaker.Tooltip("Specific camera or main camera for 'None'.")]
|
||||
public FsmGameObject camera;
|
||||
|
||||
[HutongGames.PlayMaker.Title("Specific Isometric Z (In)")]
|
||||
[HutongGames.PlayMaker.Tooltip("Specific Isometric Z or 0.0f for 'None'")]
|
||||
public FsmFloat specificIsometricZ;
|
||||
|
||||
[UIHint(UIHint.Variable)]
|
||||
[HutongGames.PlayMaker.Title("Store Position (Out)")]
|
||||
public FsmVector3 storeVector;
|
||||
|
||||
[UIHint(UIHint.Variable)]
|
||||
[HutongGames.PlayMaker.Title("Store Position X (Out)")]
|
||||
public FsmFloat storeX;
|
||||
|
||||
[UIHint(UIHint.Variable)]
|
||||
[HutongGames.PlayMaker.Title("Store Position Y (Out)")]
|
||||
public FsmFloat storeY;
|
||||
|
||||
[UIHint(UIHint.Variable)]
|
||||
[HutongGames.PlayMaker.Title("Store Position Z (Out)")]
|
||||
public FsmFloat storeZ;
|
||||
|
||||
[HutongGames.PlayMaker.Tooltip("Repeat every frame.")]
|
||||
public bool everyFrame;
|
||||
|
||||
public override void Reset() {
|
||||
gameObject = null;
|
||||
fingerId = null;
|
||||
camera = null;
|
||||
specificIsometricZ = null;
|
||||
storeVector = null;
|
||||
storeX = null;
|
||||
storeY = null;
|
||||
storeZ = null;
|
||||
everyFrame = false;
|
||||
}
|
||||
|
||||
public override void OnEnter() {
|
||||
DoAction();
|
||||
if ( !everyFrame ) {
|
||||
Finish();
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnUpdate() {
|
||||
DoAction();
|
||||
}
|
||||
|
||||
void DoAction() {
|
||||
var go = Fsm.GetOwnerDefaultTarget(gameObject);
|
||||
if ( UpdateCache(go) ) {
|
||||
var value = isoWorld.TouchIsoPosition(
|
||||
fingerId.Value,
|
||||
camera.IsNone ? Camera.main : camera.Value.GetComponent<Camera>(),
|
||||
specificIsometricZ.IsNone ? 0.0f : specificIsometricZ.Value);
|
||||
storeVector.Value = value;
|
||||
storeX.Value = value.x;
|
||||
storeY.Value = value.y;
|
||||
storeZ.Value = value.z;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 88c45e14a4cd040f992be5868786242f
|
||||
timeCreated: 1450196704
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,86 @@
|
||||
#if PLAYMAKER
|
||||
using UnityEngine;
|
||||
using HutongGames.PlayMaker;
|
||||
using IsoTools.PlayMaker.Internal;
|
||||
|
||||
namespace IsoTools.PlayMaker.Actions {
|
||||
[ActionCategory("IsoTools")]
|
||||
[HutongGames.PlayMaker.Tooltip(
|
||||
"Gets a touch isometric tile position.")]
|
||||
public class IsoGetTouchIsoTilePosition : IsoComponentAction<IsoWorld> {
|
||||
[RequiredField]
|
||||
[CheckForComponent(typeof(IsoWorld))]
|
||||
[HutongGames.PlayMaker.Title("IsoWorld (In)")]
|
||||
public FsmOwnerDefault gameObject;
|
||||
|
||||
[RequiredField]
|
||||
[HutongGames.PlayMaker.Title("Finger Id (In)")]
|
||||
public FsmInt fingerId;
|
||||
|
||||
[CheckForComponent(typeof(Camera))]
|
||||
[HutongGames.PlayMaker.Title("Camera (In)")]
|
||||
[HutongGames.PlayMaker.Tooltip("Specific camera or main camera for 'None'.")]
|
||||
public FsmGameObject camera;
|
||||
|
||||
[HutongGames.PlayMaker.Title("Specific Isometric Z (In)")]
|
||||
[HutongGames.PlayMaker.Tooltip("Specific Isometric Z or 0.0f for 'None'")]
|
||||
public FsmFloat specificIsometricZ;
|
||||
|
||||
[UIHint(UIHint.Variable)]
|
||||
[HutongGames.PlayMaker.Title("Store Tile Position (Out)")]
|
||||
public FsmVector3 storeVector;
|
||||
|
||||
[UIHint(UIHint.Variable)]
|
||||
[HutongGames.PlayMaker.Title("Store Tile Position X (Out)")]
|
||||
public FsmFloat storeX;
|
||||
|
||||
[UIHint(UIHint.Variable)]
|
||||
[HutongGames.PlayMaker.Title("Store Tile Position Y (Out)")]
|
||||
public FsmFloat storeY;
|
||||
|
||||
[UIHint(UIHint.Variable)]
|
||||
[HutongGames.PlayMaker.Title("Store Tile Position Z (Out)")]
|
||||
public FsmFloat storeZ;
|
||||
|
||||
[HutongGames.PlayMaker.Tooltip("Repeat every frame.")]
|
||||
public bool everyFrame;
|
||||
|
||||
public override void Reset() {
|
||||
gameObject = null;
|
||||
fingerId = null;
|
||||
camera = null;
|
||||
specificIsometricZ = null;
|
||||
storeVector = null;
|
||||
storeX = null;
|
||||
storeY = null;
|
||||
storeZ = null;
|
||||
everyFrame = false;
|
||||
}
|
||||
|
||||
public override void OnEnter() {
|
||||
DoAction();
|
||||
if ( !everyFrame ) {
|
||||
Finish();
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnUpdate() {
|
||||
DoAction();
|
||||
}
|
||||
|
||||
void DoAction() {
|
||||
var go = Fsm.GetOwnerDefaultTarget(gameObject);
|
||||
if ( UpdateCache(go) ) {
|
||||
var value = isoWorld.TouchIsoTilePosition(
|
||||
fingerId.Value,
|
||||
camera.IsNone ? Camera.main : camera.Value.GetComponent<Camera>(),
|
||||
specificIsometricZ.IsNone ? 0.0f : specificIsometricZ.Value);
|
||||
storeVector.Value = value;
|
||||
storeX.Value = value.x;
|
||||
storeY.Value = value.y;
|
||||
storeZ.Value = value.z;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 91eb63755433a4241b6cdf806e27a493
|
||||
timeCreated: 1450196722
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
63
Assets/IsoTools/Addons/PlayMaker/Actions/IsoGetVelocity.cs
Normal file
63
Assets/IsoTools/Addons/PlayMaker/Actions/IsoGetVelocity.cs
Normal file
@@ -0,0 +1,63 @@
|
||||
#if PLAYMAKER
|
||||
using UnityEngine;
|
||||
using IsoTools.Physics;
|
||||
using HutongGames.PlayMaker;
|
||||
using IsoTools.PlayMaker.Internal;
|
||||
|
||||
namespace IsoTools.PlayMaker.Actions {
|
||||
[ActionCategory("IsoTools.Physics")]
|
||||
[HutongGames.PlayMaker.Tooltip(
|
||||
"Gets the Velocity of a IsoRigidbody and stores it " +
|
||||
"in a Vector3 Variable or each Axis in a Float Variable")]
|
||||
public class IsoGetVelocity : IsoComponentAction<IsoRigidbody> {
|
||||
[RequiredField]
|
||||
[CheckForComponent(typeof(IsoRigidbody))]
|
||||
public FsmOwnerDefault gameObject;
|
||||
|
||||
[UIHint(UIHint.Variable)]
|
||||
public FsmVector3 storeVector;
|
||||
|
||||
[UIHint(UIHint.Variable)]
|
||||
public FsmFloat storeX;
|
||||
|
||||
[UIHint(UIHint.Variable)]
|
||||
public FsmFloat storeY;
|
||||
|
||||
[UIHint(UIHint.Variable)]
|
||||
public FsmFloat storeZ;
|
||||
|
||||
public bool everyFrame;
|
||||
|
||||
public override void Reset() {
|
||||
gameObject = null;
|
||||
storeVector = null;
|
||||
storeX = null;
|
||||
storeY = null;
|
||||
storeZ = null;
|
||||
everyFrame = false;
|
||||
}
|
||||
|
||||
public override void OnEnter() {
|
||||
DoAction();
|
||||
if ( !everyFrame ) {
|
||||
Finish();
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnUpdate() {
|
||||
DoAction();
|
||||
}
|
||||
|
||||
void DoAction() {
|
||||
var go = Fsm.GetOwnerDefaultTarget(gameObject);
|
||||
if ( UpdateCache(go) ) {
|
||||
var value = isoRigidbody.velocity;
|
||||
storeVector.Value = value;
|
||||
storeX.Value = value.x;
|
||||
storeY.Value = value.y;
|
||||
storeZ.Value = value.z;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ea8962e92212e431ba4e354fbb0ff3e3
|
||||
timeCreated: 1450619756
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
78
Assets/IsoTools/Addons/PlayMaker/Actions/IsoGetWorldProps.cs
Normal file
78
Assets/IsoTools/Addons/PlayMaker/Actions/IsoGetWorldProps.cs
Normal file
@@ -0,0 +1,78 @@
|
||||
#if PLAYMAKER
|
||||
using UnityEngine;
|
||||
using HutongGames.PlayMaker;
|
||||
using IsoTools.PlayMaker.Internal;
|
||||
|
||||
namespace IsoTools.PlayMaker.Actions {
|
||||
[ActionCategory("IsoTools")]
|
||||
[HutongGames.PlayMaker.Tooltip(
|
||||
"Gets an options of a IsoWorld.")]
|
||||
public class IsoGetWorldProps : IsoComponentAction<IsoWorld> {
|
||||
[RequiredField]
|
||||
[CheckForComponent(typeof(IsoWorld))]
|
||||
[HutongGames.PlayMaker.Title("IsoWorld (In)")]
|
||||
public FsmOwnerDefault gameObject;
|
||||
|
||||
[UIHint(UIHint.Variable)]
|
||||
[HutongGames.PlayMaker.Title("Tile Size (Out)")]
|
||||
public FsmFloat tileSize;
|
||||
|
||||
[UIHint(UIHint.Variable)]
|
||||
[HutongGames.PlayMaker.Title("Tile Ratio (Out)")]
|
||||
public FsmFloat tileRatio;
|
||||
|
||||
[UIHint(UIHint.Variable)]
|
||||
[HutongGames.PlayMaker.Title("Tile Angle (Out)")]
|
||||
public FsmFloat tileAngle;
|
||||
|
||||
[UIHint(UIHint.Variable)]
|
||||
[HutongGames.PlayMaker.Title("Tile Height (Out)")]
|
||||
public FsmFloat tileHeight;
|
||||
|
||||
[UIHint(UIHint.Variable)]
|
||||
[HutongGames.PlayMaker.Title("Step Depth (Out)")]
|
||||
public FsmFloat stepDepth;
|
||||
|
||||
[UIHint(UIHint.Variable)]
|
||||
[HutongGames.PlayMaker.Title("Start Depth (Out)")]
|
||||
public FsmFloat startDepth;
|
||||
|
||||
[HutongGames.PlayMaker.Tooltip("Repeat every frame.")]
|
||||
public bool everyFrame;
|
||||
|
||||
public override void Reset() {
|
||||
gameObject = null;
|
||||
tileSize = null;
|
||||
tileRatio = null;
|
||||
tileAngle = null;
|
||||
tileHeight = null;
|
||||
stepDepth = null;
|
||||
startDepth = null;
|
||||
everyFrame = false;
|
||||
}
|
||||
|
||||
public override void OnEnter() {
|
||||
DoAction();
|
||||
if ( !everyFrame ) {
|
||||
Finish();
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnUpdate() {
|
||||
DoAction();
|
||||
}
|
||||
|
||||
void DoAction() {
|
||||
var go = Fsm.GetOwnerDefaultTarget(gameObject);
|
||||
if ( UpdateCache(go) ) {
|
||||
tileSize.Value = isoWorld.tileSize;
|
||||
tileRatio.Value = isoWorld.tileRatio;
|
||||
tileAngle.Value = isoWorld.tileAngle;
|
||||
tileHeight.Value = isoWorld.tileHeight;
|
||||
stepDepth.Value = isoWorld.stepDepth;
|
||||
startDepth.Value = isoWorld.startDepth;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 571909e63f3954244b08fd7338e68605
|
||||
timeCreated: 1450110259
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
53
Assets/IsoTools/Addons/PlayMaker/Actions/IsoIsKinematic.cs
Normal file
53
Assets/IsoTools/Addons/PlayMaker/Actions/IsoIsKinematic.cs
Normal file
@@ -0,0 +1,53 @@
|
||||
#if PLAYMAKER
|
||||
using UnityEngine;
|
||||
using IsoTools.Physics;
|
||||
using HutongGames.PlayMaker;
|
||||
using IsoTools.PlayMaker.Internal;
|
||||
|
||||
namespace IsoTools.PlayMaker.Actions {
|
||||
[ActionCategory("IsoTools.Physics")]
|
||||
[HutongGames.PlayMaker.Tooltip(
|
||||
"Tests if a IsoRigidbody is kinematic.")]
|
||||
public class IsoIsKinematic : IsoComponentAction<IsoRigidbody> {
|
||||
[RequiredField]
|
||||
[CheckForComponent(typeof(IsoRigidbody))]
|
||||
public FsmOwnerDefault gameObject;
|
||||
|
||||
public FsmEvent trueEvent;
|
||||
public FsmEvent falseEvent;
|
||||
|
||||
[UIHint(UIHint.Variable)]
|
||||
public FsmBool storeResult;
|
||||
|
||||
public bool everyFrame;
|
||||
|
||||
public override void Reset() {
|
||||
gameObject = null;
|
||||
trueEvent = null;
|
||||
falseEvent = null;
|
||||
storeResult = null;
|
||||
everyFrame = false;
|
||||
}
|
||||
|
||||
public override void OnEnter() {
|
||||
DoAction();
|
||||
if ( !everyFrame ) {
|
||||
Finish();
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnUpdate() {
|
||||
DoAction();
|
||||
}
|
||||
|
||||
void DoAction() {
|
||||
var go = Fsm.GetOwnerDefaultTarget(gameObject);
|
||||
if ( UpdateCache(go) ) {
|
||||
var value = isoRigidbody.isKinematic;
|
||||
storeResult.Value = value;
|
||||
Fsm.Event(value ? trueEvent : falseEvent);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 98f632c63797046b1a8f1898d00bc756
|
||||
timeCreated: 1450621255
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
53
Assets/IsoTools/Addons/PlayMaker/Actions/IsoIsSleeping.cs
Normal file
53
Assets/IsoTools/Addons/PlayMaker/Actions/IsoIsSleeping.cs
Normal file
@@ -0,0 +1,53 @@
|
||||
#if PLAYMAKER
|
||||
using UnityEngine;
|
||||
using IsoTools.Physics;
|
||||
using HutongGames.PlayMaker;
|
||||
using IsoTools.PlayMaker.Internal;
|
||||
|
||||
namespace IsoTools.PlayMaker.Actions {
|
||||
[ActionCategory("IsoTools.Physics")]
|
||||
[HutongGames.PlayMaker.Tooltip(
|
||||
"Tests if a IsoRigidbody is sleeping.")]
|
||||
public class IsoIsSleeping : IsoComponentAction<IsoRigidbody> {
|
||||
[RequiredField]
|
||||
[CheckForComponent(typeof(IsoRigidbody))]
|
||||
public FsmOwnerDefault gameObject;
|
||||
|
||||
public FsmEvent trueEvent;
|
||||
public FsmEvent falseEvent;
|
||||
|
||||
[UIHint(UIHint.Variable)]
|
||||
public FsmBool storeResult;
|
||||
|
||||
public bool everyFrame;
|
||||
|
||||
public override void Reset() {
|
||||
gameObject = null;
|
||||
trueEvent = null;
|
||||
falseEvent = null;
|
||||
storeResult = null;
|
||||
everyFrame = false;
|
||||
}
|
||||
|
||||
public override void OnEnter() {
|
||||
DoAction();
|
||||
if ( !everyFrame ) {
|
||||
Finish();
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnUpdate() {
|
||||
DoAction();
|
||||
}
|
||||
|
||||
void DoAction() {
|
||||
var go = Fsm.GetOwnerDefaultTarget(gameObject);
|
||||
if ( UpdateCache(go) ) {
|
||||
var value = isoRigidbody.IsSleeping();
|
||||
storeResult.Value = value;
|
||||
Fsm.Event(value ? trueEvent : falseEvent);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 57163cba226bd4f199a950f56d1f2a5c
|
||||
timeCreated: 1450621269
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
53
Assets/IsoTools/Addons/PlayMaker/Actions/IsoIsUseGravity.cs
Normal file
53
Assets/IsoTools/Addons/PlayMaker/Actions/IsoIsUseGravity.cs
Normal file
@@ -0,0 +1,53 @@
|
||||
#if PLAYMAKER
|
||||
using UnityEngine;
|
||||
using IsoTools.Physics;
|
||||
using HutongGames.PlayMaker;
|
||||
using IsoTools.PlayMaker.Internal;
|
||||
|
||||
namespace IsoTools.PlayMaker.Actions {
|
||||
[ActionCategory("IsoTools.Physics")]
|
||||
[HutongGames.PlayMaker.Tooltip(
|
||||
"Tests if a IsoRigidbody use gravity.")]
|
||||
public class IsoIsUseGravity : IsoComponentAction<IsoRigidbody> {
|
||||
[RequiredField]
|
||||
[CheckForComponent(typeof(IsoRigidbody))]
|
||||
public FsmOwnerDefault gameObject;
|
||||
|
||||
public FsmEvent trueEvent;
|
||||
public FsmEvent falseEvent;
|
||||
|
||||
[UIHint(UIHint.Variable)]
|
||||
public FsmBool storeResult;
|
||||
|
||||
public bool everyFrame;
|
||||
|
||||
public override void Reset() {
|
||||
gameObject = null;
|
||||
trueEvent = null;
|
||||
falseEvent = null;
|
||||
storeResult = null;
|
||||
everyFrame = false;
|
||||
}
|
||||
|
||||
public override void OnEnter() {
|
||||
DoAction();
|
||||
if ( !everyFrame ) {
|
||||
Finish();
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnUpdate() {
|
||||
DoAction();
|
||||
}
|
||||
|
||||
void DoAction() {
|
||||
var go = Fsm.GetOwnerDefaultTarget(gameObject);
|
||||
if ( UpdateCache(go) ) {
|
||||
var value = isoRigidbody.useGravity;
|
||||
storeResult.Value = value;
|
||||
Fsm.Event(value ? trueEvent : falseEvent);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bc13998ebfe99487a9e042a27adb3d18
|
||||
timeCreated: 1450621205
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
107
Assets/IsoTools/Addons/PlayMaker/Actions/IsoResize.cs
Normal file
107
Assets/IsoTools/Addons/PlayMaker/Actions/IsoResize.cs
Normal file
@@ -0,0 +1,107 @@
|
||||
#if PLAYMAKER
|
||||
using UnityEngine;
|
||||
using HutongGames.PlayMaker;
|
||||
using IsoTools.PlayMaker.Internal;
|
||||
|
||||
namespace IsoTools.PlayMaker.Actions {
|
||||
[ActionCategory("IsoTools")]
|
||||
[HutongGames.PlayMaker.Tooltip(
|
||||
"Resizes a IsoObject. " +
|
||||
"Use a Vector3 variable and/or XYZ components. " +
|
||||
"To leave any axis unchanged, set variable to 'None'.")]
|
||||
public class IsoResize : IsoComponentAction<IsoObject> {
|
||||
[RequiredField]
|
||||
[CheckForComponent(typeof(IsoObject))]
|
||||
[HutongGames.PlayMaker.Title("IsoObject (In)")]
|
||||
[HutongGames.PlayMaker.Tooltip("The IsoObject to resize.")]
|
||||
public FsmOwnerDefault gameObject;
|
||||
|
||||
[UIHint(UIHint.Variable)]
|
||||
[HutongGames.PlayMaker.Title("Vector (In)")]
|
||||
[HutongGames.PlayMaker.Tooltip(
|
||||
"Use a stored resize Vector3, " +
|
||||
"and/or set individual axis below.")]
|
||||
public FsmVector3 vector;
|
||||
|
||||
[HutongGames.PlayMaker.Title("X (In)")]
|
||||
public FsmFloat x;
|
||||
|
||||
[HutongGames.PlayMaker.Title("Y (In)")]
|
||||
public FsmFloat y;
|
||||
|
||||
[HutongGames.PlayMaker.Title("Z (In)")]
|
||||
public FsmFloat z;
|
||||
|
||||
[HutongGames.PlayMaker.Tooltip("Resize over one second")]
|
||||
public bool perSecond;
|
||||
|
||||
[HutongGames.PlayMaker.Tooltip("Repeat every frame.")]
|
||||
public bool everyFrame;
|
||||
|
||||
[HutongGames.PlayMaker.Tooltip("Perform the resize in LateUpdate.")]
|
||||
public bool lateUpdate;
|
||||
|
||||
[HutongGames.PlayMaker.Tooltip("Perform the resize in FixedUpdate.")]
|
||||
public bool fixedUpdate;
|
||||
|
||||
public override void Reset() {
|
||||
gameObject = null;
|
||||
vector = null;
|
||||
x = new FsmFloat{UseVariable = true};
|
||||
y = new FsmFloat{UseVariable = true};
|
||||
z = new FsmFloat{UseVariable = true};
|
||||
perSecond = true;
|
||||
everyFrame = true;
|
||||
lateUpdate = false;
|
||||
fixedUpdate = false;
|
||||
}
|
||||
|
||||
public override void OnPreprocess() {
|
||||
Fsm.HandleFixedUpdate = true;
|
||||
}
|
||||
|
||||
public override void OnEnter() {
|
||||
if ( !everyFrame && !lateUpdate && !fixedUpdate ) {
|
||||
DoAction();
|
||||
Finish();
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnUpdate() {
|
||||
if ( !lateUpdate && !fixedUpdate ) {
|
||||
DoAction();
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnLateUpdate() {
|
||||
if ( lateUpdate ) {
|
||||
DoAction();
|
||||
}
|
||||
if ( !everyFrame ) {
|
||||
Finish();
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnFixedUpdate() {
|
||||
if ( fixedUpdate ) {
|
||||
DoAction();
|
||||
}
|
||||
if ( !everyFrame ) {
|
||||
Finish();
|
||||
}
|
||||
}
|
||||
|
||||
void DoAction() {
|
||||
var go = Fsm.GetOwnerDefaultTarget(gameObject);
|
||||
if ( UpdateCache(go) ) {
|
||||
var value = vector.IsNone ? Vector3.zero : vector.Value;
|
||||
if ( !x.IsNone ) { value.x = x.Value; }
|
||||
if ( !y.IsNone ) { value.y = y.Value; }
|
||||
if ( !z.IsNone ) { value.z = z.Value; }
|
||||
isoObject.size +=
|
||||
perSecond ? value * Time.deltaTime : value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
12
Assets/IsoTools/Addons/PlayMaker/Actions/IsoResize.cs.meta
Normal file
12
Assets/IsoTools/Addons/PlayMaker/Actions/IsoResize.cs.meta
Normal file
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0cc9c814428694df6a2a04949e881f7b
|
||||
timeCreated: 1450019890
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
46
Assets/IsoTools/Addons/PlayMaker/Actions/IsoSetDrag.cs
Normal file
46
Assets/IsoTools/Addons/PlayMaker/Actions/IsoSetDrag.cs
Normal file
@@ -0,0 +1,46 @@
|
||||
#if PLAYMAKER
|
||||
using UnityEngine;
|
||||
using IsoTools.Physics;
|
||||
using HutongGames.PlayMaker;
|
||||
using IsoTools.PlayMaker.Internal;
|
||||
|
||||
namespace IsoTools.PlayMaker.Actions {
|
||||
[ActionCategory("IsoTools.Physics")]
|
||||
[HutongGames.PlayMaker.Tooltip(
|
||||
"Sets the Drag of a IsoRigidbody.")]
|
||||
public class IsoSetDrag : IsoComponentAction<IsoRigidbody> {
|
||||
[RequiredField]
|
||||
[CheckForComponent(typeof(IsoRigidbody))]
|
||||
public FsmOwnerDefault gameObject;
|
||||
|
||||
[RequiredField]
|
||||
public FsmFloat drag;
|
||||
|
||||
public bool everyFrame;
|
||||
|
||||
public override void Reset() {
|
||||
gameObject = null;
|
||||
drag = 1.0f;
|
||||
everyFrame = false;
|
||||
}
|
||||
|
||||
public override void OnEnter() {
|
||||
DoAction();
|
||||
if ( !everyFrame ) {
|
||||
Finish();
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnUpdate() {
|
||||
DoAction();
|
||||
}
|
||||
|
||||
void DoAction() {
|
||||
var go = Fsm.GetOwnerDefaultTarget(gameObject);
|
||||
if ( UpdateCache(go) ) {
|
||||
isoRigidbody.drag = drag.Value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
12
Assets/IsoTools/Addons/PlayMaker/Actions/IsoSetDrag.cs.meta
Normal file
12
Assets/IsoTools/Addons/PlayMaker/Actions/IsoSetDrag.cs.meta
Normal file
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7f83d153bf736469ca580e60ea2ca79c
|
||||
timeCreated: 1450621092
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,37 @@
|
||||
#if PLAYMAKER
|
||||
using UnityEngine;
|
||||
using IsoTools.Physics;
|
||||
using HutongGames.PlayMaker;
|
||||
using IsoTools.PlayMaker.Internal;
|
||||
|
||||
namespace IsoTools.PlayMaker.Actions {
|
||||
[ActionCategory("IsoTools.Physics")]
|
||||
[HutongGames.PlayMaker.Tooltip(
|
||||
"Sets the IsKinematic of a IsoRigidbody.")]
|
||||
public class IsoSetIsKinematic : IsoComponentAction<IsoRigidbody> {
|
||||
[RequiredField]
|
||||
[CheckForComponent(typeof(IsoRigidbody))]
|
||||
public FsmOwnerDefault gameObject;
|
||||
|
||||
[RequiredField]
|
||||
public FsmBool isKinematic;
|
||||
|
||||
public override void Reset() {
|
||||
gameObject = null;
|
||||
isKinematic = true;
|
||||
}
|
||||
|
||||
public override void OnEnter() {
|
||||
DoAction();
|
||||
Finish();
|
||||
}
|
||||
|
||||
void DoAction() {
|
||||
var go = Fsm.GetOwnerDefaultTarget(gameObject);
|
||||
if ( UpdateCache(go) ) {
|
||||
isoRigidbody.isKinematic = isKinematic.Value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fd8b09a582b9846e79c50485090f3fe3
|
||||
timeCreated: 1450622310
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
46
Assets/IsoTools/Addons/PlayMaker/Actions/IsoSetMass.cs
Normal file
46
Assets/IsoTools/Addons/PlayMaker/Actions/IsoSetMass.cs
Normal file
@@ -0,0 +1,46 @@
|
||||
#if PLAYMAKER
|
||||
using UnityEngine;
|
||||
using IsoTools.Physics;
|
||||
using HutongGames.PlayMaker;
|
||||
using IsoTools.PlayMaker.Internal;
|
||||
|
||||
namespace IsoTools.PlayMaker.Actions {
|
||||
[ActionCategory("IsoTools.Physics")]
|
||||
[HutongGames.PlayMaker.Tooltip(
|
||||
"Sets the Mass of a IsoRigidbody.")]
|
||||
public class IsoSetMass : IsoComponentAction<IsoRigidbody> {
|
||||
[RequiredField]
|
||||
[CheckForComponent(typeof(IsoRigidbody))]
|
||||
public FsmOwnerDefault gameObject;
|
||||
|
||||
[RequiredField]
|
||||
public FsmFloat mass;
|
||||
|
||||
public bool everyFrame;
|
||||
|
||||
public override void Reset() {
|
||||
gameObject = null;
|
||||
mass = 1.0f;
|
||||
everyFrame = false;
|
||||
}
|
||||
|
||||
public override void OnEnter() {
|
||||
DoAction();
|
||||
if ( !everyFrame ) {
|
||||
Finish();
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnUpdate() {
|
||||
DoAction();
|
||||
}
|
||||
|
||||
void DoAction() {
|
||||
var go = Fsm.GetOwnerDefaultTarget(gameObject);
|
||||
if ( UpdateCache(go) ) {
|
||||
isoRigidbody.mass = mass.Value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
12
Assets/IsoTools/Addons/PlayMaker/Actions/IsoSetMass.cs.meta
Normal file
12
Assets/IsoTools/Addons/PlayMaker/Actions/IsoSetMass.cs.meta
Normal file
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cabad94a5a31c4d3ba9c52a4929937a4
|
||||
timeCreated: 1450621064
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
94
Assets/IsoTools/Addons/PlayMaker/Actions/IsoSetPosition.cs
Normal file
94
Assets/IsoTools/Addons/PlayMaker/Actions/IsoSetPosition.cs
Normal file
@@ -0,0 +1,94 @@
|
||||
#if PLAYMAKER
|
||||
using UnityEngine;
|
||||
using HutongGames.PlayMaker;
|
||||
using IsoTools.PlayMaker.Internal;
|
||||
|
||||
namespace IsoTools.PlayMaker.Actions {
|
||||
[ActionCategory("IsoTools")]
|
||||
[HutongGames.PlayMaker.Tooltip(
|
||||
"Sets the Position of a IsoObject. " +
|
||||
"To leave any axis unchanged, set variable to 'None'.")]
|
||||
public class IsoSetPosition : IsoComponentAction<IsoObject> {
|
||||
[RequiredField]
|
||||
[CheckForComponent(typeof(IsoObject))]
|
||||
[HutongGames.PlayMaker.Tooltip("The IsoObject to position.")]
|
||||
public FsmOwnerDefault gameObject;
|
||||
|
||||
[UIHint(UIHint.Variable)]
|
||||
[HutongGames.PlayMaker.Tooltip(
|
||||
"Use a stored Vector3 position, " +
|
||||
"and/or set individual axis below.")]
|
||||
public FsmVector3 vector;
|
||||
|
||||
public FsmFloat x;
|
||||
public FsmFloat y;
|
||||
public FsmFloat z;
|
||||
|
||||
[HutongGames.PlayMaker.Tooltip("Repeat every frame.")]
|
||||
public bool everyFrame;
|
||||
|
||||
[HutongGames.PlayMaker.Tooltip("Perform in LateUpdate.")]
|
||||
public bool lateUpdate;
|
||||
|
||||
[HutongGames.PlayMaker.Tooltip("Perform in FixedUpdate.")]
|
||||
public bool fixedUpdate;
|
||||
|
||||
public override void Reset() {
|
||||
gameObject = null;
|
||||
vector = null;
|
||||
x = new FsmFloat{UseVariable = true};
|
||||
y = new FsmFloat{UseVariable = true};
|
||||
z = new FsmFloat{UseVariable = true};
|
||||
everyFrame = false;
|
||||
lateUpdate = false;
|
||||
fixedUpdate = false;
|
||||
}
|
||||
|
||||
public override void OnPreprocess() {
|
||||
Fsm.HandleFixedUpdate = true;
|
||||
}
|
||||
|
||||
public override void OnEnter() {
|
||||
if ( !everyFrame && !lateUpdate && !fixedUpdate ) {
|
||||
DoAction();
|
||||
Finish();
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnUpdate() {
|
||||
if ( !lateUpdate && !fixedUpdate ) {
|
||||
DoAction();
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnLateUpdate() {
|
||||
if ( lateUpdate ) {
|
||||
DoAction();
|
||||
}
|
||||
if ( !everyFrame ) {
|
||||
Finish();
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnFixedUpdate() {
|
||||
if ( fixedUpdate ) {
|
||||
DoAction();
|
||||
}
|
||||
if ( !everyFrame ) {
|
||||
Finish();
|
||||
}
|
||||
}
|
||||
|
||||
void DoAction() {
|
||||
var go = Fsm.GetOwnerDefaultTarget(gameObject);
|
||||
if ( UpdateCache(go) ) {
|
||||
var value = vector.IsNone ? isoObject.position : vector.Value;
|
||||
if ( !x.IsNone ) { value.x = x.Value; }
|
||||
if ( !y.IsNone ) { value.y = y.Value; }
|
||||
if ( !z.IsNone ) { value.z = z.Value; }
|
||||
isoObject.position = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f97bd76983db64be3adc438575153e6e
|
||||
timeCreated: 1450001531
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,39 @@
|
||||
#if PLAYMAKER
|
||||
using UnityEngine;
|
||||
using HutongGames.PlayMaker;
|
||||
using IsoTools.PlayMaker.Internal;
|
||||
|
||||
namespace IsoTools.PlayMaker.Actions {
|
||||
[ActionCategory("IsoTools")]
|
||||
[HutongGames.PlayMaker.Tooltip(
|
||||
"Sets the Renderers Mode of a IsoObject.")]
|
||||
public class IsoSetMode : IsoComponentAction<IsoObject> {
|
||||
[RequiredField]
|
||||
[CheckForComponent(typeof(IsoObject))]
|
||||
[HutongGames.PlayMaker.Title("IsoObject (In)")]
|
||||
public FsmOwnerDefault gameObject;
|
||||
|
||||
[RequiredField]
|
||||
[ObjectType(typeof(IsoObject.RenderersMode))]
|
||||
[HutongGames.PlayMaker.Title("Renderers Mode (In)")]
|
||||
public FsmEnum renderersMode;
|
||||
|
||||
public override void Reset() {
|
||||
gameObject = null;
|
||||
renderersMode = IsoObject.RenderersMode.Mode2d;
|
||||
}
|
||||
|
||||
public override void OnEnter() {
|
||||
DoAction();
|
||||
Finish();
|
||||
}
|
||||
|
||||
void DoAction() {
|
||||
var go = Fsm.GetOwnerDefaultTarget(gameObject);
|
||||
if ( UpdateCache(go) ) {
|
||||
isoObject.renderersMode = (IsoObject.RenderersMode)renderersMode.Value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 600989817e43d430a96dfdbbba8dde76
|
||||
timeCreated: 1450019570
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user