Commit 20faca7d authored by JiangWanZhi's avatar JiangWanZhi

修改一下缩放,拖动的逻辑

parent 914f895e
...@@ -101,18 +101,18 @@ RectTransform: ...@@ -101,18 +101,18 @@ RectTransform:
m_PrefabInstance: {fileID: 0} m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 165307577509819478} m_GameObject: {fileID: 165307577509819478}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: [] m_Children: []
m_Father: {fileID: 1633357141748549960} m_Father: {fileID: 7778848243247776032}
m_RootOrder: -1 m_RootOrder: -1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0.5} m_AnchorMin: {x: 0, y: 0.5}
m_AnchorMax: {x: 1, y: 0.5} m_AnchorMax: {x: 1, y: 0.5}
m_AnchoredPosition: {x: -41, y: -1582} m_AnchoredPosition: {x: -41, y: -1302.4723}
m_SizeDelta: {x: 0, y: 800} m_SizeDelta: {x: 0, y: 1234.2775}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &1520829811932201433 --- !u!222 &1520829811932201433
CanvasRenderer: CanvasRenderer:
...@@ -280,11 +280,10 @@ RectTransform: ...@@ -280,11 +280,10 @@ RectTransform:
- {fileID: 9202005404466210624} - {fileID: 9202005404466210624}
- {fileID: 3684281432546734940} - {fileID: 3684281432546734940}
- {fileID: 2488998574890369715} - {fileID: 2488998574890369715}
- {fileID: 216671789900275948}
- {fileID: 4207755507653322023}
- {fileID: 7778848243247776032} - {fileID: 7778848243247776032}
- {fileID: 4930126960711289547} - {fileID: 4930126960711289547}
- {fileID: 4350987738922043080} - {fileID: 4350987738922043080}
- {fileID: 2225806379496700186}
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: -1 m_RootOrder: -1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
...@@ -595,6 +594,46 @@ MonoBehaviour: ...@@ -595,6 +594,46 @@ MonoBehaviour:
m_FillOrigin: 0 m_FillOrigin: 0
m_UseSpriteMesh: 0 m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1 m_PixelsPerUnitMultiplier: 1
--- !u!1 &615370486041879482
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2225806379496700186}
m_Layer: 5
m_Name: GameArea
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &2225806379496700186
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 615370486041879482}
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_ConstrainProportionsScale: 0
m_Children:
- {fileID: 3935196267496203719}
- {fileID: 4587279003709612060}
- {fileID: 6771378527872526214}
- {fileID: 2406719830949511634}
m_Father: {fileID: 1633357141748549960}
m_RootOrder: -1
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!1 &873009014252909700 --- !u!1 &873009014252909700
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
...@@ -1022,12 +1061,12 @@ RectTransform: ...@@ -1022,12 +1061,12 @@ RectTransform:
- {fileID: 3345813486746951798} - {fileID: 3345813486746951798}
- {fileID: 161008593911248317} - {fileID: 161008593911248317}
- {fileID: 1976999355571500960} - {fileID: 1976999355571500960}
m_Father: {fileID: 1633357141748549960} m_Father: {fileID: 7778848243247776032}
m_RootOrder: -1 m_RootOrder: -1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0} m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0} m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: 348} m_AnchoredPosition: {x: 0, y: 100}
m_SizeDelta: {x: 750, y: 25} m_SizeDelta: {x: 750, y: 25}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1036549963076789408 --- !u!114 &1036549963076789408
...@@ -1270,6 +1309,42 @@ MonoBehaviour: ...@@ -1270,6 +1309,42 @@ MonoBehaviour:
m_hasFontAssetChanged: 0 m_hasFontAssetChanged: 0
m_baseMaterial: {fileID: 0} m_baseMaterial: {fileID: 0}
m_maskOffset: {x: 0, y: 0, z: 0, w: 0} m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
--- !u!1 &2666167341498499835
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 3935196267496203719}
m_Layer: 5
m_Name: Pos_Left_Up
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &3935196267496203719
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2666167341498499835}
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_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 2225806379496700186}
m_RootOrder: -1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!1 &2929582902800575783 --- !u!1 &2929582902800575783
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
...@@ -2500,6 +2575,42 @@ MonoBehaviour: ...@@ -2500,6 +2575,42 @@ MonoBehaviour:
m_FillOrigin: 0 m_FillOrigin: 0
m_UseSpriteMesh: 0 m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1 m_PixelsPerUnitMultiplier: 1
--- !u!1 &5586756016372078258
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2406719830949511634}
m_Layer: 5
m_Name: Pos_Left_Down
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &2406719830949511634
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5586756016372078258}
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_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 2225806379496700186}
m_RootOrder: -1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 270}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!1 &5697974217771189481 --- !u!1 &5697974217771189481
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
...@@ -3554,8 +3665,10 @@ RectTransform: ...@@ -3554,8 +3665,10 @@ RectTransform:
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: m_Children:
- {fileID: 216671789900275948}
- {fileID: 1682976293997861255} - {fileID: 1682976293997861255}
- {fileID: 9072884845680009661} - {fileID: 9072884845680009661}
- {fileID: 4207755507653322023}
m_Father: {fileID: 1633357141748549960} m_Father: {fileID: 1633357141748549960}
m_RootOrder: -1 m_RootOrder: -1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
...@@ -3859,6 +3972,42 @@ MonoBehaviour: ...@@ -3859,6 +3972,42 @@ MonoBehaviour:
m_hasFontAssetChanged: 0 m_hasFontAssetChanged: 0
m_baseMaterial: {fileID: 0} m_baseMaterial: {fileID: 0}
m_maskOffset: {x: 0, y: 0, z: 0, w: 0} m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
--- !u!1 &8764365333959496128
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4587279003709612060}
m_Layer: 5
m_Name: Pos_Right_Up
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &4587279003709612060
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8764365333959496128}
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_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 2225806379496700186}
m_RootOrder: -1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 1, y: 1}
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!1 &8896268844625087083 --- !u!1 &8896268844625087083
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
...@@ -4107,6 +4256,42 @@ MonoBehaviour: ...@@ -4107,6 +4256,42 @@ MonoBehaviour:
m_hasFontAssetChanged: 0 m_hasFontAssetChanged: 0
m_baseMaterial: {fileID: 0} m_baseMaterial: {fileID: 0}
m_maskOffset: {x: 0, y: 0, z: 0, w: 0} m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
--- !u!1 &9139019227740239578
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 6771378527872526214}
m_Layer: 5
m_Name: Pos_Right_Down
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &6771378527872526214
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 9139019227740239578}
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_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 2225806379496700186}
m_RootOrder: -1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 1, y: 0}
m_AnchorMax: {x: 1, y: 0}
m_AnchoredPosition: {x: 0, y: 270}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!1001 &157988101985480200 --- !u!1001 &157988101985480200
PrefabInstance: PrefabInstance:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
......
...@@ -174,7 +174,7 @@ MonoBehaviour: ...@@ -174,7 +174,7 @@ MonoBehaviour:
m_SelectOnDown: {fileID: 0} m_SelectOnDown: {fileID: 0}
m_SelectOnLeft: {fileID: 0} m_SelectOnLeft: {fileID: 0}
m_SelectOnRight: {fileID: 0} m_SelectOnRight: {fileID: 0}
m_Transition: 0 m_Transition: 1
m_Colors: m_Colors:
m_NormalColor: {r: 1, g: 1, b: 1, a: 1} m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
......
...@@ -123,6 +123,11 @@ NavMeshSettings: ...@@ -123,6 +123,11 @@ NavMeshSettings:
debug: debug:
m_Flags: 0 m_Flags: 0
m_NavMeshData: {fileID: 0} m_NavMeshData: {fileID: 0}
--- !u!224 &47226757 stripped
RectTransform:
m_CorrespondingSourceObject: {fileID: 832333741895004512, guid: e2f00cfdb21d04b46adf17805f74f20c, type: 3}
m_PrefabInstance: {fileID: 1821187684178258737}
m_PrefabAsset: {fileID: 0}
--- !u!1 &92769422 --- !u!1 &92769422
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
...@@ -263,7 +268,7 @@ Camera: ...@@ -263,7 +268,7 @@ Camera:
width: 1 width: 1
height: 1 height: 1
near clip plane: 0.3 near clip plane: 0.3
far clip plane: 1000 far clip plane: 100000
field of view: 60 field of view: 60
orthographic: 1 orthographic: 1
orthographic size: 5 orthographic size: 5
...@@ -290,11 +295,10 @@ Transform: ...@@ -290,11 +295,10 @@ Transform:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 297775245} m_GameObject: {fileID: 297775245}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: -10} m_LocalPosition: {x: 0, y: 0, z: -69.8}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: m_Children: []
- {fileID: 1474894691}
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 0 m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
...@@ -363,6 +367,11 @@ MonoBehaviour: ...@@ -363,6 +367,11 @@ MonoBehaviour:
MaxScale: 8 MaxScale: 8
Min_Move: 0.5 Min_Move: 0.5
Max_Move: 10 Max_Move: 10
AreaPoint_Right_Up: {fileID: 1064148216}
AreaPoint_Left_Down: {fileID: 1090237499}
TipBtn: {fileID: 1821187684178258741}
AutoBtn: {fileID: 47226757}
CloseBtn: {fileID: 669974489}
--- !u!224 &464840817 stripped --- !u!224 &464840817 stripped
RectTransform: RectTransform:
m_CorrespondingSourceObject: {fileID: 4930126960711289547, guid: e2f00cfdb21d04b46adf17805f74f20c, type: 3} m_CorrespondingSourceObject: {fileID: 4930126960711289547, guid: e2f00cfdb21d04b46adf17805f74f20c, type: 3}
...@@ -434,8 +443,23 @@ Transform: ...@@ -434,8 +443,23 @@ Transform:
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: [] m_Children: []
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 1 m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!224 &669974489 stripped
RectTransform:
m_CorrespondingSourceObject: {fileID: 5446485606855009903, guid: e2f00cfdb21d04b46adf17805f74f20c, type: 3}
m_PrefabInstance: {fileID: 1821187684178258737}
m_PrefabAsset: {fileID: 0}
--- !u!224 &1064148216 stripped
RectTransform:
m_CorrespondingSourceObject: {fileID: 4587279003709612060, guid: e2f00cfdb21d04b46adf17805f74f20c, type: 3}
m_PrefabInstance: {fileID: 1821187684178258737}
m_PrefabAsset: {fileID: 0}
--- !u!224 &1090237499 stripped
RectTransform:
m_CorrespondingSourceObject: {fileID: 2406719830949511634, guid: e2f00cfdb21d04b46adf17805f74f20c, type: 3}
m_PrefabInstance: {fileID: 1821187684178258737}
m_PrefabAsset: {fileID: 0}
--- !u!1 &1329740667 --- !u!1 &1329740667
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
...@@ -512,11 +536,6 @@ CanvasRenderer: ...@@ -512,11 +536,6 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1329740667} m_GameObject: {fileID: 1329740667}
m_CullTransparentMesh: 1 m_CullTransparentMesh: 1
--- !u!224 &1474894691 stripped
RectTransform:
m_CorrespondingSourceObject: {fileID: 1633357141748549960, guid: e2f00cfdb21d04b46adf17805f74f20c, type: 3}
m_PrefabInstance: {fileID: 1821187684178258737}
m_PrefabAsset: {fileID: 0}
--- !u!1 &1643100473 --- !u!1 &1643100473
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
...@@ -680,7 +699,7 @@ PrefabInstance: ...@@ -680,7 +699,7 @@ PrefabInstance:
serializedVersion: 2 serializedVersion: 2
m_Modification: m_Modification:
serializedVersion: 3 serializedVersion: 3
m_TransformParent: {fileID: 297775248} m_TransformParent: {fileID: 0}
m_Modifications: m_Modifications:
- target: {fileID: 46365302489525420, guid: e2f00cfdb21d04b46adf17805f74f20c, type: 3} - target: {fileID: 46365302489525420, guid: e2f00cfdb21d04b46adf17805f74f20c, type: 3}
propertyPath: m_Layer propertyPath: m_Layer
...@@ -736,7 +755,7 @@ PrefabInstance: ...@@ -736,7 +755,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 216671789900275948, guid: e2f00cfdb21d04b46adf17805f74f20c, type: 3} - target: {fileID: 216671789900275948, guid: e2f00cfdb21d04b46adf17805f74f20c, type: 3}
propertyPath: m_AnchoredPosition.y propertyPath: m_AnchoredPosition.y
value: -707 value: -128
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 282682974999690270, guid: e2f00cfdb21d04b46adf17805f74f20c, type: 3} - target: {fileID: 282682974999690270, guid: e2f00cfdb21d04b46adf17805f74f20c, type: 3}
propertyPath: m_Sprite propertyPath: m_Sprite
...@@ -1006,6 +1025,18 @@ PrefabInstance: ...@@ -1006,6 +1025,18 @@ PrefabInstance:
propertyPath: m_RenderMode propertyPath: m_RenderMode
value: 1 value: 1
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 1237637097486733067, guid: e2f00cfdb21d04b46adf17805f74f20c, type: 3}
propertyPath: m_PixelPerfect
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1237637097486733067, guid: e2f00cfdb21d04b46adf17805f74f20c, type: 3}
propertyPath: m_PlaneDistance
value: 100
objectReference: {fileID: 0}
- target: {fileID: 1237637097486733067, guid: e2f00cfdb21d04b46adf17805f74f20c, type: 3}
propertyPath: m_SortingLayerID
value: -230597399
objectReference: {fileID: 0}
- target: {fileID: 1345706252318982597, guid: e2f00cfdb21d04b46adf17805f74f20c, type: 3} - target: {fileID: 1345706252318982597, guid: e2f00cfdb21d04b46adf17805f74f20c, type: 3}
propertyPath: m_Size propertyPath: m_Size
value: 1 value: 1
...@@ -1028,7 +1059,7 @@ PrefabInstance: ...@@ -1028,7 +1059,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 1633357141748549960, guid: e2f00cfdb21d04b46adf17805f74f20c, type: 3} - target: {fileID: 1633357141748549960, guid: e2f00cfdb21d04b46adf17805f74f20c, type: 3}
propertyPath: m_RootOrder propertyPath: m_RootOrder
value: -1 value: 1
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 1633357141748549960, guid: e2f00cfdb21d04b46adf17805f74f20c, type: 3} - target: {fileID: 1633357141748549960, guid: e2f00cfdb21d04b46adf17805f74f20c, type: 3}
propertyPath: m_AnchorMax.x propertyPath: m_AnchorMax.x
...@@ -1576,7 +1607,7 @@ PrefabInstance: ...@@ -1576,7 +1607,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 4207755507653322023, guid: e2f00cfdb21d04b46adf17805f74f20c, type: 3} - target: {fileID: 4207755507653322023, guid: e2f00cfdb21d04b46adf17805f74f20c, type: 3}
propertyPath: m_AnchorMax.y propertyPath: m_AnchorMax.y
value: 0 value: 0.5
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 4207755507653322023, guid: e2f00cfdb21d04b46adf17805f74f20c, type: 3} - target: {fileID: 4207755507653322023, guid: e2f00cfdb21d04b46adf17805f74f20c, type: 3}
propertyPath: m_AnchorMin.x propertyPath: m_AnchorMin.x
...@@ -1584,7 +1615,7 @@ PrefabInstance: ...@@ -1584,7 +1615,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 4207755507653322023, guid: e2f00cfdb21d04b46adf17805f74f20c, type: 3} - target: {fileID: 4207755507653322023, guid: e2f00cfdb21d04b46adf17805f74f20c, type: 3}
propertyPath: m_AnchorMin.y propertyPath: m_AnchorMin.y
value: 0 value: 0.5
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 4207755507653322023, guid: e2f00cfdb21d04b46adf17805f74f20c, type: 3} - target: {fileID: 4207755507653322023, guid: e2f00cfdb21d04b46adf17805f74f20c, type: 3}
propertyPath: m_SizeDelta.x propertyPath: m_SizeDelta.x
...@@ -1596,7 +1627,7 @@ PrefabInstance: ...@@ -1596,7 +1627,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 4207755507653322023, guid: e2f00cfdb21d04b46adf17805f74f20c, type: 3} - target: {fileID: 4207755507653322023, guid: e2f00cfdb21d04b46adf17805f74f20c, type: 3}
propertyPath: m_AnchoredPosition.y propertyPath: m_AnchoredPosition.y
value: 348 value: 100
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 4231459619420674691, guid: e2f00cfdb21d04b46adf17805f74f20c, type: 3} - target: {fileID: 4231459619420674691, guid: e2f00cfdb21d04b46adf17805f74f20c, type: 3}
propertyPath: m_Color.a propertyPath: m_Color.a
...@@ -1696,15 +1727,15 @@ PrefabInstance: ...@@ -1696,15 +1727,15 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 5145632994799020238, guid: e2f00cfdb21d04b46adf17805f74f20c, type: 3} - target: {fileID: 5145632994799020238, guid: e2f00cfdb21d04b46adf17805f74f20c, type: 3}
propertyPath: m_SizeDelta.y propertyPath: m_SizeDelta.y
value: 5 value: -30
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 5145632994799020238, guid: e2f00cfdb21d04b46adf17805f74f20c, type: 3} - target: {fileID: 5145632994799020238, guid: e2f00cfdb21d04b46adf17805f74f20c, type: 3}
propertyPath: m_AnchoredPosition.x propertyPath: m_AnchoredPosition.x
value: 0 value: -0.000030517578
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 5145632994799020238, guid: e2f00cfdb21d04b46adf17805f74f20c, type: 3} - target: {fileID: 5145632994799020238, guid: e2f00cfdb21d04b46adf17805f74f20c, type: 3}
propertyPath: m_AnchoredPosition.y propertyPath: m_AnchoredPosition.y
value: 0 value: -35
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 5179610333064401809, guid: e2f00cfdb21d04b46adf17805f74f20c, type: 3} - target: {fileID: 5179610333064401809, guid: e2f00cfdb21d04b46adf17805f74f20c, type: 3}
propertyPath: m_Layer propertyPath: m_Layer
...@@ -1884,7 +1915,7 @@ PrefabInstance: ...@@ -1884,7 +1915,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 5970386083598165497, guid: e2f00cfdb21d04b46adf17805f74f20c, type: 3} - target: {fileID: 5970386083598165497, guid: e2f00cfdb21d04b46adf17805f74f20c, type: 3}
propertyPath: m_AnchorMax.y propertyPath: m_AnchorMax.y
value: 1 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 5970386083598165497, guid: e2f00cfdb21d04b46adf17805f74f20c, type: 3} - target: {fileID: 5970386083598165497, guid: e2f00cfdb21d04b46adf17805f74f20c, type: 3}
propertyPath: m_AnchorMin.x propertyPath: m_AnchorMin.x
...@@ -2154,6 +2185,10 @@ PrefabInstance: ...@@ -2154,6 +2185,10 @@ PrefabInstance:
propertyPath: m_Layer propertyPath: m_Layer
value: 5 value: 5
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 8969470922680416840, guid: e2f00cfdb21d04b46adf17805f74f20c, type: 3}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 9026256924356714604, guid: e2f00cfdb21d04b46adf17805f74f20c, type: 3} - target: {fileID: 9026256924356714604, guid: e2f00cfdb21d04b46adf17805f74f20c, type: 3}
propertyPath: m_SizeDelta.y propertyPath: m_SizeDelta.y
value: 0 value: 0
......
using DG.Tweening; using DG.Tweening;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using UnityEngine; using UnityEngine;
using Debug = UnityEngine.Debug; using Debug = UnityEngine.Debug;
public class ScaleToImage : MonoBehaviour public class ScaleToImage : MonoBehaviour
{ {
public Transform target; //目标 public Transform target; //目标
bool isInit; bool isInit_Scale;
Vector3 touch1, touch2, oriPos, pos; Vector3 touch1, touch2, oriPos, pos;
float scale, oriScale; float scale, oriScale;
public float scaleSpeed = 1; public float scaleSpeed = 1;
...@@ -25,8 +22,14 @@ public class ScaleToImage : MonoBehaviour ...@@ -25,8 +22,14 @@ public class ScaleToImage : MonoBehaviour
public float Min_Move; public float Min_Move;
public float Max_Move; public float Max_Move;
public Transform AreaPoint_Right_Up; // 右上
public Transform AreaPoint_Left_Down; //左下
private bool isInit_one; public Transform TipBtn;
public Transform AutoBtn;
public Transform CloseBtn;
private bool isInit_move;
private Vector3 offset; private Vector3 offset;
private Vector3 ToFigerCenter; //指向手指中间的向量 private Vector3 ToFigerCenter; //指向手指中间的向量
...@@ -35,14 +38,31 @@ public class ScaleToImage : MonoBehaviour ...@@ -35,14 +38,31 @@ public class ScaleToImage : MonoBehaviour
private float MoveValue; //移动,缩放大了就小一些 private float MoveValue; //移动,缩放大了就小一些
private bool PlayAniFlag; private bool PlayAniFlag;
private Vector3 OldPos; private Vector3 OldPos_Move; //手指拖动上一帧的位置
private bool MoveEndFlag;
private bool IsPlayAniFlag;
private bool TestFlag;
private bool MoveFlag;
private void Update() private void Update()
{ {
//不是双指就关闭 if (Input.touchCount == 2)
if (Input.touchCount != 2)
{ {
isInit = false; if (MoveFlag)
{
MoveFlag = false;
}
Scale();
MoveEndFlag = false;
TestFlag = true;
}
else
{
isInit_Scale = false;
if (PlayAniFlag) if (PlayAniFlag)
{ {
if (target.GetChild(0).localScale.x <= Min_Move) //缩放小的回大 if (target.GetChild(0).localScale.x <= Min_Move) //缩放小的回大
...@@ -57,28 +77,41 @@ public class ScaleToImage : MonoBehaviour ...@@ -57,28 +77,41 @@ public class ScaleToImage : MonoBehaviour
for (int i = 0; i < target.childCount; i++) for (int i = 0; i < target.childCount; i++)
{ {
target.GetChild(i).DOScale(Vector3.one * MaxScale, 0.3f); target.GetChild(i).DOScale(Vector3.one * MaxScale, 0.3f);
target.GetChild(i).DOMove(oriPos, 0.3f); target.GetChild(i).DOMove(oriPos, 0.3f).onComplete=()=> { IsPlayAniFlag = false; };
} }
} }
PlayAniFlag = false; PlayAniFlag = false;
IsPlayAniFlag = true;
}
if (TestFlag)
{
//Debug.LogError($"11111 初始的位置:{oriPos} 现在的位置:{target.GetChild(0).position} 本地:{target.GetChild(0).localPosition} 初始的缩放:{oriScale} 现在的缩放:{target.GetChild(0).localScale}");
TestFlag = false;
} }
Move();
} }
//初始化 }
if (Input.touchCount == 2 && !isInit) private void Scale()
{
if (!isInit_Scale)
{ {
if (!IsImageArea(Input.GetTouch(0).position) || !IsImageArea(Input.GetTouch(1).position)) if (!IsImageArea(Input.GetTouch(0).position) || !IsImageArea(Input.GetTouch(1).position))
{ {
isInit = false; isInit_Scale = false;
return; return;
} }
//两指点位 //两指点位
touch1 = canvasCamera.ScreenToWorldPoint(Input.GetTouch(0).position); touch1 = canvasCamera.ScreenToWorldPoint(Input.GetTouch(0).position);
touch2 = canvasCamera.ScreenToWorldPoint(Input.GetTouch(1).position); touch2 = canvasCamera.ScreenToWorldPoint(Input.GetTouch(1).position);
touch1 = new Vector3(touch1.x, touch1.y, 0);
touch2 = new Vector3(touch2.x, touch2.y, 0);
//目标初始点位 //目标初始点位
oriPos = new Vector3(target.GetChild(0).position.x, target.GetChild(0).position.y, 0); oriPos = new Vector3(target.GetChild(0).position.x, target.GetChild(0).position.y, 0);
float distance = Vector2.Distance(touch1, touch2) / 2f; float distance = Vector2.Distance(touch1, touch2) / 2f;
var normal = (touch1 - touch2).normalized; var normal = (touch1 - touch2).normalized;
pos = normal * distance + touch2; //两个手指中间的点 pos = normal * distance + touch2; //两个手指中间的点
...@@ -87,102 +120,212 @@ public class ScaleToImage : MonoBehaviour ...@@ -87,102 +120,212 @@ public class ScaleToImage : MonoBehaviour
//距离 //距离
ToFigerdistance = Vector3.Distance(pos, oriPos); ToFigerdistance = Vector3.Distance(pos, oriPos);
oriScale = target.GetChild(0).localScale.x;//开始的缩放值 oriScale = target.GetChild(0).localScale.x;//开始的缩放值
isInit = true; isInit_Scale = true;
MoveValue = 1 / oriScale; MoveValue = 1 / oriScale;
return;
} }
if (Input.touchCount == 2)
isInit_move = false;
if (!IsImageArea(Input.GetTouch(0).position) || !IsImageArea(Input.GetTouch(1).position))
{ {
isInit_one = false; isInit_Scale = false;
if (!IsImageArea(Input.GetTouch(0).position) || !IsImageArea(Input.GetTouch(1).position)) return;
{ }
isInit = false;
return;
}
//两指缩放比例 //两指缩放比例
float nowdis = Vector3.Distance(canvasCamera.ScreenToWorldPoint(Input.GetTouch(0).position), canvasCamera.ScreenToWorldPoint(Input.GetTouch(1).position)); float nowdis = Vector3.Distance(canvasCamera.ScreenToWorldPoint(Input.GetTouch(0).position), canvasCamera.ScreenToWorldPoint(Input.GetTouch(1).position));
scale = nowdis / Vector3.Distance(touch1, touch2); //大于1是放大,小于是缩小 scale = nowdis / Vector3.Distance(touch1, touch2); //大于1是放大,小于是缩小
//利用scaleSpeed控制缩放速度
scale = (scale - 1) * 0.8f; //正的话就是放大图片
if (scale < 0)
{
scale = scale * oriScale * 0.8f; //缩小速度
}
//利用scaleSpeed控制缩放速度 if (target.GetChild(0).localScale.x < Min_Move)
scale = (scale - 1) * 0.8f; //正的话就是放大图片 {
if (scale < 0) PlayAniFlag = true;
return;
}
float scale_target = 0;
for (int i = 0; i < target.childCount; i++)
{
var item = target.GetChild(i);
scale_target = (Vector3.one * (oriScale + scale)).x;
if (scale_target < Min_Move)
{ {
scale = scale * oriScale * 0.8f; item.localScale = Vector3.one * Min_Move * 0.99f;
} }
else if (scale_target > Max_Move)
if (target.GetChild(0).localScale.x < Min_Move)
{ {
item.localScale = Vector3.one * (oriScale + scale);
PlayAniFlag = true; PlayAniFlag = true;
return;
} }
else
float scale_target;
for (int i = 0; i < target.childCount; i++)
{ {
var item = target.GetChild(i); item.localScale = Vector3.one * (oriScale + scale);
scale_target = (Vector3.one * (oriScale + scale)).x; }
if (scale_target < Min_Move)
{
item.localScale = Vector3.one * Min_Move * 0.99f;
}
else if (scale_target > Max_Move)
{
item.localScale = Vector3.one * (oriScale + scale);
PlayAniFlag = true;
}
else
item.localScale = Vector3.one * (oriScale + scale);
//改变目标位置,让位置保持不变
item.position = oriPos - ToFigerCenter * (item.localScale.x - oriScale) * ToFigerdistance * MoveValue;
item.localPosition = new Vector3(item.localPosition.x, item.localPosition.y, 0);
}
//改变目标位置,让位置保持不变 //Debug.LogError($"11111 目标缩放:{scale_target} 动画标记:{PlayAniFlag} Min_Move:{Min_Move} Max_Move: {Max_Move} 初始点:{oriPos} 现在点:{target.GetChild(0).position}");
item.position = oriPos - ToFigerCenter * (item.localScale.x - oriScale) * ToFigerdistance * MoveValue; }
private void Move()
{
if (Input.GetMouseButtonUp(0))
{
isInit_move = false;
if (MoveEndFlag && !IsPlayAniFlag)
LerptoMove_End();
}
else if (Input.GetMouseButtonDown(0))
{
if (IsImageArea(Input.mousePosition) && IsMidArea(Input.mousePosition))
{
MoveEndFlag = true;
} }
}
else if (Input.GetMouseButton(0))
{
if(MoveEndFlag)
OnClickMove(Input.mousePosition);
} }
if (Input.touchCount == 1) //单指拖动 }
private void LerptoMove_End() //移动结束后加个缓动的效果
{
MoveEndFlag = false;
var nowpos= new Vector3(target.GetChild(0).position.x, target.GetChild(0).position.y, 0);
if (nowpos != OldPos_Move)
{ {
if (!IsImageArea(Input.GetTouch(0).position)) var tonow = (nowpos - OldPos_Move).normalized; //指向现在位置的方向向量
var newpos = tonow*0.5f + nowpos;
for (int i = 0; i < target.childCount; i++)
{ {
isInit_one = false; var item = target.GetChild(i);
return; item.DOMove(newpos, 0.3f);
} }
if (!isInit_one) }
{ }
offset = target.GetChild(0).position - new Vector3(canvasCamera.ScreenToWorldPoint(Input.GetTouch(0).position).x, canvasCamera.ScreenToWorldPoint(Input.GetTouch(0).position).y, 0);
isInit_one = true; private void OnClickMove(Vector2 ScreenPos)
{
if (!isInit_move)
{
if (!IsImageArea(ScreenPos))
return;
offset = new Vector3(target.GetChild(0).position.x, target.GetChild(0).position.y,0) - new Vector3(canvasCamera.ScreenToWorldPoint(ScreenPos).x, canvasCamera.ScreenToWorldPoint(ScreenPos).y, 0);
isInit_move = true;
}
else
{
var pos = new Vector3(canvasCamera.ScreenToWorldPoint(ScreenPos).x, canvasCamera.ScreenToWorldPoint(ScreenPos).y, 0) + offset; //图片目标位置
} CanMove(pos.x, pos.y, out float x, out float y);
else
pos = new Vector3(x, y, 0);
OldPos_Move = new Vector3(target.GetChild(0).position.x, target.GetChild(0).position.y, 0);
for (int i = 0; i < target.childCount; i++)
{ {
var pos = new Vector3(canvasCamera.ScreenToWorldPoint(Input.GetTouch(0).position).x, canvasCamera.ScreenToWorldPoint(Input.GetTouch(0).position).y, 0) + offset; var item = target.GetChild(i);
for (int i = 0; i < target.childCount; i++) item.position = pos;
{ }
var item = target.GetChild(i); MoveFlag = true;
}
}
item.position = pos; private void CanMove(float Target_x, float Target_y, out float x, out float y)
{
float scale = target.GetChild(0).localScale.x;
scale = Mathf.Max(scale, 1);
} var dis_x = AreaPoint_Right_Up.position.x - AreaPoint_Left_Down.position.x;
} var dis_y = AreaPoint_Right_Up.position.y - AreaPoint_Left_Down.position.y;
} float offset = 2.6f - 1 / scale;
float offset_y = (dis_y * scale - dis_y) / offset;
float offset_x = (dis_x * scale - dis_x) / offset;
if (Input.touchCount == 0) if (Target_y < AreaPoint_Left_Down.position.y - offset_y)
{
y = AreaPoint_Left_Down.position.y - offset_y;
}
else if(Target_y > AreaPoint_Right_Up.position.y+ offset_y)
{ {
isInit_one = false; y = AreaPoint_Right_Up.position.y+ offset_y;
}
else
{
y = Target_y;
} }
if (Target_x < AreaPoint_Left_Down.position.x- offset_x)
{
x = AreaPoint_Left_Down.position.x- offset_x;
}
else if (Target_x > AreaPoint_Right_Up.position.x+ offset_x)
{
x = AreaPoint_Right_Up.position.x+ offset_x;
}
else
{
x = Target_x;
}
} }
private bool IsImageArea(Vector3 screenpos) //判断这个点是不是在中间的区域 private bool IsImageArea(Vector3 screenpos) //判断这个点是不是在中间的区域
{ {
RectTransformUtility.ScreenPointToLocalPointInRectangle(ScrollRect.GetComponent<RectTransform>(), screenpos, canvasCamera, out var vector); //拿到中心位置和这个图片在一个父物体下的本地坐标 RectTransformUtility.ScreenPointToLocalPointInRectangle(ScrollRect.GetComponent<RectTransform>(), screenpos, canvasCamera, out var vector); //拿到中心位置和这个图片在一个父物体下的本地坐标
return vector.y - ScrollRect.GetComponent<RectTransform>().sizeDelta.y / 2f > 0; return vector.y - ScrollRect.GetComponent<RectTransform>().sizeDelta.y / 2f > 0;
} }
private bool IsMidArea( Vector3 screenpos) //是不是中间(不是上面三个按钮的区域)
{
if (!BtnPosJudge(TipBtn, screenpos) && !BtnPosJudge(AutoBtn, screenpos)! && !BtnPosJudge_Close(CloseBtn, screenpos))
{
return true;
}
return false;
}
private bool BtnPosJudge(Transform Btn, Vector3 screenpos)
{
RectTransformUtility.ScreenPointToLocalPointInRectangle(Btn.GetComponent<RectTransform>(), screenpos, canvasCamera, out var vector); //拿到中心位置和这个图片在一个父物体下的本地坐标
var size = Btn.GetComponent<RectTransform>().sizeDelta / 2f;
if (vector.x <= size.x && vector.x >= -size.x && vector.y <= size.y && vector.y >= -size.y)
{
return true;
}
return false;
}
private bool BtnPosJudge_Close(Transform Btn, Vector3 screenpos)
{
RectTransformUtility.ScreenPointToLocalPointInRectangle(Btn.GetComponent<RectTransform>(), screenpos, canvasCamera, out var vector); //拿到中心位置和这个图片在一个父物体下的本地坐标
var size = Btn.GetComponent<RectTransform>().sizeDelta;
if (vector.x <= size.x/2f && vector.x >= -size.x/2f && vector.y <= size.y && vector.y >= 0)
{
return true;
}
return false;
}
} }
...@@ -83,9 +83,9 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler ...@@ -83,9 +83,9 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
//gameScenUser //gameScenUser
var gridViewList = areaGroupList.GetComponent<gameSceneAreaGroupHandler>(); var gridViewList = areaGroupList.GetComponent<gameSceneAreaGroupHandler>();
gridViewList.gameObject.SetActive(false); gridViewList.gameObject.SetActive(false);
transform.Find("groupListBg").gameObject.SetActive(false); transform.Find("areaGroupList/groupListBg").gameObject.SetActive(false);
transform.Find("gameProgress/gameProgressText").gameObject.SetActive(false); transform.Find("areaGroupList/gameProgress/gameProgressText").gameObject.SetActive(false);
transform.Find("gameProgress").gameObject.SetActive(false); transform.Find("areaGroupList/gameProgress").gameObject.SetActive(false);
transform.Find("gameEndOperBase").gameObject.SetActive(false); transform.Find("gameEndOperBase").gameObject.SetActive(false);
transform.Find("gameEndOperBase").GetComponent<gameEndLogic>().initMember(); transform.Find("gameEndOperBase").GetComponent<gameEndLogic>().initMember();
transform.Find("areaGroupList/tipSelectGroup").gameObject.SetActive(false); transform.Find("areaGroupList/tipSelectGroup").gameObject.SetActive(false);
...@@ -148,11 +148,6 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler ...@@ -148,11 +148,6 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
void Update() void Update()
{ {
ActionManages.update(); ActionManages.update();
if (Input.GetKeyDown(KeyCode.A))
{
Debug.LogError(utilsTools.DisplaySize);
}
} }
//创建列表item的时候回调并设置、初始化和刷新 //创建列表item的时候回调并设置、初始化和刷新
...@@ -319,7 +314,7 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler ...@@ -319,7 +314,7 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
return; return;
} }
areaGroupList.SetActive(true); areaGroupList.SetActive(true);
transform.Find("groupListBg").gameObject.SetActive(true); transform.Find("areaGroupList/groupListBg").gameObject.SetActive(true);
if (autoSwitchGroup == false) nowidx = -1; if (autoSwitchGroup == false) nowidx = -1;
var cellSize = gridViewList.getCellSize(); var cellSize = gridViewList.getCellSize();
gradViewBack gradView = (GameObject gobject, int idx, ListViewBackTypeEnum lvbType) => { gradViewBack gradView = (GameObject gobject, int idx, ListViewBackTypeEnum lvbType) => {
...@@ -449,9 +444,9 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler ...@@ -449,9 +444,9 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
transform.Find("ingameLoad").gameObject.SetActive(false); transform.Find("ingameLoad").gameObject.SetActive(false);
transform.Find("top").gameObject.SetActive(true); transform.Find("top").gameObject.SetActive(true);
utilsTools.setGDataByKey("loadingEnd", utilsTools.getTotalMillisecond()); utilsTools.setGDataByKey("loadingEnd", utilsTools.getTotalMillisecond());
RectTransform transform1 = transform.Find("gameProgress/gameProgressText").GetComponent<RectTransform>(); RectTransform transform1 = transform.Find("areaGroupList/gameProgress/gameProgressText").GetComponent<RectTransform>();
transform1.gameObject.SetActive(true); transform1.gameObject.SetActive(true);
transform1 = transform.Find("gameProgress").GetComponent<RectTransform>(); transform1 = transform.Find("areaGroupList/gameProgress").GetComponent<RectTransform>();
transform1.gameObject.SetActive(true); transform1.gameObject.SetActive(true);
gameShowView.GetComponent<mainGameScaleMove>().setCheckInput(); gameShowView.GetComponent<mainGameScaleMove>().setCheckInput();
gameShowView.GetComponent<mainGameView>().showTimes(); gameShowView.GetComponent<mainGameView>().showTimes();
...@@ -625,9 +620,9 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler ...@@ -625,9 +620,9 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
void onChangeGameUserProgressEvent(List<UnityEngine.Object> uobjects,List<System.Object> objects) { void onChangeGameUserProgressEvent(List<UnityEngine.Object> uobjects,List<System.Object> objects) {
int pro = (int)objects[0]; int pro = (int)objects[0];
transform.Find("ingameLoad").gameObject.SetActive(false); transform.Find("ingameLoad").gameObject.SetActive(false);
TextMeshProUGUI textMeshPro = transform.Find("gameProgress/gameProgressText").GetComponent<TextMeshProUGUI>(); TextMeshProUGUI textMeshPro = transform.Find("areaGroupList/gameProgress/gameProgressText").GetComponent<TextMeshProUGUI>();
textMeshPro.text = pro.ToString() + "%"; textMeshPro.text = pro.ToString() + "%";
UnityEngine.UI.Slider slider = transform.Find("gameProgress").GetComponent<UnityEngine.UI.Slider>(); UnityEngine.UI.Slider slider = transform.Find("areaGroupList/gameProgress").GetComponent<UnityEngine.UI.Slider>();
slider.value = pro; slider.value = pro;
} }
//点提示,当前组随机一个没涂的位置放大 //点提示,当前组随机一个没涂的位置放大
...@@ -734,7 +729,10 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler ...@@ -734,7 +729,10 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
else else
{ {
//item = gridViewList.getObjectById(nowidx).GetComponent<colorItem>(); //item = gridViewList.getObjectById(nowidx).GetComponent<colorItem>();
item = gridViewList.GetObjByGID(nowAidByGid).GetComponent<colorItem>(); var item_obj = gridViewList.GetObjByGID(nowAidByGid);
if (item_obj == null)
return;
item = item_obj.GetComponent<colorItem>();
var gdata = groupInfos.FirstOrDefault(a => a.gid == nowAidByGid); var gdata = groupInfos.FirstOrDefault(a => a.gid == nowAidByGid);
item.NowProgress = gdata.Jindu; item.NowProgress = gdata.Jindu;
} }
......
...@@ -314,12 +314,15 @@ public class gridView : MonoBehaviour ...@@ -314,12 +314,15 @@ public class gridView : MonoBehaviour
startX = 0 - w / 2 + widthItem / 2 - (widthItem / 2 + interval / 2); startX = 0 - w / 2 + widthItem / 2 - (widthItem / 2 + interval / 2);
float spacingLen = interval * (size - 1); float spacingLen = interval * (size - 1);
float width = coutPixel; float width = coutPixel;
if (width > w) //if (width > w)
{ //{
w = width - w; // w = width - w;
} //}
if (w > gameObject.GetComponent<RectTransform>().sizeDelta.x) //if (w > gameObject.GetComponent<RectTransform>().sizeDelta.x)
rectTransform.sizeDelta = new Vector2(w, rectTransform.sizeDelta.y); // rectTransform.sizeDelta = new Vector2(w, rectTransform.sizeDelta.y);
rectTransform.sizeDelta = new Vector2(width - w, rectTransform.sizeDelta.y);
} }
utilsTools.setGDataByKey("listViewTempCellSize", new Vector2(widthItem,heightItem)); utilsTools.setGDataByKey("listViewTempCellSize", new Vector2(widthItem,heightItem));
utilsTools.setGDataByKey("listViewContextCellSize", rectTransform.sizeDelta); utilsTools.setGDataByKey("listViewContextCellSize", rectTransform.sizeDelta);
...@@ -351,7 +354,7 @@ public class gridView : MonoBehaviour ...@@ -351,7 +354,7 @@ public class gridView : MonoBehaviour
if (true == utilsTools.getUserData<string>(itemObject, "scrollViewItemType", out oldItemType, "") && newItemType.Equals(oldItemType)) if (true == utilsTools.getUserData<string>(itemObject, "scrollViewItemType", out oldItemType, "") && newItemType.Equals(oldItemType))
{ {
itemObject.transform.GetLocalPositionAndRotation(out vector31, out quaternion); itemObject.transform.GetLocalPositionAndRotation(out vector31, out quaternion);
itemObject.transform.SetLocalPositionAndRotation(vector3, quaternion); itemObject.transform.SetLocalPositionAndRotation(new Vector3(vector3.x, vector31.y, vector31.z), quaternion);
back(itemObject, i, ListViewBackTypeEnum.update); back(itemObject, i, ListViewBackTypeEnum.update);
if(useVec) if(useVec)
vector3.y = vector3.y + heightItem / 2 + interval / 2; vector3.y = vector3.y + heightItem / 2 + interval / 2;
......
Markdown is supported
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