mirror of
https://github.com/BlackMATov/unity-iso-tools.git
synced 2025-12-14 17:09:31 +07:00
physics wip
This commit is contained in:
@@ -48,6 +48,7 @@
|
||||
<ItemGroup>
|
||||
<Compile Include="Assets\IsoTools\Editor\IsoAlignmentWindow.cs" />
|
||||
<Compile Include="Assets\IsoTools\Editor\IsoObjectEditor.cs" />
|
||||
<Compile Include="Assets\IsoTools\Editor\IsoRigidbodyEditor.cs" />
|
||||
<Reference Include="UnityEngine.UI">
|
||||
<HintPath>/Applications/Unity/Unity.app/Contents/UnityExtensions/Unity/GUISystem/UnityEngine.UI.dll</HintPath>
|
||||
</Reference>
|
||||
|
||||
@@ -48,6 +48,7 @@
|
||||
<ItemGroup>
|
||||
<Compile Include="Assets\IsoTools\Editor\IsoAlignmentWindow.cs" />
|
||||
<Compile Include="Assets\IsoTools\Editor\IsoObjectEditor.cs" />
|
||||
<Compile Include="Assets\IsoTools\Editor\IsoRigidbodyEditor.cs" />
|
||||
<Reference Include="UnityEngine.UI">
|
||||
<HintPath>/Applications/Unity/Unity.app/Contents/UnityExtensions/Unity/GUISystem/UnityEngine.UI.dll</HintPath>
|
||||
</Reference>
|
||||
|
||||
@@ -50,6 +50,7 @@
|
||||
<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\IsoRigidbody.cs" />
|
||||
<Compile Include="Assets\IsoTools\Scripts\IsoUtils.cs" />
|
||||
<Compile Include="Assets\IsoTools\Scripts\IsoWorld.cs" />
|
||||
<Reference Include="UnityEngine.UI">
|
||||
|
||||
@@ -50,6 +50,7 @@
|
||||
<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\IsoRigidbody.cs" />
|
||||
<Compile Include="Assets\IsoTools\Scripts\IsoUtils.cs" />
|
||||
<Compile Include="Assets\IsoTools\Scripts\IsoWorld.cs" />
|
||||
<Reference Include="UnityEngine.UI">
|
||||
|
||||
@@ -24,10 +24,6 @@ namespace IsoTools {
|
||||
window.Show();
|
||||
}
|
||||
|
||||
static IsoAlignmentWindow() {
|
||||
Alignment = true;
|
||||
}
|
||||
|
||||
void OnGUI() {
|
||||
GUILayout.Space(5);
|
||||
Alignment = EditorGUILayout.Toggle("Auto alignment", Alignment);
|
||||
|
||||
@@ -83,7 +83,11 @@ namespace IsoTools {
|
||||
}
|
||||
|
||||
void XYMoveRectangle() {
|
||||
Handles.color = IsoUtils.ColorChangeA(Handles.zAxisColor, 0.3f);
|
||||
Handles.color = new Color(
|
||||
Handles.zAxisColor.r,
|
||||
Handles.zAxisColor.g,
|
||||
Handles.zAxisColor.b,
|
||||
0.3f);
|
||||
Handles.DotCap(
|
||||
0,
|
||||
_viewCenter,
|
||||
|
||||
49
Assets/IsoTools/Editor/IsoRigidbodyEditor.cs
Normal file
49
Assets/IsoTools/Editor/IsoRigidbodyEditor.cs
Normal file
@@ -0,0 +1,49 @@
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace IsoTools {
|
||||
[CustomEditor(typeof(IsoRigidbody)), CanEditMultipleObjects]
|
||||
class IsoRigidbodyEditor : Editor {
|
||||
void DrawTop(Vector3 pos, Vector3 size) {
|
||||
var iso_world = GameObject.FindObjectOfType<IsoWorld>();
|
||||
if ( iso_world ) {
|
||||
var points = new Vector3[]{
|
||||
iso_world.IsoToScreen(pos),
|
||||
iso_world.IsoToScreen(pos + IsoUtils.Vec3FromX(size.x)),
|
||||
iso_world.IsoToScreen(pos + IsoUtils.Vec3FromXY(size.x, size.y)),
|
||||
iso_world.IsoToScreen(pos + IsoUtils.Vec3FromY(size.y)),
|
||||
iso_world.IsoToScreen(pos)
|
||||
};
|
||||
Handles.DrawPolyLine(points);
|
||||
}
|
||||
}
|
||||
|
||||
void DrawVert(Vector3 pos, Vector3 size) {
|
||||
var iso_world = GameObject.FindObjectOfType<IsoWorld>();
|
||||
if ( iso_world ) {
|
||||
Handles.DrawLine(
|
||||
iso_world.IsoToScreen(pos),
|
||||
iso_world.IsoToScreen(pos + IsoUtils.Vec3FromZ(size.z)));
|
||||
}
|
||||
}
|
||||
|
||||
void DrawCube(Vector3 pos, Vector3 size) {
|
||||
Handles.color = Color.green;
|
||||
DrawTop (pos - IsoUtils.Vec3FromZ(0.5f), size);
|
||||
DrawTop (pos + IsoUtils.Vec3FromZ(size.z - 0.5f), size);
|
||||
DrawVert(pos - IsoUtils.Vec3FromZ(0.5f), size);
|
||||
DrawVert(pos - IsoUtils.Vec3FromZ(0.5f) + IsoUtils.Vec3FromX(size.x), size);
|
||||
DrawVert(pos - IsoUtils.Vec3FromZ(0.5f) + IsoUtils.Vec3FromY(size.y), size);
|
||||
}
|
||||
|
||||
void OnSceneGUI() {
|
||||
var iso_rigidbody = target as IsoRigidbody;
|
||||
var iso_object = iso_rigidbody.GetComponent<IsoObject>();
|
||||
if ( iso_object ) {
|
||||
DrawCube(iso_object.Position, iso_object.Size);
|
||||
}
|
||||
}
|
||||
}
|
||||
} // namespace IsoTools
|
||||
12
Assets/IsoTools/Editor/IsoRigidbodyEditor.cs.meta
Normal file
12
Assets/IsoTools/Editor/IsoRigidbodyEditor.cs.meta
Normal file
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 80c086762f3ba4f369819009dd52e46f
|
||||
timeCreated: 1431880115
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,16 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!134 &13400000
|
||||
PhysicMaterial:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_Name: BoxPhysicMaterial
|
||||
dynamicFriction: .600000024
|
||||
staticFriction: .600000024
|
||||
bounciness: .400000006
|
||||
frictionCombine: 0
|
||||
bounceCombine: 0
|
||||
frictionDirection2: {x: 0, y: 0, z: 0}
|
||||
dynamicFriction2: 0
|
||||
staticFriction2: 0
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 867b8c31d245f45d482bfe52123a0c6d
|
||||
timeCreated: 1431888298
|
||||
licenseType: Free
|
||||
NativeFormatImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -10,6 +10,7 @@ GameObject:
|
||||
- 4: {fileID: 417528}
|
||||
- 212: {fileID: 21217528}
|
||||
- 114: {fileID: 11417528}
|
||||
- 114: {fileID: 11422542}
|
||||
m_Layer: 0
|
||||
m_Name: Cube_1x1x1
|
||||
m_TagString: Untagged
|
||||
@@ -42,7 +43,20 @@ MonoBehaviour:
|
||||
m_EditorClassIdentifier:
|
||||
_position: {x: 0, y: 0, z: 0}
|
||||
_size: {x: 1, y: 1, z: 1}
|
||||
_alignment: 1
|
||||
--- !u!114 &11422542
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 1
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
m_GameObject: {fileID: 117528}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: b6f23cf97dc1d49d89a2556193c4f2e2, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
IsStatic: 0
|
||||
IsTrigger: 0
|
||||
PhysicMaterial: {fileID: 13400000, guid: 867b8c31d245f45d482bfe52123a0c6d, type: 2}
|
||||
--- !u!212 &21217528
|
||||
SpriteRenderer:
|
||||
m_ObjectHideFlags: 1
|
||||
@@ -52,15 +66,19 @@ SpriteRenderer:
|
||||
m_Enabled: 1
|
||||
m_CastShadows: 0
|
||||
m_ReceiveShadows: 0
|
||||
m_LightmapIndex: 255
|
||||
m_LightmapTilingOffset: {x: 1, y: 1, z: 0, w: 0}
|
||||
m_Materials:
|
||||
- {fileID: 10754, guid: 0000000000000000e000000000000000, type: 0}
|
||||
m_SubsetIndices:
|
||||
m_StaticBatchRoot: {fileID: 0}
|
||||
m_UseLightProbes: 0
|
||||
m_LightProbeAnchor: {fileID: 0}
|
||||
m_ReflectionProbeUsage: 1
|
||||
m_ProbeAnchor: {fileID: 0}
|
||||
m_ScaleInLightmap: 1
|
||||
m_PreserveUVs: 0
|
||||
m_ImportantGI: 0
|
||||
m_AutoUVMaxDistance: .5
|
||||
m_AutoUVMaxAngle: 89
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_SortingLayerID: 0
|
||||
m_SortingOrder: 0
|
||||
m_Sprite: {fileID: 21300000, guid: dda1716486a64604ba1c99ad9655eeb2, type: 3}
|
||||
@@ -76,4 +94,3 @@ Prefab:
|
||||
m_ParentPrefab: {fileID: 0}
|
||||
m_RootGameObject: {fileID: 117528}
|
||||
m_IsPrefabParent: 1
|
||||
m_IsExploded: 1
|
||||
|
||||
@@ -10,6 +10,7 @@ GameObject:
|
||||
- 4: {fileID: 453620}
|
||||
- 212: {fileID: 21253620}
|
||||
- 114: {fileID: 11453620}
|
||||
- 114: {fileID: 11416990}
|
||||
m_Layer: 0
|
||||
m_Name: Cube_1x3x1
|
||||
m_TagString: Untagged
|
||||
@@ -29,6 +30,20 @@ Transform:
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
--- !u!114 &11416990
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 1
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
m_GameObject: {fileID: 153620}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: b6f23cf97dc1d49d89a2556193c4f2e2, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
IsStatic: 0
|
||||
IsTrigger: 0
|
||||
PhysicMaterial: {fileID: 13400000, guid: 867b8c31d245f45d482bfe52123a0c6d, type: 2}
|
||||
--- !u!114 &11453620
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 1
|
||||
@@ -42,7 +57,6 @@ MonoBehaviour:
|
||||
m_EditorClassIdentifier:
|
||||
_position: {x: 0, y: 0, z: 0}
|
||||
_size: {x: 1, y: 3, z: 1}
|
||||
_alignment: 1
|
||||
--- !u!212 &21253620
|
||||
SpriteRenderer:
|
||||
m_ObjectHideFlags: 1
|
||||
@@ -52,17 +66,21 @@ SpriteRenderer:
|
||||
m_Enabled: 1
|
||||
m_CastShadows: 0
|
||||
m_ReceiveShadows: 0
|
||||
m_LightmapIndex: 255
|
||||
m_LightmapTilingOffset: {x: 1, y: 1, z: 0, w: 0}
|
||||
m_Materials:
|
||||
- {fileID: 10754, guid: 0000000000000000e000000000000000, type: 0}
|
||||
m_SubsetIndices:
|
||||
m_StaticBatchRoot: {fileID: 0}
|
||||
m_UseLightProbes: 0
|
||||
m_LightProbeAnchor: {fileID: 0}
|
||||
m_ReflectionProbeUsage: 1
|
||||
m_ProbeAnchor: {fileID: 0}
|
||||
m_ScaleInLightmap: 1
|
||||
m_PreserveUVs: 0
|
||||
m_ImportantGI: 0
|
||||
m_AutoUVMaxDistance: .5
|
||||
m_AutoUVMaxAngle: 89
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_SortingLayerID: 0
|
||||
m_SortingOrder: 0
|
||||
m_SortingOrder: -3
|
||||
m_Sprite: {fileID: 21300000, guid: 134a5af3424cf9f45b3c527e6d44d71b, type: 3}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
--- !u!1001 &100100000
|
||||
@@ -76,4 +94,3 @@ Prefab:
|
||||
m_ParentPrefab: {fileID: 0}
|
||||
m_RootGameObject: {fileID: 153620}
|
||||
m_IsPrefabParent: 1
|
||||
m_IsExploded: 1
|
||||
|
||||
@@ -10,6 +10,7 @@ GameObject:
|
||||
- 4: {fileID: 462204}
|
||||
- 212: {fileID: 21262204}
|
||||
- 114: {fileID: 11462204}
|
||||
- 114: {fileID: 11483544}
|
||||
m_Layer: 0
|
||||
m_Name: Cube_3x1x1
|
||||
m_TagString: Untagged
|
||||
@@ -40,9 +41,24 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: 9a9c584f9a39449438abc7ba59a68778, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
_position: {x: -0, y: -0, z: 0}
|
||||
_position: {x: 0, y: 0, z: 0}
|
||||
_size: {x: 3, y: 1, z: 1}
|
||||
_alignment: 1
|
||||
--- !u!114 &11483544
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 1
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
m_GameObject: {fileID: 162204}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: b6f23cf97dc1d49d89a2556193c4f2e2, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
IsTrigger: 0
|
||||
IsKinematic: 1
|
||||
Interpolation: 0
|
||||
CollisionMode: 0
|
||||
PhysicMaterial: {fileID: 13400000, guid: 867b8c31d245f45d482bfe52123a0c6d, type: 2}
|
||||
--- !u!212 &21262204
|
||||
SpriteRenderer:
|
||||
m_ObjectHideFlags: 1
|
||||
@@ -52,15 +68,19 @@ SpriteRenderer:
|
||||
m_Enabled: 1
|
||||
m_CastShadows: 0
|
||||
m_ReceiveShadows: 0
|
||||
m_LightmapIndex: 255
|
||||
m_LightmapTilingOffset: {x: 1, y: 1, z: 0, w: 0}
|
||||
m_Materials:
|
||||
- {fileID: 10754, guid: 0000000000000000e000000000000000, type: 0}
|
||||
m_SubsetIndices:
|
||||
m_StaticBatchRoot: {fileID: 0}
|
||||
m_UseLightProbes: 0
|
||||
m_LightProbeAnchor: {fileID: 0}
|
||||
m_ReflectionProbeUsage: 1
|
||||
m_ProbeAnchor: {fileID: 0}
|
||||
m_ScaleInLightmap: 1
|
||||
m_PreserveUVs: 0
|
||||
m_ImportantGI: 0
|
||||
m_AutoUVMaxDistance: .5
|
||||
m_AutoUVMaxAngle: 89
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_SortingLayerID: 0
|
||||
m_SortingOrder: 0
|
||||
m_Sprite: {fileID: 21300000, guid: 3459d1c3ed403234288c562aeede56d0, type: 3}
|
||||
@@ -76,4 +96,3 @@ Prefab:
|
||||
m_ParentPrefab: {fileID: 0}
|
||||
m_RootGameObject: {fileID: 162204}
|
||||
m_IsPrefabParent: 1
|
||||
m_IsExploded: 1
|
||||
|
||||
@@ -10,6 +10,7 @@ GameObject:
|
||||
- 4: {fileID: 453404}
|
||||
- 212: {fileID: 21253404}
|
||||
- 114: {fileID: 11453404}
|
||||
- 114: {fileID: 11462190}
|
||||
m_Layer: 0
|
||||
m_Name: Floor_3x3
|
||||
m_TagString: Untagged
|
||||
@@ -42,7 +43,22 @@ MonoBehaviour:
|
||||
m_EditorClassIdentifier:
|
||||
_position: {x: 0, y: 0, z: 0}
|
||||
_size: {x: 3, y: 3, z: 0}
|
||||
_alignment: 1
|
||||
--- !u!114 &11462190
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 1
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
m_GameObject: {fileID: 153404}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: b6f23cf97dc1d49d89a2556193c4f2e2, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
IsTrigger: 0
|
||||
IsKinematic: 1
|
||||
Interpolation: 0
|
||||
CollisionMode: 0
|
||||
PhysicMaterial: {fileID: 13400000, guid: 867b8c31d245f45d482bfe52123a0c6d, type: 2}
|
||||
--- !u!212 &21253404
|
||||
SpriteRenderer:
|
||||
m_ObjectHideFlags: 1
|
||||
@@ -52,15 +68,19 @@ SpriteRenderer:
|
||||
m_Enabled: 1
|
||||
m_CastShadows: 0
|
||||
m_ReceiveShadows: 0
|
||||
m_LightmapIndex: 255
|
||||
m_LightmapTilingOffset: {x: 1, y: 1, z: 0, w: 0}
|
||||
m_Materials:
|
||||
- {fileID: 10754, guid: 0000000000000000e000000000000000, type: 0}
|
||||
m_SubsetIndices:
|
||||
m_StaticBatchRoot: {fileID: 0}
|
||||
m_UseLightProbes: 0
|
||||
m_LightProbeAnchor: {fileID: 0}
|
||||
m_ReflectionProbeUsage: 1
|
||||
m_ProbeAnchor: {fileID: 0}
|
||||
m_ScaleInLightmap: 1
|
||||
m_PreserveUVs: 0
|
||||
m_ImportantGI: 0
|
||||
m_AutoUVMaxDistance: .5
|
||||
m_AutoUVMaxAngle: 89
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_SortingLayerID: 0
|
||||
m_SortingOrder: 0
|
||||
m_Sprite: {fileID: 21300000, guid: 03252686d19205e4d8a6ef5127d6f46d, type: 3}
|
||||
@@ -76,4 +96,3 @@ Prefab:
|
||||
m_ParentPrefab: {fileID: 0}
|
||||
m_RootGameObject: {fileID: 153404}
|
||||
m_IsPrefabParent: 1
|
||||
m_IsExploded: 1
|
||||
|
||||
@@ -87,64 +87,6 @@ NavMeshSettings:
|
||||
cellSize: .166666672
|
||||
manualCellSize: 0
|
||||
m_NavMeshData: {fileID: 0}
|
||||
--- !u!1001 &274776129
|
||||
Prefab:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_Modification:
|
||||
m_TransformParent: {fileID: 0}
|
||||
m_Modifications:
|
||||
- target: {fileID: 453404, guid: d10e5320df9f84d4186bda0ba98db9ff, type: 2}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 453404, guid: d10e5320df9f84d4186bda0ba98db9ff, type: 2}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: 16
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 453404, guid: d10e5320df9f84d4186bda0ba98db9ff, type: 2}
|
||||
propertyPath: m_LocalPosition.z
|
||||
value: 14.2857141
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 453404, guid: d10e5320df9f84d4186bda0ba98db9ff, type: 2}
|
||||
propertyPath: m_LocalRotation.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 453404, guid: d10e5320df9f84d4186bda0ba98db9ff, type: 2}
|
||||
propertyPath: m_LocalRotation.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 453404, guid: d10e5320df9f84d4186bda0ba98db9ff, type: 2}
|
||||
propertyPath: m_LocalRotation.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 453404, guid: d10e5320df9f84d4186bda0ba98db9ff, type: 2}
|
||||
propertyPath: m_LocalRotation.w
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 453404, guid: d10e5320df9f84d4186bda0ba98db9ff, type: 2}
|
||||
propertyPath: m_RootOrder
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 11453404, guid: d10e5320df9f84d4186bda0ba98db9ff, type: 2}
|
||||
propertyPath: _position.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 11453404, guid: d10e5320df9f84d4186bda0ba98db9ff, type: 2}
|
||||
propertyPath: _position.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 153404, guid: d10e5320df9f84d4186bda0ba98db9ff, type: 2}
|
||||
propertyPath: m_Name
|
||||
value: Floor_3x4
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 11453404, guid: d10e5320df9f84d4186bda0ba98db9ff, type: 2}
|
||||
propertyPath: _position.z
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_ParentPrefab: {fileID: 100100000, guid: d10e5320df9f84d4186bda0ba98db9ff, type: 2}
|
||||
m_IsPrefabParent: 0
|
||||
--- !u!1 &318480492
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -225,11 +167,11 @@ Transform:
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 318480492}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: -10}
|
||||
m_LocalPosition: {x: 0, y: 53.7000008, z: -10}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 7
|
||||
m_RootOrder: 5
|
||||
--- !u!114 &318480498
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -242,9 +184,7 @@ MonoBehaviour:
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
_tileSize: 16
|
||||
_minDepth: 0
|
||||
_maxDepth: 100
|
||||
--- !u!1001 &375090642
|
||||
--- !u!1001 &485514980
|
||||
Prefab:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
@@ -253,15 +193,15 @@ Prefab:
|
||||
m_Modifications:
|
||||
- target: {fileID: 417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: -32
|
||||
value: -48
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: 16
|
||||
value: 72
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||
propertyPath: m_LocalPosition.z
|
||||
value: 57.1428566
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||
propertyPath: m_LocalRotation.x
|
||||
@@ -285,310 +225,252 @@ Prefab:
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 11417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||
propertyPath: _position.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 11417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||
propertyPath: _position.y
|
||||
value: 2
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 117528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||
propertyPath: m_Name
|
||||
value: Cube_1x1x3
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 11417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||
propertyPath: _alignment
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 11417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||
propertyPath: _position.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_ParentPrefab: {fileID: 100100000, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||
m_IsPrefabParent: 0
|
||||
--- !u!1001 &409886624
|
||||
Prefab:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_Modification:
|
||||
m_TransformParent: {fileID: 0}
|
||||
m_Modifications:
|
||||
- target: {fileID: 417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: 32
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||
propertyPath: m_LocalPosition.z
|
||||
value: 71.4285736
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||
propertyPath: m_LocalRotation.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||
propertyPath: m_LocalRotation.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||
propertyPath: m_LocalRotation.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||
propertyPath: m_LocalRotation.w
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||
propertyPath: m_RootOrder
|
||||
value: 3
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 11417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||
propertyPath: _position.x
|
||||
value: 2
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 11417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||
propertyPath: _position.y
|
||||
value: 2
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 11417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||
propertyPath: _alignment
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 117528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||
propertyPath: m_Name
|
||||
value: Cube_1x1x4
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 11417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||
propertyPath: _position.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_ParentPrefab: {fileID: 100100000, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||
m_IsPrefabParent: 0
|
||||
--- !u!1001 &1197576131
|
||||
Prefab:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_Modification:
|
||||
m_TransformParent: {fileID: 0}
|
||||
m_Modifications:
|
||||
- target: {fileID: 417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: 16
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||
propertyPath: m_LocalPosition.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||
propertyPath: m_LocalRotation.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||
propertyPath: m_LocalRotation.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||
propertyPath: m_LocalRotation.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||
propertyPath: m_LocalRotation.w
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||
propertyPath: m_RootOrder
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 117528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||
propertyPath: m_Name
|
||||
value: Cube_1x1x5
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 11417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||
propertyPath: _position.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 11417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||
propertyPath: _position.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 11417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||
propertyPath: _position.z
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_ParentPrefab: {fileID: 100100000, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||
m_IsPrefabParent: 0
|
||||
--- !u!1001 &1454547313
|
||||
Prefab:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_Modification:
|
||||
m_TransformParent: {fileID: 0}
|
||||
m_Modifications:
|
||||
- target: {fileID: 417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||
propertyPath: m_LocalPosition.z
|
||||
value: 28.5714283
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||
propertyPath: m_LocalRotation.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||
propertyPath: m_LocalRotation.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||
propertyPath: m_LocalRotation.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||
propertyPath: m_LocalRotation.w
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||
propertyPath: m_RootOrder
|
||||
value: 5
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 117528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||
propertyPath: m_Name
|
||||
value: Cube_1x1x2
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 11417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||
propertyPath: _position.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 11417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||
propertyPath: _position.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 11417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||
propertyPath: _position.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_ParentPrefab: {fileID: 100100000, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||
m_IsPrefabParent: 0
|
||||
--- !u!1001 &1818595414
|
||||
Prefab:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_Modification:
|
||||
m_TransformParent: {fileID: 0}
|
||||
m_Modifications:
|
||||
- target: {fileID: 417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: 32
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: 16
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||
propertyPath: m_LocalPosition.z
|
||||
value: 42.8571434
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||
propertyPath: m_LocalRotation.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||
propertyPath: m_LocalRotation.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||
propertyPath: m_LocalRotation.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||
propertyPath: m_LocalRotation.w
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||
propertyPath: m_RootOrder
|
||||
value: 6
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 11417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||
propertyPath: _position.x
|
||||
value: 2
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 11417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||
propertyPath: _position.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 11417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||
propertyPath: _alignment
|
||||
- target: {fileID: 11422542, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||
propertyPath: IsKinematic
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 11417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||
propertyPath: _position.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_ParentPrefab: {fileID: 100100000, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||
m_IsPrefabParent: 0
|
||||
--- !u!1001 &2146784705
|
||||
--- !u!1001 &645158917
|
||||
Prefab:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_Modification:
|
||||
m_TransformParent: {fileID: 0}
|
||||
m_Modifications:
|
||||
- target: {fileID: 453404, guid: d10e5320df9f84d4186bda0ba98db9ff, type: 2}
|
||||
- target: {fileID: 453620, guid: dbd21aa1b9a2cdf4a944f50e64d145a1, type: 2}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 453404, guid: d10e5320df9f84d4186bda0ba98db9ff, type: 2}
|
||||
- target: {fileID: 453620, guid: dbd21aa1b9a2cdf4a944f50e64d145a1, type: 2}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 453404, guid: d10e5320df9f84d4186bda0ba98db9ff, type: 2}
|
||||
- target: {fileID: 453620, guid: dbd21aa1b9a2cdf4a944f50e64d145a1, type: 2}
|
||||
propertyPath: m_LocalPosition.z
|
||||
value: 85.7142868
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 453404, guid: d10e5320df9f84d4186bda0ba98db9ff, type: 2}
|
||||
- target: {fileID: 453620, guid: dbd21aa1b9a2cdf4a944f50e64d145a1, type: 2}
|
||||
propertyPath: m_LocalRotation.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 453404, guid: d10e5320df9f84d4186bda0ba98db9ff, type: 2}
|
||||
- target: {fileID: 453620, guid: dbd21aa1b9a2cdf4a944f50e64d145a1, type: 2}
|
||||
propertyPath: m_LocalRotation.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 453404, guid: d10e5320df9f84d4186bda0ba98db9ff, type: 2}
|
||||
- target: {fileID: 453620, guid: dbd21aa1b9a2cdf4a944f50e64d145a1, type: 2}
|
||||
propertyPath: m_LocalRotation.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 453404, guid: d10e5320df9f84d4186bda0ba98db9ff, type: 2}
|
||||
- target: {fileID: 453620, guid: dbd21aa1b9a2cdf4a944f50e64d145a1, type: 2}
|
||||
propertyPath: m_LocalRotation.w
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 453404, guid: d10e5320df9f84d4186bda0ba98db9ff, type: 2}
|
||||
- target: {fileID: 453620, guid: dbd21aa1b9a2cdf4a944f50e64d145a1, type: 2}
|
||||
propertyPath: m_RootOrder
|
||||
value: 2
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 11453404, guid: d10e5320df9f84d4186bda0ba98db9ff, type: 2}
|
||||
- target: {fileID: 11453620, guid: dbd21aa1b9a2cdf4a944f50e64d145a1, type: 2}
|
||||
propertyPath: _position.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 11453404, guid: d10e5320df9f84d4186bda0ba98db9ff, type: 2}
|
||||
- target: {fileID: 11453620, guid: dbd21aa1b9a2cdf4a944f50e64d145a1, type: 2}
|
||||
propertyPath: _position.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 11416990, guid: dbd21aa1b9a2cdf4a944f50e64d145a1, type: 2}
|
||||
propertyPath: IsKinematic
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 153620, guid: dbd21aa1b9a2cdf4a944f50e64d145a1, type: 2}
|
||||
propertyPath: m_Name
|
||||
value: Cube_1x3x2
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 21253620, guid: dbd21aa1b9a2cdf4a944f50e64d145a1, type: 2}
|
||||
propertyPath: m_SortingOrder
|
||||
value: -2
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_ParentPrefab: {fileID: 100100000, guid: d10e5320df9f84d4186bda0ba98db9ff, type: 2}
|
||||
m_ParentPrefab: {fileID: 100100000, guid: dbd21aa1b9a2cdf4a944f50e64d145a1, type: 2}
|
||||
m_IsPrefabParent: 0
|
||||
--- !u!1001 &1506134427
|
||||
Prefab:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_Modification:
|
||||
m_TransformParent: {fileID: 0}
|
||||
m_Modifications:
|
||||
- target: {fileID: 462204, guid: fb3806e9ed7ada045b1b57419ac1ee53, type: 2}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: .841789246
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 462204, guid: fb3806e9ed7ada045b1b57419ac1ee53, type: 2}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: -10.5253239
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 462204, guid: fb3806e9ed7ada045b1b57419ac1ee53, type: 2}
|
||||
propertyPath: m_LocalPosition.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 462204, guid: fb3806e9ed7ada045b1b57419ac1ee53, type: 2}
|
||||
propertyPath: m_LocalRotation.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 462204, guid: fb3806e9ed7ada045b1b57419ac1ee53, type: 2}
|
||||
propertyPath: m_LocalRotation.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 462204, guid: fb3806e9ed7ada045b1b57419ac1ee53, type: 2}
|
||||
propertyPath: m_LocalRotation.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 462204, guid: fb3806e9ed7ada045b1b57419ac1ee53, type: 2}
|
||||
propertyPath: m_LocalRotation.w
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 462204, guid: fb3806e9ed7ada045b1b57419ac1ee53, type: 2}
|
||||
propertyPath: m_RootOrder
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 11462204, guid: fb3806e9ed7ada045b1b57419ac1ee53, type: 2}
|
||||
propertyPath: _position.x
|
||||
value: -.605221629
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 11462204, guid: fb3806e9ed7ada045b1b57419ac1ee53, type: 2}
|
||||
propertyPath: _position.y
|
||||
value: -.657833457
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 11462204, guid: fb3806e9ed7ada045b1b57419ac1ee53, type: 2}
|
||||
propertyPath: _position.z
|
||||
value: -.0263051987
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 162204, guid: fb3806e9ed7ada045b1b57419ac1ee53, type: 2}
|
||||
propertyPath: m_Name
|
||||
value: Cube_3x1x3
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 21262204, guid: fb3806e9ed7ada045b1b57419ac1ee53, type: 2}
|
||||
propertyPath: m_SortingOrder
|
||||
value: 2
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_ParentPrefab: {fileID: 100100000, guid: fb3806e9ed7ada045b1b57419ac1ee53, type: 2}
|
||||
m_IsPrefabParent: 0
|
||||
--- !u!1001 &1517863249
|
||||
Prefab:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_Modification:
|
||||
m_TransformParent: {fileID: 0}
|
||||
m_Modifications:
|
||||
- target: {fileID: 453620, guid: dbd21aa1b9a2cdf4a944f50e64d145a1, type: 2}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 453620, guid: dbd21aa1b9a2cdf4a944f50e64d145a1, type: 2}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: 64
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 453620, guid: dbd21aa1b9a2cdf4a944f50e64d145a1, type: 2}
|
||||
propertyPath: m_LocalPosition.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 453620, guid: dbd21aa1b9a2cdf4a944f50e64d145a1, type: 2}
|
||||
propertyPath: m_LocalRotation.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 453620, guid: dbd21aa1b9a2cdf4a944f50e64d145a1, type: 2}
|
||||
propertyPath: m_LocalRotation.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 453620, guid: dbd21aa1b9a2cdf4a944f50e64d145a1, type: 2}
|
||||
propertyPath: m_LocalRotation.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 453620, guid: dbd21aa1b9a2cdf4a944f50e64d145a1, type: 2}
|
||||
propertyPath: m_LocalRotation.w
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 453620, guid: dbd21aa1b9a2cdf4a944f50e64d145a1, type: 2}
|
||||
propertyPath: m_RootOrder
|
||||
value: 7
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 11453620, guid: dbd21aa1b9a2cdf4a944f50e64d145a1, type: 2}
|
||||
propertyPath: _position.x
|
||||
value: 4
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 11453620, guid: dbd21aa1b9a2cdf4a944f50e64d145a1, type: 2}
|
||||
propertyPath: _position.y
|
||||
value: 4
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 11416990, guid: dbd21aa1b9a2cdf4a944f50e64d145a1, type: 2}
|
||||
propertyPath: IsKinematic
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_ParentPrefab: {fileID: 100100000, guid: dbd21aa1b9a2cdf4a944f50e64d145a1, type: 2}
|
||||
m_IsPrefabParent: 0
|
||||
--- !u!1001 &1919115803
|
||||
Prefab:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_Modification:
|
||||
m_TransformParent: {fileID: 0}
|
||||
m_Modifications:
|
||||
- target: {fileID: 462204, guid: fb3806e9ed7ada045b1b57419ac1ee53, type: 2}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: -80
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 462204, guid: fb3806e9ed7ada045b1b57419ac1ee53, type: 2}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: 72
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 462204, guid: fb3806e9ed7ada045b1b57419ac1ee53, type: 2}
|
||||
propertyPath: m_LocalPosition.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 462204, guid: fb3806e9ed7ada045b1b57419ac1ee53, type: 2}
|
||||
propertyPath: m_LocalRotation.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 462204, guid: fb3806e9ed7ada045b1b57419ac1ee53, type: 2}
|
||||
propertyPath: m_LocalRotation.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 462204, guid: fb3806e9ed7ada045b1b57419ac1ee53, type: 2}
|
||||
propertyPath: m_LocalRotation.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 462204, guid: fb3806e9ed7ada045b1b57419ac1ee53, type: 2}
|
||||
propertyPath: m_LocalRotation.w
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 462204, guid: fb3806e9ed7ada045b1b57419ac1ee53, type: 2}
|
||||
propertyPath: m_RootOrder
|
||||
value: 4
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 11462204, guid: fb3806e9ed7ada045b1b57419ac1ee53, type: 2}
|
||||
propertyPath: _position.x
|
||||
value: 2
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 11462204, guid: fb3806e9ed7ada045b1b57419ac1ee53, type: 2}
|
||||
propertyPath: _position.y
|
||||
value: 7
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 162204, guid: fb3806e9ed7ada045b1b57419ac1ee53, type: 2}
|
||||
propertyPath: m_Name
|
||||
value: Cube_3x1x2
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 21262204, guid: fb3806e9ed7ada045b1b57419ac1ee53, type: 2}
|
||||
propertyPath: m_SortingOrder
|
||||
value: -2
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_ParentPrefab: {fileID: 100100000, guid: fb3806e9ed7ada045b1b57419ac1ee53, type: 2}
|
||||
m_IsPrefabParent: 0
|
||||
|
||||
@@ -6,6 +6,7 @@ using UnityEditor;
|
||||
|
||||
namespace IsoTools {
|
||||
[ExecuteInEditMode]
|
||||
[RequireComponent(typeof(SpriteRenderer))]
|
||||
public class IsoObject : MonoBehaviour {
|
||||
|
||||
#if UNITY_EDITOR
|
||||
@@ -17,24 +18,6 @@ namespace IsoTools {
|
||||
[SerializeField]
|
||||
Vector3 _position = Vector3.zero;
|
||||
|
||||
/// <summary>Isometric object position X.</summary>
|
||||
public float PositionX {
|
||||
get { return Position.x; }
|
||||
set { Position = IsoUtils.Vec3ChangeX(Position, value); }
|
||||
}
|
||||
|
||||
/// <summary>Isometric object position Y.</summary>
|
||||
public float PositionY {
|
||||
get { return Position.y; }
|
||||
set { Position = IsoUtils.Vec3ChangeY(Position, value); }
|
||||
}
|
||||
|
||||
/// <summary>Isometric object position Z.</summary>
|
||||
public float PositionZ {
|
||||
get { return Position.z; }
|
||||
set { Position = IsoUtils.Vec3ChangeZ(Position, value); }
|
||||
}
|
||||
|
||||
/// <summary>Isometric object position.</summary>
|
||||
public Vector3 Position {
|
||||
get { return _position; }
|
||||
@@ -44,9 +27,51 @@ namespace IsoTools {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Isometric object position X.</summary>
|
||||
public float PositionX {
|
||||
get { return Position.x; }
|
||||
set { Position = IsoUtils.Vec3ChangeX(Position, value); }
|
||||
}
|
||||
|
||||
/// <summary>Isometric object position Y.</summary>
|
||||
public float PositionY {
|
||||
get { return Position.y; }
|
||||
set { Position = IsoUtils.Vec3ChangeY(Position, value); }
|
||||
}
|
||||
|
||||
/// <summary>Isometric object position Z.</summary>
|
||||
public float PositionZ {
|
||||
get { return Position.z; }
|
||||
set { Position = IsoUtils.Vec3ChangeZ(Position, value); }
|
||||
}
|
||||
|
||||
/// <summary>Isometric object position XY.</summary>
|
||||
public Vector2 PositionXY {
|
||||
get { return new Vector2(PositionX, PositionY); }
|
||||
}
|
||||
|
||||
/// <summary>Isometric object position YZ.</summary>
|
||||
public Vector2 PositionYZ {
|
||||
get { return new Vector2(PositionY, PositionZ); }
|
||||
}
|
||||
|
||||
/// <summary>Isometric object position XZ.</summary>
|
||||
public Vector2 PositionXZ {
|
||||
get { return new Vector2(PositionX, PositionZ); }
|
||||
}
|
||||
|
||||
[SerializeField]
|
||||
Vector3 _size = Vector3.one;
|
||||
|
||||
/// <summary>Isometric object size.</summary>
|
||||
public Vector3 Size {
|
||||
get { return _size; }
|
||||
set {
|
||||
_size = IsoUtils.Vec3Max(value, Vector3.zero);
|
||||
FixTransform();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Isometric object size X.</summary>
|
||||
public float SizeX {
|
||||
get { return Size.x; }
|
||||
@@ -65,27 +90,60 @@ namespace IsoTools {
|
||||
set { Size = IsoUtils.Vec3ChangeZ(Size, value); }
|
||||
}
|
||||
|
||||
/// <summary>Isometric object size.</summary>
|
||||
public Vector3 Size {
|
||||
get { return _size; }
|
||||
set {
|
||||
_size = IsoUtils.Vec3Max(value, Vector3.zero);
|
||||
FixTransform();
|
||||
}
|
||||
/// <summary>Isometric object size XY.</summary>
|
||||
public Vector2 SizeXY {
|
||||
get { return new Vector2(SizeX, SizeY); }
|
||||
}
|
||||
|
||||
/// <summary>Isometric object size YZ.</summary>
|
||||
public Vector2 SizeYZ {
|
||||
get { return new Vector2(SizeY, SizeZ); }
|
||||
}
|
||||
|
||||
/// <summary>Isometric object size XZ.</summary>
|
||||
public Vector2 SizeXZ {
|
||||
get { return new Vector2(SizeX, SizeZ); }
|
||||
}
|
||||
|
||||
[SerializeField]
|
||||
/// <summary>Isometric object tile position.</summary>
|
||||
public Vector3 TilePosition {
|
||||
get {
|
||||
return new Vector3(
|
||||
Mathf.Round(Position.x),
|
||||
Mathf.Round(Position.y),
|
||||
Mathf.Round(Position.z));
|
||||
}
|
||||
get { return IsoUtils.Vec3Round(Position); }
|
||||
set { Position = value; }
|
||||
}
|
||||
|
||||
/// <summary>Isometric object tile position X.</summary>
|
||||
public float TilePositionX {
|
||||
get { return TilePosition.x; }
|
||||
set { TilePosition = IsoUtils.Vec3ChangeX(TilePosition, value); }
|
||||
}
|
||||
|
||||
/// <summary>Isometric object tile position Y.</summary>
|
||||
public float TilePositionY {
|
||||
get { return TilePosition.y; }
|
||||
set { TilePosition = IsoUtils.Vec3ChangeY(TilePosition, value); }
|
||||
}
|
||||
|
||||
/// <summary>Isometric object tile position Z.</summary>
|
||||
public float TilePositionZ {
|
||||
get { return TilePosition.z; }
|
||||
set { TilePosition = IsoUtils.Vec3ChangeZ(TilePosition, value); }
|
||||
}
|
||||
|
||||
/// <summary>Isometric object tile position XY.</summary>
|
||||
public Vector2 TilePositionXY {
|
||||
get { return new Vector2(TilePositionX, TilePositionY); }
|
||||
}
|
||||
|
||||
/// <summary>Isometric object tile position YZ.</summary>
|
||||
public Vector2 TilePositionYZ {
|
||||
get { return new Vector2(TilePositionY, TilePositionZ); }
|
||||
}
|
||||
|
||||
/// <summary>Isometric object tile position XZ.</summary>
|
||||
public Vector2 TilePositionXZ {
|
||||
get { return new Vector2(TilePositionX, TilePositionZ); }
|
||||
}
|
||||
|
||||
IsoWorld _iso_world = null;
|
||||
public IsoWorld IsoWorld {
|
||||
get {
|
||||
@@ -104,24 +162,25 @@ namespace IsoTools {
|
||||
}
|
||||
|
||||
public void FixTransform() {
|
||||
Vector3 trans = IsoWorld.IsoToScreen(Position);
|
||||
trans.z = transform.position.z;
|
||||
transform.position = trans;
|
||||
transform.position = IsoUtils.Vec3ChangeZ(
|
||||
IsoWorld.IsoToScreen(Position),
|
||||
transform.position.z);
|
||||
FixLastProperties();
|
||||
MartDirtyIsoWorld();
|
||||
MarkEditorObjectDirty();
|
||||
}
|
||||
|
||||
public void FixIsoPosition() {
|
||||
Vector2 trans = transform.position;
|
||||
Position = IsoWorld.ScreenToIso(trans, Position.z);
|
||||
Position = IsoWorld.ScreenToIso(
|
||||
transform.position,
|
||||
PositionZ);
|
||||
}
|
||||
|
||||
void FixLastProperties() {
|
||||
#if UNITY_EDITOR
|
||||
_lastTransform = transform.position;
|
||||
_lastPosition = Position;
|
||||
_lastSize = Size;
|
||||
_lastPosition = Position;
|
||||
_lastSize = Size;
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -153,9 +212,7 @@ namespace IsoTools {
|
||||
#if UNITY_EDITOR
|
||||
void Update() {
|
||||
if ( Application.isEditor ) {
|
||||
if ( !Mathf.Approximately(_lastTransform.x, transform.position.x) ||
|
||||
!Mathf.Approximately(_lastTransform.y, transform.position.y))
|
||||
{
|
||||
if ( !IsoUtils.Vec2Approximately(_lastTransform, transform.position) ) {
|
||||
FixIsoPosition();
|
||||
}
|
||||
if ( _lastPosition != _position ) Position = _position;
|
||||
|
||||
55
Assets/IsoTools/Scripts/IsoRigidbody.cs
Normal file
55
Assets/IsoTools/Scripts/IsoRigidbody.cs
Normal file
@@ -0,0 +1,55 @@
|
||||
using UnityEngine;
|
||||
|
||||
#if UNITY_EDITOR
|
||||
using UnityEditor;
|
||||
#endif
|
||||
|
||||
namespace IsoTools {
|
||||
[RequireComponent(typeof(IsoObject))]
|
||||
public class IsoRigidbody : MonoBehaviour {
|
||||
|
||||
public bool IsTrigger = false;
|
||||
public bool IsKinematic = false;
|
||||
public RigidbodyInterpolation Interpolation = RigidbodyInterpolation.None;
|
||||
public CollisionDetectionMode CollisionMode = CollisionDetectionMode.Discrete;
|
||||
public PhysicMaterial PhysicMaterial = null;
|
||||
|
||||
IsoObject _iso_object = null;
|
||||
GameObject _fake_object = null;
|
||||
Rigidbody _rigid_body = null;
|
||||
BoxCollider _box_collider = null;
|
||||
|
||||
public Rigidbody Rigidbody {
|
||||
get { return _rigid_body; }
|
||||
}
|
||||
|
||||
void Awake() {
|
||||
_iso_object = GetComponent<IsoObject>();
|
||||
if ( !_iso_object ) {
|
||||
throw new UnityException("IsoRigidbody. IsoObject not found!");
|
||||
}
|
||||
_fake_object = new GameObject();
|
||||
_fake_object.name = "_Fake" + gameObject.name;
|
||||
|
||||
_rigid_body = _fake_object.AddComponent<Rigidbody>();
|
||||
_rigid_body.freezeRotation = true;
|
||||
_rigid_body.isKinematic = IsKinematic;
|
||||
_rigid_body.interpolation = Interpolation;
|
||||
_rigid_body.collisionDetectionMode = CollisionMode;
|
||||
|
||||
_box_collider = _fake_object.AddComponent<BoxCollider>();
|
||||
_box_collider.center = IsoUtils.Vec3SwapYZ(_iso_object.Size / 2.0f);
|
||||
_box_collider.size = IsoUtils.Vec3SwapYZ(_iso_object.Size);
|
||||
_box_collider.isTrigger = IsTrigger;
|
||||
_box_collider.material = PhysicMaterial;
|
||||
|
||||
_fake_object.transform.position = IsoUtils.Vec3SwapYZ(_iso_object.Position);
|
||||
}
|
||||
|
||||
void FixedUpdate() {
|
||||
if ( _iso_object ) {
|
||||
_iso_object.Position = IsoUtils.Vec3SwapYZ(_fake_object.transform.position);
|
||||
}
|
||||
}
|
||||
}
|
||||
} // namespace IsoTools
|
||||
12
Assets/IsoTools/Scripts/IsoRigidbody.cs.meta
Normal file
12
Assets/IsoTools/Scripts/IsoRigidbody.cs.meta
Normal file
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b6f23cf97dc1d49d89a2556193c4f2e2
|
||||
timeCreated: 1431879880
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -2,66 +2,63 @@
|
||||
using System;
|
||||
|
||||
namespace IsoTools {
|
||||
public class IsoUtils {
|
||||
public static Vector3 Vec2OneX {
|
||||
get { return new Vector2(1.0f, 0.0f); }
|
||||
}
|
||||
public static class IsoUtils {
|
||||
|
||||
public static Vector3 Vec2OneY {
|
||||
get { return new Vector2(0.0f, 1.0f); }
|
||||
}
|
||||
// ------------------------------------------------------------------------
|
||||
//
|
||||
// Consts
|
||||
//
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
public static Vector3 Vec3OneX {
|
||||
get { return new Vector3(1.0f, 0.0f, 0.0f); }
|
||||
}
|
||||
public static Vector3 Vec2OneX { get { return new Vector2(1.0f, 0.0f); } }
|
||||
public static Vector3 Vec2OneY { get { return new Vector2(0.0f, 1.0f); } }
|
||||
public static Vector3 Vec2OneXY { get { return new Vector2(1.0f, 1.0f); } }
|
||||
|
||||
public static Vector3 Vec3OneY {
|
||||
get { return new Vector3(0.0f, 1.0f, 0.0f); }
|
||||
}
|
||||
public static Vector3 Vec3OneX { get { return new Vector3(1.0f, 0.0f, 0.0f); } }
|
||||
public static Vector3 Vec3OneY { get { return new Vector3(0.0f, 1.0f, 0.0f); } }
|
||||
public static Vector3 Vec3OneZ { get { return new Vector3(0.0f, 0.0f, 1.0f); } }
|
||||
public static Vector3 Vec3OneXY { get { return new Vector3(1.0f, 1.0f, 0.0f); } }
|
||||
public static Vector3 Vec3OneYZ { get { return new Vector3(0.0f, 1.0f, 1.0f); } }
|
||||
public static Vector3 Vec3OneXZ { get { return new Vector3(1.0f, 0.0f, 1.0f); } }
|
||||
|
||||
public static Vector3 Vec3OneZ {
|
||||
get { return new Vector3(0.0f, 0.0f, 1.0f); }
|
||||
}
|
||||
// ------------------------------------------------------------------------
|
||||
//
|
||||
// Swap
|
||||
//
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
public static Vector2 Vec2FromX(float x) {
|
||||
return new Vector2(x, 0.0f);
|
||||
public static Vector2 Vec2SwapXY(Vector2 v) {
|
||||
return new Vector2(v.y, v.x);
|
||||
}
|
||||
|
||||
public static Vector2 Vec2FromY(float y) {
|
||||
return new Vector2(0.0f, y);
|
||||
public static Vector3 Vec3SwapXY(Vector3 v) {
|
||||
return new Vector3(v.y, v.x, v.z);
|
||||
}
|
||||
|
||||
public static Vector3 Vec3SwapYZ(Vector3 v) {
|
||||
return new Vector3(v.x, v.z, v.y);
|
||||
}
|
||||
|
||||
public static Vector3 Vec3SwapXZ(Vector3 v) {
|
||||
return new Vector3(v.z, v.y, v.x);
|
||||
}
|
||||
|
||||
public static Vector3 Vec3FromX(float x) {
|
||||
return new Vector3(x, 0.0f, 0.0f);
|
||||
// ------------------------------------------------------------------------
|
||||
//
|
||||
// Abs/Min/Max
|
||||
//
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
public static Vector2 Vec2Abs(Vector2 v) {
|
||||
return new Vector2(
|
||||
Mathf.Abs(v.x),
|
||||
Mathf.Abs(v.y));
|
||||
}
|
||||
|
||||
public static Vector3 Vec3FromY(float y) {
|
||||
return new Vector3(0.0f, y, 0.0f);
|
||||
}
|
||||
|
||||
public static Vector3 Vec3FromZ(float z) {
|
||||
return new Vector3(0.0f, 0.0f, z);
|
||||
}
|
||||
|
||||
public static int Sign<T>(float v) {
|
||||
return v > 0.0f ? 1 : (v == 0.0f ? 0 : -1);
|
||||
}
|
||||
|
||||
public static void LookUpCube(Vector3 min, Vector3 max, Action<Vector3> act) {
|
||||
for ( var z = min.z; z < max.z; ++z ) {
|
||||
for ( var y = min.y; y < max.y; ++y ) {
|
||||
for ( var x = min.x; x < max.x; ++x ) {
|
||||
act(new Vector3(x, y, z));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static bool Vec3Approximately(Vector3 a, Vector3 b) {
|
||||
return
|
||||
Mathf.Approximately(a.x, b.x) &&
|
||||
Mathf.Approximately(a.y, b.y) &&
|
||||
Mathf.Approximately(a.z, b.z);
|
||||
public static Vector2 Vec2Min(Vector2 a, Vector2 b) {
|
||||
return new Vector2(
|
||||
Mathf.Min(a.x, b.x),
|
||||
Mathf.Min(a.y, b.y));
|
||||
}
|
||||
|
||||
public static Vector3 Vec3Abs(Vector3 v) {
|
||||
@@ -71,20 +68,46 @@ namespace IsoTools {
|
||||
Mathf.Abs(v.z));
|
||||
}
|
||||
|
||||
public static Vector3 Vec3Min(Vector3 a, Vector3 b) {
|
||||
return new Vector3(
|
||||
Mathf.Min(a.x, b.x),
|
||||
Mathf.Min(a.y, b.y),
|
||||
Mathf.Min(a.z, b.z));
|
||||
}
|
||||
|
||||
public static Vector2 Vec2Max(Vector2 a, Vector2 b) {
|
||||
return new Vector2(
|
||||
Mathf.Max(a.x, b.x),
|
||||
Mathf.Max(a.y, b.y));
|
||||
}
|
||||
|
||||
public static Vector3 Vec3Max(Vector3 a, Vector3 b) {
|
||||
return new Vector3(
|
||||
Mathf.Max(a.x, b.x),
|
||||
Mathf.Max(a.y, b.y),
|
||||
Mathf.Max(a.z, b.z));
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
//
|
||||
// Ceil/Floor/Round
|
||||
//
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
public static Vector3 Vec3Ceil(Vector3 v) {
|
||||
return new Vector3(
|
||||
Mathf.Ceil(v.x),
|
||||
Mathf.Ceil(v.y),
|
||||
Mathf.Ceil(v.z));
|
||||
}
|
||||
|
||||
|
||||
public static Vector3 Vec3Floor(Vector3 v) {
|
||||
return new Vector3(
|
||||
Mathf.Floor(v.x),
|
||||
Mathf.Floor(v.y),
|
||||
Mathf.Floor(v.z));
|
||||
}
|
||||
|
||||
|
||||
public static Vector3 Vec3Round(Vector3 v) {
|
||||
return new Vector3(
|
||||
Mathf.Round(v.x),
|
||||
@@ -92,13 +115,19 @@ namespace IsoTools {
|
||||
Mathf.Round(v.z));
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
//
|
||||
// Div/DivCeil/DivFloor/DivRound
|
||||
//
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
public static Vector3 Vec3Div(Vector3 a, float b) {
|
||||
return new Vector3(
|
||||
a.x / b,
|
||||
a.y / b,
|
||||
a.z / b);
|
||||
}
|
||||
|
||||
|
||||
public static Vector3 Vec3Div(Vector3 a, Vector3 b) {
|
||||
return new Vector3(
|
||||
a.x / b.x,
|
||||
@@ -113,63 +142,134 @@ namespace IsoTools {
|
||||
public static Vector3 Vec3DivCeil(Vector3 a, Vector3 b) {
|
||||
return Vec3Ceil(Vec3Div(a, b));
|
||||
}
|
||||
|
||||
|
||||
public static Vector3 Vec3DivFloor(Vector3 a, float b) {
|
||||
return Vec3Floor(Vec3Div(a, b));
|
||||
}
|
||||
|
||||
|
||||
public static Vector3 Vec3DivFloor(Vector3 a, Vector3 b) {
|
||||
return Vec3Floor(Vec3Div(a, b));
|
||||
}
|
||||
|
||||
|
||||
public static Vector3 Vec3DivRound(Vector3 a, float b) {
|
||||
return Vec3Round(Vec3Div(a, b));
|
||||
}
|
||||
|
||||
|
||||
public static Vector3 Vec3DivRound(Vector3 a, Vector3 b) {
|
||||
return Vec3Round(Vec3Div(a, b));
|
||||
}
|
||||
|
||||
public static Vector3 Vec3Min(Vector3 a, Vector3 b) {
|
||||
return new Vector3(
|
||||
Mathf.Min(a.x, b.x),
|
||||
Mathf.Min(a.y, b.y),
|
||||
Mathf.Min(a.z, b.z));
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
//
|
||||
// FromX
|
||||
//
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
public static Vector2 Vec2FromX(float x) {
|
||||
return new Vector2(x, 0.0f);
|
||||
}
|
||||
|
||||
public static Vector3 Vec3Max(Vector3 a, Vector3 b) {
|
||||
return new Vector3(
|
||||
Mathf.Max(a.x, b.x),
|
||||
Mathf.Max(a.y, b.y),
|
||||
Mathf.Max(a.z, b.z));
|
||||
public static Vector2 Vec2FromY(float y) {
|
||||
return new Vector2(0.0f, y);
|
||||
}
|
||||
|
||||
public static Vector2 Vec2FromXY(float x, float y) {
|
||||
return new Vector2(x, y);
|
||||
}
|
||||
|
||||
public static Vector3 Vec3FromX(float x) {
|
||||
return new Vector3(x, 0.0f, 0.0f);
|
||||
}
|
||||
|
||||
public static Vector3 Vec3FromY(float y) {
|
||||
return new Vector3(0.0f, y, 0.0f);
|
||||
}
|
||||
|
||||
public static Vector3 Vec3FromZ(float z) {
|
||||
return new Vector3(0.0f, 0.0f, z);
|
||||
}
|
||||
|
||||
public static Vector3 Vec3FromXY(float x, float y) {
|
||||
return new Vector3(x, y, 0.0f);
|
||||
}
|
||||
|
||||
public static Vector3 Vec3FromYZ(float y, float z) {
|
||||
return new Vector3(0.0f, y, z);
|
||||
}
|
||||
|
||||
public static Vector3 Vec3FromXZ(float x, float z) {
|
||||
return new Vector3(x, 0.0f, z);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
//
|
||||
// ChangeX
|
||||
//
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
public static Vector2 Vec2ChangeX(Vector2 v, float x) {
|
||||
return new Vector2(x, v.y);
|
||||
}
|
||||
|
||||
public static Vector2 Vec2ChangeY(Vector2 v, float y) {
|
||||
return new Vector2(v.x, y);
|
||||
}
|
||||
|
||||
public static Vector3 Vec3ChangeX(Vector3 v, float x) {
|
||||
return new Vector3(x, v.y, v.z);
|
||||
}
|
||||
|
||||
|
||||
public static Vector3 Vec3ChangeY(Vector3 v, float y) {
|
||||
return new Vector3(v.x, y, v.z);
|
||||
}
|
||||
|
||||
|
||||
public static Vector3 Vec3ChangeZ(Vector3 v, float z) {
|
||||
return new Vector3(v.x, v.y, z);
|
||||
}
|
||||
|
||||
public static Color ColorChangeR(Color c, float r) {
|
||||
return new Color(r, c.g, c.b, c.a);
|
||||
|
||||
public static Vector3 Vec3ChangeXY(Vector3 v, float x, float y) {
|
||||
return new Vector3(x, y, v.z);
|
||||
}
|
||||
|
||||
public static Vector3 Vec3ChangeYZ(Vector3 v, float y, float z) {
|
||||
return new Vector3(v.x, y, z);
|
||||
}
|
||||
|
||||
public static Vector3 Vec3ChangeXZ(Vector3 v, float x, float z) {
|
||||
return new Vector3(x, v.y, z);
|
||||
}
|
||||
|
||||
public static Color ColorChangeG(Color c, float g) {
|
||||
return new Color(c.r, g, c.b, c.a);
|
||||
// ------------------------------------------------------------------------
|
||||
//
|
||||
// Approximately
|
||||
//
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
public static bool Vec2Approximately(Vector2 a, Vector2 b) {
|
||||
return
|
||||
Mathf.Approximately(a.x, b.x) &&
|
||||
Mathf.Approximately(a.y, b.y);
|
||||
}
|
||||
|
||||
public static Color ColorChangeB(Color c, float b) {
|
||||
return new Color(c.r, c.g, b, c.a);
|
||||
public static bool Vec3Approximately(Vector3 a, Vector3 b) {
|
||||
return
|
||||
Mathf.Approximately(a.x, b.x) &&
|
||||
Mathf.Approximately(a.y, b.y) &&
|
||||
Mathf.Approximately(a.z, b.z);
|
||||
}
|
||||
|
||||
public static Color ColorChangeA(Color c, float a) {
|
||||
return new Color(c.r, c.g, c.b, a);
|
||||
// ------------------------------------------------------------------------
|
||||
//
|
||||
// LookUpCube
|
||||
//
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
public static void LookUpCube(Vector3 min, Vector3 max, Action<Vector3> act) {
|
||||
for ( var z = min.z; z < max.z; ++z ) {
|
||||
for ( var y = min.y; y < max.y; ++y ) {
|
||||
for ( var x = min.x; x < max.x; ++x ) {
|
||||
act(new Vector3(x, y, z));
|
||||
}}}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
using UnityEngine;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
|
||||
#if UNITY_EDITOR
|
||||
@@ -39,6 +40,7 @@ namespace IsoTools {
|
||||
}
|
||||
|
||||
bool _dirty = true;
|
||||
float _lastTileSize = 0.0f;
|
||||
|
||||
List<SectorInfo> _sectors = new List<SectorInfo>();
|
||||
List<ObjectInfo> _objects = new List<ObjectInfo>();
|
||||
@@ -48,10 +50,6 @@ namespace IsoTools {
|
||||
Vector3 _objsMaxNumPos = Vector3.zero;
|
||||
Vector3 _objsNumPosCount = Vector3.zero;
|
||||
|
||||
float _lastTileSize = 0.0f;
|
||||
float _lastMinDepth = 0.0f;
|
||||
float _lastMaxDepth = 0.0f;
|
||||
|
||||
[SerializeField]
|
||||
public float _tileSize = 32.0f;
|
||||
/// <summary>Isometric tile size.</summary>
|
||||
@@ -62,28 +60,6 @@ namespace IsoTools {
|
||||
ChangeSortingProperty();
|
||||
}
|
||||
}
|
||||
|
||||
[SerializeField]
|
||||
public float _minDepth = 0.0f;
|
||||
/// <summary>Min sorting depth value.</summary>
|
||||
public float MinDepth {
|
||||
get { return _minDepth; }
|
||||
set {
|
||||
_minDepth = value;
|
||||
ChangeSortingProperty();
|
||||
}
|
||||
}
|
||||
|
||||
[SerializeField]
|
||||
public float _maxDepth = 100.0f;
|
||||
/// <summary>Max sorting depth value.</summary>
|
||||
public float MaxDepth {
|
||||
get { return _maxDepth; }
|
||||
set {
|
||||
_maxDepth = value;
|
||||
ChangeSortingProperty();
|
||||
}
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
/// <summary>
|
||||
@@ -103,7 +79,7 @@ namespace IsoTools {
|
||||
// ------------------------------------------------------------------------
|
||||
public void MarkDirty(IsoObject obj) {
|
||||
if ( obj ) {
|
||||
var renderer = obj.GetComponent<Renderer>();
|
||||
var renderer = obj.GetComponent<SpriteRenderer>();
|
||||
if ( renderer && renderer.isVisible ) {
|
||||
MarkDirty();
|
||||
}
|
||||
@@ -146,9 +122,9 @@ namespace IsoTools {
|
||||
/// <param name="iso_z">Point isometric height.</param>
|
||||
// ------------------------------------------------------------------------
|
||||
public Vector3 ScreenToIso(Vector2 pos, float iso_z) {
|
||||
var iso_pos = ScreenToIso(new Vector2(pos.x, pos.y - iso_z * TileSize));
|
||||
iso_pos.z = iso_z;
|
||||
return iso_pos;
|
||||
return IsoUtils.Vec3ChangeZ(
|
||||
ScreenToIso(new Vector2(pos.x, pos.y - iso_z * TileSize)),
|
||||
iso_z);
|
||||
}
|
||||
|
||||
void MarkEditorWorldDirty() {
|
||||
@@ -174,8 +150,6 @@ namespace IsoTools {
|
||||
MarkDirty();
|
||||
FixAllTransforms();
|
||||
_lastTileSize = TileSize;
|
||||
_lastMinDepth = MinDepth;
|
||||
_lastMaxDepth = MaxDepth;
|
||||
}
|
||||
|
||||
int SectorIndex(Vector3 num_pos) {
|
||||
@@ -206,7 +180,6 @@ namespace IsoTools {
|
||||
var ms = FindSector(num_pos);
|
||||
if ( ms != null ) {
|
||||
act(ms);
|
||||
|
||||
var s1 = FindSector(num_pos + new Vector3(-1, 0, 0));
|
||||
var s2 = FindSector(num_pos + new Vector3( 0, -1, 0));
|
||||
var s3 = FindSector(num_pos + new Vector3(-1, -1, 0));
|
||||
@@ -235,14 +208,44 @@ namespace IsoTools {
|
||||
bool IsDepends(Vector3 a_min, Vector3 a_size, Vector3 b_min, Vector3 b_size) {
|
||||
var a_max = a_min + a_size;
|
||||
var b_max = b_min + b_size;
|
||||
return a_max.x > b_min.x && a_max.y > b_min.y && b_max.z > a_min.z;
|
||||
var a_yesno = a_max.x > b_min.x && a_max.y > b_min.y && b_max.z > a_min.z;
|
||||
var b_yesno = b_max.x > a_min.x && b_max.y > a_min.y && a_max.z > b_min.z;
|
||||
if ( a_yesno && b_yesno ) {
|
||||
var da_p = new Vector3(a_max.x - b_min.x, a_max.y - b_min.y, a_max.z - b_min.z);
|
||||
var db_p = new Vector3(b_max.x - a_min.x, b_max.y - a_min.y, b_max.z - a_min.z);
|
||||
var dd_p = IsoUtils.Vec3Abs(da_p - db_p);
|
||||
|
||||
Debug.LogFormat("CoefDB: {0}:::{1}:::{2}", dd_p.x, dd_p.y, dd_p.z);
|
||||
Debug.LogFormat("----------------------------");
|
||||
|
||||
if ( dd_p.z > dd_p.x || dd_p.z > dd_p.y ) {
|
||||
Debug.Log("by z");
|
||||
return da_p.z < db_p.z;
|
||||
} else if ( dd_p.x > dd_p.y && dd_p.x > dd_p.z ) {
|
||||
Debug.Log("by x");
|
||||
return da_p.x > db_p.x;
|
||||
} else if ( dd_p.y > dd_p.x && dd_p.y > dd_p.z) {
|
||||
Debug.Log("by y");
|
||||
return da_p.y > db_p.y;
|
||||
}
|
||||
|
||||
/*
|
||||
if ( dd_p.x < dd_p.y ) {
|
||||
Debug.Log("by y");
|
||||
return da_p.y > db_p.y;
|
||||
} else {
|
||||
Debug.Log("by x");
|
||||
return da_p.x > db_p.x;
|
||||
}*/
|
||||
}
|
||||
return a_yesno;
|
||||
}
|
||||
|
||||
void SetupSectorSize(IsoObject[] iso_objects) {
|
||||
_objsSectorSize = 0.0f;
|
||||
var objsSum = 0;
|
||||
foreach ( var obj in iso_objects ) {
|
||||
var renderer = obj.GetComponent<Renderer>();
|
||||
var renderer = obj.GetComponent<SpriteRenderer>();
|
||||
if ( renderer && renderer.isVisible ) {
|
||||
++objsSum;
|
||||
_objsSectorSize += Mathf.Max(obj.Size.x, obj.Size.y, obj.Size.z);
|
||||
@@ -256,7 +259,7 @@ namespace IsoTools {
|
||||
_objsMinNumPos = Vector3.zero;
|
||||
_objsMaxNumPos = Vector3.one;
|
||||
foreach ( var obj in iso_objects ) {
|
||||
var renderer = obj.GetComponent<Renderer>();
|
||||
var renderer = obj.GetComponent<SpriteRenderer>();
|
||||
if ( renderer && renderer.isVisible ) {
|
||||
var max_size = IsoUtils.Vec3Max(Vector3.one, obj.Size);
|
||||
var min_npos = IsoUtils.Vec3DivFloor(obj.Position, _objsSectorSize);
|
||||
@@ -307,7 +310,7 @@ namespace IsoTools {
|
||||
}
|
||||
|
||||
void PlaceAllObjects() {
|
||||
var depth = MinDepth;
|
||||
var depth = 0;
|
||||
foreach ( var info in _objects ) {
|
||||
depth = PlaceObject(info, depth);
|
||||
}
|
||||
@@ -316,12 +319,16 @@ namespace IsoTools {
|
||||
_depends.Clear();
|
||||
}
|
||||
|
||||
void PlaceObject(IsoObject obj, float depth) {
|
||||
var trans = obj.gameObject.transform;
|
||||
trans.position = new Vector3(trans.position.x, trans.position.y, depth);
|
||||
void PlaceObject(IsoObject obj, int depth) {
|
||||
//var trans = obj.gameObject.transform;
|
||||
//trans.position = new Vector3(trans.position.x, trans.position.y, depth);
|
||||
var renderer = obj.GetComponent<SpriteRenderer>();
|
||||
if ( renderer ) {
|
||||
renderer.sortingOrder = depth;
|
||||
}
|
||||
}
|
||||
|
||||
float PlaceObject(ObjectInfo info, float depth) {
|
||||
int PlaceObject(ObjectInfo info, int depth) {
|
||||
if ( info.Visited ) {
|
||||
return depth;
|
||||
}
|
||||
@@ -332,7 +339,7 @@ namespace IsoTools {
|
||||
depth = PlaceObject(obj, depth);
|
||||
}
|
||||
PlaceObject(info.IsoObject, depth);
|
||||
return depth + (MaxDepth - MinDepth) / _objects.Count;
|
||||
return depth - 1;
|
||||
}
|
||||
|
||||
void StepSort() {
|
||||
@@ -355,8 +362,6 @@ namespace IsoTools {
|
||||
void LateUpdate() {
|
||||
if ( Application.isEditor ) {
|
||||
if ( !Mathf.Approximately(_lastTileSize, _tileSize) ) TileSize = _tileSize;
|
||||
if ( !Mathf.Approximately(_lastMinDepth, _minDepth) ) MinDepth = _minDepth;
|
||||
if ( !Mathf.Approximately(_lastMaxDepth, _maxDepth) ) MaxDepth = _maxDepth;
|
||||
}
|
||||
StepSort();
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ Global
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(MonoDevelopProperties) = preSolution
|
||||
GlobalSection(MonoDevelopProperties) = preSolution
|
||||
StartupItem = Assembly-CSharp.csproj
|
||||
Policies = $0
|
||||
$0.TextStylePolicy = $1
|
||||
|
||||
@@ -23,7 +23,7 @@ Global
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(MonoDevelopProperties) = preSolution
|
||||
GlobalSection(MonoDevelopProperties) = preSolution
|
||||
StartupItem = Assembly-CSharp.csproj
|
||||
Policies = $0
|
||||
$0.TextStylePolicy = $1
|
||||
|
||||
@@ -1,8 +1,17 @@
|
||||
<Properties>
|
||||
<MonoDevelop.Ide.Workspace ActiveConfiguration="Debug" PreferredExecutionTarget="MonoDevelop.Default" />
|
||||
<MonoDevelop.Ide.Workbench ActiveDocument="Assets/IsoTools/Scripts/IsoWorld.cs">
|
||||
<MonoDevelop.Ide.Workbench ActiveDocument="../OtherIso4/Assets/Ultimate Isometric Toolkit/Code/IsometricTools/Other/GameSetup.cs">
|
||||
<Files>
|
||||
<File FileName="Assets/IsoTools/Scripts/IsoWorld.cs" Line="1" Column="1" />
|
||||
<File FileName="../OtherIso4/Assets/Ultimate Isometric Toolkit/Code/IsometricTools/IsoController/SimpleIsoObjectController.cs" Line="1" Column="1" />
|
||||
<File FileName="../OtherIso4/Assets/Ultimate Isometric Toolkit/Code/IsometricTools/Iso/Isometric.cs" Line="1" Column="1" />
|
||||
<File FileName="../OtherIso4/Assets/Ultimate Isometric Toolkit/Code/IsometricTools/Iso/IsoObject.cs" Line="1" Column="1" />
|
||||
<File FileName="../OtherIso4/Assets/Ultimate Isometric Toolkit/SetupAndConstraints.txt" Line="1" Column="1" />
|
||||
<File FileName="../OtherIso4/Assets/Ultimate Isometric Toolkit/Code/IsometricTools/Iso/GridMap.cs" Line="1" Column="1" />
|
||||
<File FileName="../OtherIso4/Assets/Ultimate Isometric Toolkit/Code/IsometricTools/Iso/IsoDirection.cs" Line="1" Column="1" />
|
||||
<File FileName="../OtherIso4/Assets/Ultimate Isometric Toolkit/Code/IsometricTools/Iso/Tile.cs" Line="1" Column="1" />
|
||||
<File FileName="../OtherIso4/Assets/Ultimate Isometric Toolkit/Code/IsometricTools/Other/MethodExtensionForMonoBehaviourTransform.cs" Line="1" Column="1" />
|
||||
<File FileName="../OtherIso4/Assets/Ultimate Isometric Toolkit/Code/IsometricTools/Other/LevelLoader.cs" Line="1" Column="1" />
|
||||
<File FileName="../OtherIso4/Assets/Ultimate Isometric Toolkit/Code/IsometricTools/Other/GameSetup.cs" Line="17" Column="42" />
|
||||
</Files>
|
||||
</MonoDevelop.Ide.Workbench>
|
||||
<MonoDevelop.Ide.DebuggingService.Breakpoints>
|
||||
|
||||
Reference in New Issue
Block a user