|
@@ -15,6 +15,7 @@ public class Garden : MonoBehaviour, IDragHandler, IPointerClickHandler, IEndDra
|
|
|
private float Ratio2;
|
|
|
private float Ratio3;
|
|
|
private float Ratio4;
|
|
|
+ private float RatioPlayer;
|
|
|
private float LeftBorder;
|
|
|
private float SlideSpeed;
|
|
|
private float RightBorder;
|
|
@@ -22,11 +23,13 @@ public class Garden : MonoBehaviour, IDragHandler, IPointerClickHandler, IEndDra
|
|
|
private Transform Garden3;
|
|
|
private Transform Garden4;
|
|
|
private Transform GardenA;
|
|
|
-
|
|
|
+ private Transform PlayerTra;
|
|
|
+
|
|
|
private List<Vector3> VectorList2;
|
|
|
private List<Vector3> VectorList3;
|
|
|
private List<Vector3> VectorList4;
|
|
|
private List<Vector3> VectorListA;
|
|
|
+ private List<Vector3> VectorListPlayer;
|
|
|
|
|
|
#endregion
|
|
|
|
|
@@ -59,6 +62,7 @@ public class Garden : MonoBehaviour, IDragHandler, IPointerClickHandler, IEndDra
|
|
|
Ratio2 = 0.25f;
|
|
|
Ratio3 = 0.5f;
|
|
|
Ratio4 = 0.75f;
|
|
|
+ RatioPlayer = 0.75f;
|
|
|
SlideSpeed = 0.1f;
|
|
|
|
|
|
LeftBorder = VectorListA[0].x;
|
|
@@ -84,6 +88,7 @@ public class Garden : MonoBehaviour, IDragHandler, IPointerClickHandler, IEndDra
|
|
|
Garden4 = ManaReso.Get("GardenSr4");
|
|
|
|
|
|
GardenA = ManaReso.Get("GardenSrA");
|
|
|
+ PlayerTra = ManaReso.Get("Player");
|
|
|
|
|
|
VectorList2 = new List<Vector3>()
|
|
|
{
|
|
@@ -108,6 +113,12 @@ public class Garden : MonoBehaviour, IDragHandler, IPointerClickHandler, IEndDra
|
|
|
ManaReso.Get("TraA1").position,
|
|
|
ManaReso.Get("TraB1").position,
|
|
|
};
|
|
|
+
|
|
|
+ VectorListPlayer = new List<Vector3>()
|
|
|
+ {
|
|
|
+ Player.ChildDic["PlayerTra1"].position,
|
|
|
+ Player.ChildDic["PlayerTra2"].position,
|
|
|
+ };
|
|
|
}
|
|
|
|
|
|
|
|
@@ -126,6 +137,7 @@ public class Garden : MonoBehaviour, IDragHandler, IPointerClickHandler, IEndDra
|
|
|
float tempX = Mathf.Clamp(eventData.delta.x / 10, -2, 2) * SlideSpeed;
|
|
|
|
|
|
GardenA.Translate(GardenA.right * tempX, Space.World);
|
|
|
+ PlayerTra.Translate(PlayerTra.right * tempX * RatioPlayer, Space.World);
|
|
|
|
|
|
Garden2.Translate(Garden2.right * tempX * Ratio2, Space.World);
|
|
|
Garden3.Translate(Garden3.right * tempX * Ratio3, Space.World);
|
|
@@ -151,6 +163,7 @@ public class Garden : MonoBehaviour, IDragHandler, IPointerClickHandler, IEndDra
|
|
|
float tempX = Mathf.Clamp(eventData.delta.x / 10, -2, 2) * SlideSpeed;
|
|
|
|
|
|
GardenA.Translate(GardenA.right * tempX, Space.World);
|
|
|
+ PlayerTra.Translate(PlayerTra.right * tempX * RatioPlayer, Space.World);
|
|
|
|
|
|
Garden2.Translate(Garden2.right * tempX * Ratio2, Space.World);
|
|
|
Garden3.Translate(Garden3.right * tempX * Ratio3, Space.World);
|
|
@@ -208,7 +221,9 @@ public class Garden : MonoBehaviour, IDragHandler, IPointerClickHandler, IEndDra
|
|
|
Garden2.Move(VectorList2[Page], 0.25f, Curve.EaseOutQuad);
|
|
|
Garden3.Move(VectorList3[Page], 0.25f, Curve.EaseOutQuad);
|
|
|
Garden4.Move(VectorList4[Page], 0.25f, Curve.EaseOutQuad);
|
|
|
+
|
|
|
GardenA.Move(VectorListA[Page], 0.25f, Curve.EaseOutQuad);
|
|
|
+ PlayerTra.Move(VectorListPlayer[Page], 0.25f, Curve.EaseOutQuad);
|
|
|
}
|
|
|
|
|
|
private void PrevPage()
|
|
@@ -220,7 +235,9 @@ public class Garden : MonoBehaviour, IDragHandler, IPointerClickHandler, IEndDra
|
|
|
Garden2.Move(VectorList2[Page], 0.5f, Curve.EaseOutQuad);
|
|
|
Garden3.Move(VectorList3[Page], 0.5f, Curve.EaseOutQuad);
|
|
|
Garden4.Move(VectorList4[Page], 0.5f, Curve.EaseOutQuad);
|
|
|
+
|
|
|
GardenA.Move(VectorListA[Page], 0.5f, Curve.EaseOutQuad);
|
|
|
+ PlayerTra.Move(VectorListPlayer[Page], 0.5f, Curve.EaseOutQuad);
|
|
|
}
|
|
|
|
|
|
private void NextPage()
|
|
@@ -232,6 +249,8 @@ public class Garden : MonoBehaviour, IDragHandler, IPointerClickHandler, IEndDra
|
|
|
Garden2.Move(VectorList2[Page], 0.5f, Curve.EaseOutQuad);
|
|
|
Garden3.Move(VectorList3[Page], 0.5f, Curve.EaseOutQuad);
|
|
|
Garden4.Move(VectorList4[Page], 0.5f, Curve.EaseOutQuad);
|
|
|
+
|
|
|
GardenA.Move(VectorListA[Page], 0.5f, Curve.EaseOutQuad);
|
|
|
+ PlayerTra.Move(VectorListPlayer[Page], 0.5f, Curve.EaseOutQuad);
|
|
|
}
|
|
|
}
|