Skip to content
Snippets Groups Projects
Commit 07399915 authored by BlackAngle233's avatar BlackAngle233
Browse files

5.31

parent 0314bc9c
No related merge requests found
Showing
with 1565 additions and 636 deletions
No preview for this file type
No preview for this file type
This diff is collapsed.
This diff is collapsed.
...@@ -185,10 +185,10 @@ MonoBehaviour: ...@@ -185,10 +185,10 @@ MonoBehaviour:
m_Calls: [] m_Calls: []
m_FontData: m_FontData:
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_FontSize: 14 m_FontSize: 28
m_FontStyle: 0 m_FontStyle: 0
m_BestFit: 1 m_BestFit: 0
m_MinSize: 10 m_MinSize: 2
m_MaxSize: 40 m_MaxSize: 40
m_Alignment: 4 m_Alignment: 4
m_AlignByGeometry: 0 m_AlignByGeometry: 0
......
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &1611692820807073632
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 3540591499047591082}
- component: {fileID: 914669039422323191}
- component: {fileID: 6883016815539805342}
m_Layer: 5
m_Name: Text
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &3540591499047591082
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1611692820807073632}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 614152221314582046}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &914669039422323191
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1611692820807073632}
m_CullTransparentMesh: 0
--- !u!114 &6883016815539805342
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1611692820807073632}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
m_RaycastTarget: 1
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_FontData:
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_FontSize: 28
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 2
m_MaxSize: 40
m_Alignment: 4
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: A
--- !u!1 &5015797719584156588
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 614152221314582046}
- component: {fileID: 3678149918655863872}
- component: {fileID: 8468097355062721262}
- component: {fileID: 947904341971186009}
m_Layer: 5
m_Name: Button 1
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &614152221314582046
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5015797719584156588}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 3540591499047591082}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 134.2, y: 2}
m_SizeDelta: {x: 150, y: 60}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &3678149918655863872
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5015797719584156588}
m_CullTransparentMesh: 0
--- !u!114 &8468097355062721262
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5015797719584156588}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0}
m_Type: 1
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!114 &947904341971186009
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5015797719584156588}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Navigation:
m_Mode: 3
m_SelectOnUp: {fileID: 0}
m_SelectOnDown: {fileID: 0}
m_SelectOnLeft: {fileID: 0}
m_SelectOnRight: {fileID: 0}
m_Transition: 1
m_Colors:
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
m_ColorMultiplier: 1
m_FadeDuration: 0.1
m_SpriteState:
m_HighlightedSprite: {fileID: 0}
m_PressedSprite: {fileID: 0}
m_SelectedSprite: {fileID: 0}
m_DisabledSprite: {fileID: 0}
m_AnimationTriggers:
m_NormalTrigger: Normal
m_HighlightedTrigger: Highlighted
m_PressedTrigger: Pressed
m_SelectedTrigger: Selected
m_DisabledTrigger: Disabled
m_Interactable: 1
m_TargetGraphic: {fileID: 8468097355062721262}
m_OnClick:
m_PersistentCalls:
m_Calls: []
fileFormatVersion: 2
guid: 87df886694e27084b8dc7aa9bcadebea
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
...@@ -464,6 +464,84 @@ RectTransform: ...@@ -464,6 +464,84 @@ RectTransform:
m_AnchoredPosition: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: -20, y: -20} m_SizeDelta: {x: -20, y: -20}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!1 &617470789
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 617470790}
- component: {fileID: 617470792}
- component: {fileID: 617470791}
m_Layer: 5
m_Name: Text
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &617470790
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 617470789}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1762606595}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &617470791
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 617470789}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
m_RaycastTarget: 1
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_FontData:
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_FontSize: 28
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 2
m_MaxSize: 40
m_Alignment: 4
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: UI Close
--- !u!222 &617470792
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 617470789}
m_CullTransparentMesh: 0
--- !u!1 &669627296 --- !u!1 &669627296
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
...@@ -524,7 +602,7 @@ MonoBehaviour: ...@@ -524,7 +602,7 @@ MonoBehaviour:
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_FontSize: 28 m_FontSize: 28
m_FontStyle: 0 m_FontStyle: 0
m_BestFit: 1 m_BestFit: 0
m_MinSize: 2 m_MinSize: 2
m_MaxSize: 40 m_MaxSize: 40
m_Alignment: 4 m_Alignment: 4
...@@ -766,10 +844,10 @@ MonoBehaviour: ...@@ -766,10 +844,10 @@ MonoBehaviour:
m_Calls: [] m_Calls: []
m_FontData: m_FontData:
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_FontSize: 14 m_FontSize: 28
m_FontStyle: 0 m_FontStyle: 0
m_BestFit: 1 m_BestFit: 0
m_MinSize: 10 m_MinSize: 2
m_MaxSize: 40 m_MaxSize: 40
m_Alignment: 3 m_Alignment: 3
m_AlignByGeometry: 0 m_AlignByGeometry: 0
...@@ -846,7 +924,7 @@ MonoBehaviour: ...@@ -846,7 +924,7 @@ MonoBehaviour:
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_FontSize: 28 m_FontSize: 28
m_FontStyle: 0 m_FontStyle: 0
m_BestFit: 1 m_BestFit: 0
m_MinSize: 2 m_MinSize: 2
m_MaxSize: 40 m_MaxSize: 40
m_Alignment: 4 m_Alignment: 4
...@@ -1211,8 +1289,10 @@ RectTransform: ...@@ -1211,8 +1289,10 @@ RectTransform:
m_Children: m_Children:
- {fileID: 1923982258} - {fileID: 1923982258}
- {fileID: 907385372} - {fileID: 907385372}
- {fileID: 1743830524}
- {fileID: 2034269750} - {fileID: 2034269750}
- {fileID: 1191997786} - {fileID: 1191997786}
- {fileID: 1762606595}
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 2 m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
...@@ -1237,10 +1317,11 @@ MonoBehaviour: ...@@ -1237,10 +1317,11 @@ MonoBehaviour:
constraintInput: {fileID: 1145582660} constraintInput: {fileID: 1145582660}
pointsParent: {fileID: 1923982258} pointsParent: {fileID: 1923982258}
linesParent: {fileID: 907385372} linesParent: {fileID: 907385372}
planesParent: {fileID: 1743830524}
constraintParent: {fileID: 2034269750} constraintParent: {fileID: 2034269750}
button: {fileID: 4047237068335015579, guid: 16d81ab5e15a2cb42bfe186b33060b0a, type: 3} button: {fileID: 4047237068335015579, guid: 16d81ab5e15a2cb42bfe186b33060b0a, type: 3}
line: {fileID: 4047237068335015579, guid: 16d81ab5e15a2cb42bfe186b33060b0a, type: 3} line: {fileID: 4047237068335015579, guid: 16d81ab5e15a2cb42bfe186b33060b0a, type: 3}
constraint: {fileID: 4047237068335015579, guid: 16d81ab5e15a2cb42bfe186b33060b0a, constraint: {fileID: 5015797719584156588, guid: 87df886694e27084b8dc7aa9bcadebea,
type: 3} type: 3}
CM: {fileID: 1753994397} CM: {fileID: 1753994397}
--- !u!1 &963007114 --- !u!1 &963007114
...@@ -1715,7 +1796,7 @@ RectTransform: ...@@ -1715,7 +1796,7 @@ RectTransform:
m_Children: m_Children:
- {fileID: 235178998} - {fileID: 235178998}
m_Father: {fileID: 947894779} m_Father: {fileID: 947894779}
m_RootOrder: 3 m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5}
...@@ -1766,7 +1847,7 @@ MonoBehaviour: ...@@ -1766,7 +1847,7 @@ MonoBehaviour:
m_PersistentCalls: m_PersistentCalls:
m_Calls: m_Calls:
- m_Target: {fileID: 1753994397} - m_Target: {fileID: 1753994397}
m_MethodName: calculateDig m_MethodName: test1
m_Mode: 1 m_Mode: 1
m_Arguments: m_Arguments:
m_ObjectArgument: {fileID: 0} m_ObjectArgument: {fileID: 0}
...@@ -2122,7 +2203,7 @@ MonoBehaviour: ...@@ -2122,7 +2203,7 @@ MonoBehaviour:
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_FontSize: 28 m_FontSize: 28
m_FontStyle: 0 m_FontStyle: 0
m_BestFit: 1 m_BestFit: 0
m_MinSize: 2 m_MinSize: 2
m_MaxSize: 40 m_MaxSize: 40
m_Alignment: 4 m_Alignment: 4
...@@ -2131,7 +2212,9 @@ MonoBehaviour: ...@@ -2131,7 +2212,9 @@ MonoBehaviour:
m_HorizontalOverflow: 0 m_HorizontalOverflow: 0
m_VerticalOverflow: 0 m_VerticalOverflow: 0
m_LineSpacing: 1 m_LineSpacing: 1
m_Text: Constraint m_Text: 'Cons-
traint'
--- !u!222 &1564231865 --- !u!222 &1564231865
CanvasRenderer: CanvasRenderer:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
...@@ -2198,10 +2281,10 @@ MonoBehaviour: ...@@ -2198,10 +2281,10 @@ MonoBehaviour:
m_Calls: [] m_Calls: []
m_FontData: m_FontData:
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_FontSize: 14 m_FontSize: 28
m_FontStyle: 0 m_FontStyle: 0
m_BestFit: 1 m_BestFit: 0
m_MinSize: 10 m_MinSize: 2
m_MaxSize: 40 m_MaxSize: 40
m_Alignment: 0 m_Alignment: 0
m_AlignByGeometry: 0 m_AlignByGeometry: 0
...@@ -2296,6 +2379,136 @@ CanvasRenderer: ...@@ -2296,6 +2379,136 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1717302502} m_GameObject: {fileID: 1717302502}
m_CullTransparentMesh: 0 m_CullTransparentMesh: 0
--- !u!1 &1743830523
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1743830524}
- component: {fileID: 1743830527}
- component: {fileID: 1743830526}
- component: {fileID: 1743830525}
m_Layer: 5
m_Name: Plane
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1743830524
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1743830523}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 2069563856}
m_Father: {fileID: 947894779}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: -813, y: 201.7}
m_SizeDelta: {x: 100, y: 100}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1743830525
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1743830523}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Navigation:
m_Mode: 3
m_SelectOnUp: {fileID: 0}
m_SelectOnDown: {fileID: 0}
m_SelectOnLeft: {fileID: 0}
m_SelectOnRight: {fileID: 0}
m_Transition: 1
m_Colors:
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
m_ColorMultiplier: 1
m_FadeDuration: 0.1
m_SpriteState:
m_HighlightedSprite: {fileID: 0}
m_PressedSprite: {fileID: 0}
m_SelectedSprite: {fileID: 0}
m_DisabledSprite: {fileID: 0}
m_AnimationTriggers:
m_NormalTrigger: Normal
m_HighlightedTrigger: Highlighted
m_PressedTrigger: Pressed
m_SelectedTrigger: Selected
m_DisabledTrigger: Disabled
m_Interactable: 1
m_TargetGraphic: {fileID: 1743830526}
m_OnClick:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 947894780}
m_MethodName: createPlaneButton
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
--- !u!114 &1743830526
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1743830523}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0}
m_Type: 1
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!222 &1743830527
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1743830523}
m_CullTransparentMesh: 0
--- !u!1 &1753994396 --- !u!1 &1753994396
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
...@@ -2404,6 +2617,125 @@ MeshFilter: ...@@ -2404,6 +2617,125 @@ MeshFilter:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1753994396} m_GameObject: {fileID: 1753994396}
m_Mesh: {fileID: 0} m_Mesh: {fileID: 0}
--- !u!1 &1762606594
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1762606595}
- component: {fileID: 1762606598}
- component: {fileID: 1762606597}
- component: {fileID: 1762606596}
m_Layer: 5
m_Name: Button
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1762606595
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1762606594}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 617470790}
m_Father: {fileID: 947894779}
m_RootOrder: 5
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 814.4, y: 426.3}
m_SizeDelta: {x: 100, y: 100}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1762606596
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1762606594}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Navigation:
m_Mode: 3
m_SelectOnUp: {fileID: 0}
m_SelectOnDown: {fileID: 0}
m_SelectOnLeft: {fileID: 0}
m_SelectOnRight: {fileID: 0}
m_Transition: 1
m_Colors:
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
m_ColorMultiplier: 1
m_FadeDuration: 0.1
m_SpriteState:
m_HighlightedSprite: {fileID: 0}
m_PressedSprite: {fileID: 0}
m_SelectedSprite: {fileID: 0}
m_DisabledSprite: {fileID: 0}
m_AnimationTriggers:
m_NormalTrigger: Normal
m_HighlightedTrigger: Highlighted
m_PressedTrigger: Pressed
m_SelectedTrigger: Selected
m_DisabledTrigger: Disabled
m_Interactable: 1
m_TargetGraphic: {fileID: 1762606597}
m_OnClick:
m_PersistentCalls:
m_Calls: []
--- !u!114 &1762606597
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1762606594}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0}
m_Type: 1
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!222 &1762606598
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1762606594}
m_CullTransparentMesh: 0
--- !u!1 &1840171051 --- !u!1 &1840171051
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
...@@ -2422,7 +2754,7 @@ GameObject: ...@@ -2422,7 +2754,7 @@ GameObject:
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
m_NavMeshLayer: 0 m_NavMeshLayer: 0
m_StaticEditorFlags: 0 m_StaticEditorFlags: 0
m_IsActive: 1 m_IsActive: 0
--- !u!224 &1840171052 --- !u!224 &1840171052
RectTransform: RectTransform:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
...@@ -2504,6 +2836,26 @@ MonoBehaviour: ...@@ -2504,6 +2836,26 @@ MonoBehaviour:
m_Image: {fileID: 0} m_Image: {fileID: 0}
- m_Text: LineNormalPlane - m_Text: LineNormalPlane
m_Image: {fileID: 0} m_Image: {fileID: 0}
- m_Text: LineParallel
m_Image: {fileID: 0}
- m_Text: LineParallelPlane
m_Image: {fileID: 0}
- m_Text: LineCross
m_Image: {fileID: 0}
- m_Text: MidPoint
m_Image: {fileID: 0}
- m_Text: PointOnLine
m_Image: {fileID: 0}
- m_Text: PointInPlane
m_Image: {fileID: 0}
- m_Text: AngleEqual
m_Image: {fileID: 0}
- m_Text: PlaneParallelPlane
m_Image: {fileID: 0}
- m_Text: PlaneNormalPlane
m_Image: {fileID: 0}
- m_Text: PlaneArea
m_Image: {fileID: 0}
m_OnValueChanged: m_OnValueChanged:
m_PersistentCalls: m_PersistentCalls:
m_Calls: m_Calls:
...@@ -2719,11 +3071,11 @@ RectTransform: ...@@ -2719,11 +3071,11 @@ RectTransform:
- {fileID: 1564231863} - {fileID: 1564231863}
- {fileID: 1840171052} - {fileID: 1840171052}
m_Father: {fileID: 947894779} m_Father: {fileID: 947894779}
m_RootOrder: 2 m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: -813, y: 201.2} m_AnchoredPosition: {x: -813, y: 92.8}
m_SizeDelta: {x: 100, y: 100} m_SizeDelta: {x: 100, y: 100}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &2034269751 --- !u!114 &2034269751
...@@ -2817,3 +3169,81 @@ CanvasRenderer: ...@@ -2817,3 +3169,81 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2034269749} m_GameObject: {fileID: 2034269749}
m_CullTransparentMesh: 0 m_CullTransparentMesh: 0
--- !u!1 &2069563855
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2069563856}
- component: {fileID: 2069563858}
- component: {fileID: 2069563857}
m_Layer: 5
m_Name: Text
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &2069563856
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2069563855}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1743830524}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &2069563857
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2069563855}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
m_RaycastTarget: 1
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_FontData:
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_FontSize: 28
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 2
m_MaxSize: 40
m_Alignment: 4
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: Plane
--- !u!222 &2069563858
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2069563855}
m_CullTransparentMesh: 0
...@@ -16,7 +16,8 @@ public enum ConstraintType ...@@ -16,7 +16,8 @@ public enum ConstraintType
PointInPlane, PointInPlane,
AngleEqual, AngleEqual,
PlaneParallelPlane, PlaneParallelPlane,
PlaneNormalPlane PlaneNormalPlane,
PlaneArea
} }
public class Constraint public class Constraint
{ {
...@@ -35,8 +36,11 @@ public class Constraint ...@@ -35,8 +36,11 @@ public class Constraint
Object2 = obj2; Object2 = obj2;
constraintType = type; constraintType = type;
Point p = null;
Line l1 = null; Line l1 = null;
Line l2 = null; Line l2 = null;
Plane p1 = null;
Plane p2 = null;
float length = 0; float length = 0;
switch (type) switch (type)
...@@ -64,6 +68,62 @@ public class Constraint ...@@ -64,6 +68,62 @@ public class Constraint
l2.setConstraint(this); l2.setConstraint(this);
name = l1.name + "⊥" + l2.name; name = l1.name + "⊥" + l2.name;
break; break;
case ConstraintType.LineParallel:
l1 = (Line)obj1;
l2 = (Line)obj2;
l1.setConstraint(this);
l2.setConstraint(this);
name = l1.name + "∥" + l2.name;
break;
case ConstraintType.LineParallelPlane:
l1 = (Line)obj1;
p1 = (Plane)obj2;
l1.setConstraint(this);
//p1.setConstraint(this);
name = l1.name + "∥" + p1.name;
break;
case ConstraintType.LineCross:
l1 = (Line)obj1;
l2 = (Line)obj2;
l1.setConstraint(this);
l2.setConstraint(this);
name = l1.name + "∩" + l2.name;
break;
case ConstraintType.MidPoint:
l1 = (Line)obj1;
p = (Point)obj2;
l1.setConstraint(this);
//p.setConstraint(this);
name = l1.name + "中点" + p.name;
break;
case ConstraintType.PointOnLine:
break;
case ConstraintType.PointInPlane:
break;
case ConstraintType.AngleEqual:
break;
case ConstraintType.PlaneParallelPlane:
p1 = (Plane)obj1;
p2 = (Plane)obj2;
//p1.setConstraint(this);
//p2.setConstraint(this);
name = p1.name + "∥" + p2.name;
break;
case ConstraintType.PlaneNormalPlane:
p1 = (Plane)obj1;
p2 = (Plane)obj2;
//p1.setConstraint(this);
//p2.setConstraint(this);
name = p1.name + "⊥" + p2.name;
break;
case ConstraintType.PlaneArea:
break;
} }
} }
......
...@@ -4,15 +4,19 @@ using UnityEngine; ...@@ -4,15 +4,19 @@ using UnityEngine;
public class Plane public class Plane
{ {
public string name;
List<Point> points; List<Point> points;
public Vector3 normal; public Vector3 normal;
public Plane(List<Point> ps) public Plane(List<Point> ps)
{ {
name = "";
points = new List<Point>(); points = new List<Point>();
foreach(Point p in ps) foreach(Point p in ps)
{ {
points.Add(p); points.Add(p);
name += p.name;
} }
updateNormal(); updateNormal();
...@@ -47,7 +51,7 @@ public class Plane ...@@ -47,7 +51,7 @@ public class Plane
break; break;
} }
} }
if (flag) if (flag && normals.Count != 0)
{ {
normal = normals[0]; normal = normals[0];
} }
......
...@@ -7,6 +7,7 @@ public class CanvasManager3D : MonoBehaviour ...@@ -7,6 +7,7 @@ public class CanvasManager3D : MonoBehaviour
{ {
Dictionary<string, Point> points; Dictionary<string, Point> points;
Dictionary<string, Line> lines; Dictionary<string, Line> lines;
Dictionary<string, Plane> planes;
List<Vector> vectors; List<Vector> vectors;
List<Angle> angles; List<Angle> angles;
...@@ -17,6 +18,7 @@ public class CanvasManager3D : MonoBehaviour ...@@ -17,6 +18,7 @@ public class CanvasManager3D : MonoBehaviour
{ {
points = new Dictionary<string, Point>(); points = new Dictionary<string, Point>();
lines = new Dictionary<string, Line>(); lines = new Dictionary<string, Line>();
planes = new Dictionary<string, Plane>();
vectors = new List<Vector>(); vectors = new List<Vector>();
angles = new List<Angle>(); angles = new List<Angle>();
...@@ -24,6 +26,7 @@ public class CanvasManager3D : MonoBehaviour ...@@ -24,6 +26,7 @@ public class CanvasManager3D : MonoBehaviour
} }
public void calculateDig() public void calculateDig()
{ {
float startTime = Time.realtimeSinceStartup;
Point first = null; Point first = null;
if(points.Count != 0) if(points.Count != 0)
{ {
...@@ -109,13 +112,19 @@ public class CanvasManager3D : MonoBehaviour ...@@ -109,13 +112,19 @@ public class CanvasManager3D : MonoBehaviour
foreach (Constraint c in calculates) foreach (Constraint c in calculates)
{ {
c.setState(State.halfconfirm); c.setState(State.halfconfirm);
} }
restPoint.Dequeue();
restPoint.Enqueue(tmp);
}
else
{
tmp.setState(State.confirm);
restPoint.Dequeue();
usedPoint.Add(tmp);
} }
} }
restPoint.Dequeue();
restPoint.Enqueue(tmp);
} }
else if (check == 2) else if (check == 2)
{ {
...@@ -150,6 +159,9 @@ public class CanvasManager3D : MonoBehaviour ...@@ -150,6 +159,9 @@ public class CanvasManager3D : MonoBehaviour
PrintPoints(); PrintPoints();
isFin = true; isFin = true;
float endTime = Time.realtimeSinceStartup;
Debug.Log(endTime - startTime);
} }
public string createPoint(string name = "") public string createPoint(string name = "")
...@@ -229,6 +241,46 @@ public class CanvasManager3D : MonoBehaviour ...@@ -229,6 +241,46 @@ public class CanvasManager3D : MonoBehaviour
return ""; return "";
} }
public string createPlane(string n1, string n2)
{
List<Point> ps = new List<Point>();
Line line = null;
lines.TryGetValue(n1, out line);
if (line != null)
{
if(!ps.Contains(line.point1))
ps.Add(line.point1);
if (!ps.Contains(line.point2))
ps.Add(line.point2);
}
else
return "";
lines.TryGetValue(n2, out line);
if (line != null)
{
if (!ps.Contains(line.point1))
ps.Add(line.point1);
if (!ps.Contains(line.point2))
ps.Add(line.point2); ;
}
else
return "";
Plane plane = new Plane(ps);
string planeName = "";
foreach (Point p in ps)
{
planeName += p.name;
}
planes.Add(planeName, plane);
return planeName;
}
public void setLine(string n, float length) public void setLine(string n, float length)
{ {
Line l1 = null; Line l1 = null;
...@@ -250,6 +302,15 @@ public class CanvasManager3D : MonoBehaviour ...@@ -250,6 +302,15 @@ public class CanvasManager3D : MonoBehaviour
return l1; return l1;
} }
public Plane GetPlane(string n)
{
Plane p = null;
planes.TryGetValue(n, out p);
return p;
}
public List<Line> GetLines() public List<Line> GetLines()
{ {
List<Line> tmp = new List<Line>(); List<Line> tmp = new List<Line>();
...@@ -287,7 +348,7 @@ public class CanvasManager3D : MonoBehaviour ...@@ -287,7 +348,7 @@ public class CanvasManager3D : MonoBehaviour
bool flag = true; bool flag = true;
foreach(Constraint c in constraint) foreach(Constraint c in constraint)
{ {
if(Mathf.Abs(c.getConstraintValue()) > 0.000001f) if(Mathf.Abs(c.getConstraintValue()) > 0.001f)
{ {
flag = false; flag = false;
break; break;
...@@ -295,4 +356,38 @@ public class CanvasManager3D : MonoBehaviour ...@@ -295,4 +356,38 @@ public class CanvasManager3D : MonoBehaviour
} }
return flag; return flag;
} }
public void test1(){
points.Clear();
lines.Clear();
Point a = new Point(0, 1, 0);
Point b = new Point(0, 0, 0);
Point c = new Point(1, 0, 0);
//Point d = new Point(1, 1, 0);
//Point e = new Point(0.5f, 1, 0.5f);
//Point f = new Point(0.5f, 0, 0);
//Point g = new Point(0.25f, 1, 0.25f);
points.Add("A", a);
points.Add("B", b);
points.Add("C", c);
//points.Add("D", d);
//points.Add("E", e);
//points.Add("F", f);
//points.Add("G", g);
lines.Add("AB", new Line(a, b));
lines.Add("BC", new Line(b, c));
//lines.Add("CD", new Line(c, d));
//lines.Add("AD", new Line(a, d));
//lines.Add("AE", new Line(a, e));
//lines.Add("DE", new Line(d, e));
//lines.Add("CE", new Line(c, e));
//lines.Add("FG", new Line(f, g));
isFin = true;
}
} }
...@@ -7,6 +7,7 @@ public class UIManager : MonoBehaviour ...@@ -7,6 +7,7 @@ public class UIManager : MonoBehaviour
{ {
List<GameObject> points; List<GameObject> points;
List<GameObject> lines; List<GameObject> lines;
List<GameObject> planes;
List<GameObject> constraints; List<GameObject> constraints;
public GameObject constraintDropdown; public GameObject constraintDropdown;
...@@ -14,6 +15,7 @@ public class UIManager : MonoBehaviour ...@@ -14,6 +15,7 @@ public class UIManager : MonoBehaviour
public Transform pointsParent; public Transform pointsParent;
public Transform linesParent; public Transform linesParent;
public Transform planesParent;
public Transform constraintParent; public Transform constraintParent;
public GameObject button; public GameObject button;
...@@ -29,9 +31,20 @@ public class UIManager : MonoBehaviour ...@@ -29,9 +31,20 @@ public class UIManager : MonoBehaviour
{ {
none, none,
createLine, createLine,
createPlane,
linelength, linelength,
lineEqual, lineEqual,
lineNormal lineNormal,
lineParallel,
lineParallelPlane,
lineCross,
midPoint,
pointOnLine,
pointInPlane,
angleEqual,
planeParallelPlane,
planeNormalPlane,
planeArea
} }
UIState state = UIState.none; UIState state = UIState.none;
...@@ -41,6 +54,7 @@ public class UIManager : MonoBehaviour ...@@ -41,6 +54,7 @@ public class UIManager : MonoBehaviour
{ {
points = new List<GameObject>(); points = new List<GameObject>();
lines = new List<GameObject>(); lines = new List<GameObject>();
planes = new List<GameObject>();
constraints = new List<GameObject>(); constraints = new List<GameObject>();
} }
...@@ -57,24 +71,36 @@ public class UIManager : MonoBehaviour ...@@ -57,24 +71,36 @@ public class UIManager : MonoBehaviour
createLine(); createLine();
} }
break; break;
case UIState.linelength: case UIState.createPlane:
if (!chosen1.Equals("") && !constraintInput.GetComponent<InputField>().text.Equals("")) if (!chosen1.Equals("") && !chosen2.Equals(""))
{ {
createConstraint(); createPlane();
} }
break; break;
case UIState.lineEqual: case UIState.linelength:
if (!chosen1.Equals("") && !chosen2.Equals("")) case UIState.angleEqual:
case UIState.planeArea:
if (!chosen1.Equals("") && !constraintInput.GetComponent<InputField>().text.Equals(""))
{ {
createConstraint(); createConstraint();
} }
break; break;
case UIState.lineEqual:
case UIState.lineNormal: case UIState.lineNormal:
if (!chosen1.Equals("") && !chosen2.Equals("")) case UIState.lineParallel:
case UIState.lineParallelPlane:
case UIState.lineCross:
case UIState.midPoint:
case UIState.pointOnLine:
case UIState.pointInPlane:
case UIState.planeParallelPlane:
case UIState.planeNormalPlane:
if (!chosen1.Equals("") && !chosen2.Equals(""))
{ {
createConstraint(); createConstraint();
} }
break; break;
} }
} }
...@@ -108,6 +134,25 @@ public class UIManager : MonoBehaviour ...@@ -108,6 +134,25 @@ public class UIManager : MonoBehaviour
state = UIState.none; state = UIState.none;
} }
public void createPlaneButton()
{
state = UIState.createPlane;
}
void createPlane()
{
string n = CM.createPlane(chosen1, chosen2);
chosen1 = "";
chosen2 = "";
GameObject tmp = Instantiate(line);
tmp.transform.SetParent(planesParent);
planes.Add(tmp);
tmp.transform.localPosition = new Vector3(100 + 70 * (planes.Count - 1), 0, 0);
tmp.GetComponentInChildren<Text>().text = n;
tmp.GetComponent<Button>().onClick.AddListener(delegate () { chooseObject(n); });
state = UIState.none;
}
public void chooseObject(string obj) public void chooseObject(string obj)
{ {
if(state != UIState.none) if(state != UIState.none)
...@@ -137,6 +182,7 @@ public class UIManager : MonoBehaviour ...@@ -137,6 +182,7 @@ public class UIManager : MonoBehaviour
public void constraintDropdownChange() public void constraintDropdownChange()
{ {
string text = constraintDropdown.GetComponent<Dropdown>().captionText.text; string text = constraintDropdown.GetComponent<Dropdown>().captionText.text;
if (text.Equals("None")) return;
ConstraintType type = (ConstraintType)System.Enum.Parse(typeof(ConstraintType), text); ConstraintType type = (ConstraintType)System.Enum.Parse(typeof(ConstraintType), text);
switch (type) switch (type)
{ {
...@@ -150,14 +196,50 @@ public class UIManager : MonoBehaviour ...@@ -150,14 +196,50 @@ public class UIManager : MonoBehaviour
case ConstraintType.LineNormal: case ConstraintType.LineNormal:
state = UIState.lineNormal; state = UIState.lineNormal;
break; break;
case ConstraintType.LineParallel:
state = UIState.lineParallel;
break;
case ConstraintType.LineParallelPlane:
state = UIState.lineParallelPlane;
break;
case ConstraintType.LineCross:
state = UIState.lineCross;
break;
case ConstraintType.MidPoint:
state = UIState.midPoint;
break;
case ConstraintType.PointOnLine:
state = UIState.pointOnLine;
break;
case ConstraintType.PointInPlane:
state = UIState.pointInPlane;
break;
case ConstraintType.AngleEqual:
state = UIState.angleEqual;
break;
case ConstraintType.PlaneParallelPlane:
state = UIState.planeParallelPlane;
break;
case ConstraintType.PlaneNormalPlane:
state = UIState.planeNormalPlane;
break;
case ConstraintType.PlaneArea:
state = UIState.planeArea;
constraintInput.SetActive(true);
break;
} }
} }
void createConstraint() void createConstraint()
{ {
Point p = null;
Line l1 = null; Line l1 = null;
Line l2 = null; Line l2 = null;
Plane p1 = null;
Plane p2 = null;
float length; float length;
string n = ""; string n = "";
...@@ -178,18 +260,53 @@ public class UIManager : MonoBehaviour ...@@ -178,18 +260,53 @@ public class UIManager : MonoBehaviour
l1 = CM.GetLine(chosen1); l1 = CM.GetLine(chosen1);
l2 = CM.GetLine(chosen2); l2 = CM.GetLine(chosen2);
n = CM.createConstraint(l1, l2, ConstraintType.LineNormal); n = CM.createConstraint(l1, l2, ConstraintType.LineNormal);
break; break;
case UIState.lineParallel:
l1 = CM.GetLine(chosen1);
l2 = CM.GetLine(chosen2);
n = CM.createConstraint(l1, l2, ConstraintType.LineParallel);
break;
case UIState.lineParallelPlane:
l1 = CM.GetLine(chosen1);
p1 = CM.GetPlane(chosen2);
n = CM.createConstraint(l1, p1, ConstraintType.LineParallelPlane);
break;
case UIState.lineCross:
l1 = CM.GetLine(chosen1);
l2 = CM.GetLine(chosen2);
n = CM.createConstraint(l1, l2, ConstraintType.LineCross);
break;
case UIState.midPoint:
l1 = CM.GetLine(chosen1);
p = CM.GetPoint(chosen2);
n = CM.createConstraint(l1, p, ConstraintType.MidPoint);
break;
case UIState.planeParallelPlane:
p1 = CM.GetPlane(chosen1);
p2 = CM.GetPlane(chosen2);
n = CM.createConstraint(p1, p2, ConstraintType.PlaneParallelPlane);
break;
case UIState.planeNormalPlane:
p1 = CM.GetPlane(chosen1);
p2 = CM.GetPlane(chosen2);
n = CM.createConstraint(p1, p2, ConstraintType.PlaneNormalPlane);
break;
case UIState.angleEqual:
case UIState.planeArea:
case UIState.pointOnLine:
case UIState.pointInPlane:
break;
} }
chosen1 = ""; chosen1 = "";
chosen2 = ""; chosen2 = "";
GameObject tmp = Instantiate(line); GameObject tmp = Instantiate(constraint);
tmp.transform.SetParent(constraintParent); tmp.transform.SetParent(constraintParent);
constraints.Add(tmp); constraints.Add(tmp);
tmp.transform.localPosition = new Vector3(100 + 70 * (constraints.Count - 1), 0, 0); tmp.transform.localPosition = new Vector3(150 + 165 * (constraints.Count - 1), 0, 0);
tmp.GetComponentInChildren<Text>().text = n; tmp.GetComponentInChildren<Text>().text = n;
state = UIState.none; state = UIState.none;
constraintDropdown.GetComponent<Dropdown>().captionText.text = "None"; constraintDropdown.GetComponent<Dropdown>().captionText.text = "None";
constraintDropdown.GetComponent<Dropdown>().value = 0;
constraintDropdown.SetActive(false); constraintDropdown.SetActive(false);
} }
} }
...@@ -25,11 +25,11 @@ public class test : MonoBehaviour ...@@ -25,11 +25,11 @@ public class test : MonoBehaviour
if(lines.Count != 0) if(lines.Count != 0)
{ {
Vector3[] vertices = new Vector3[lines.Count * 4]; Vector3[] vertices = new Vector3[lines.Count * 4];
Vector3 offset = Camera.main.transform.up * width;
int k = 0; int k = 0;
foreach (Line l in lines) foreach (Line l in lines)
{ {
Vector3 offset = Vector3.Cross(Camera.main.transform.forward, l.direction).normalized * width;
Vector3 tmp1 = new Vector3(l.point1.x, l.point1.y, l.point1.z); Vector3 tmp1 = new Vector3(l.point1.x, l.point1.y, l.point1.z);
Vector3 tmp2 = new Vector3(l.point2.x, l.point2.y, l.point2.z); Vector3 tmp2 = new Vector3(l.point2.x, l.point2.y, l.point2.z);
vertices[k] = tmp1 + offset; vertices[k] = tmp1 + offset;
......
No preview for this file type
File deleted
File deleted
File deleted
File deleted
File deleted
File deleted
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment