|
|
@ -33,15 +33,16 @@ namespace Fungus |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public float cameraZ = -10f; |
|
|
|
public float cameraZ = -10f; |
|
|
|
|
|
|
|
|
|
|
|
[HideInInspector] |
|
|
|
|
|
|
|
public bool swipePanActive; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[HideInInspector] |
|
|
|
[HideInInspector] |
|
|
|
public bool waiting; |
|
|
|
public bool waiting; |
|
|
|
|
|
|
|
|
|
|
|
protected float fadeAlpha = 0f; |
|
|
|
protected float fadeAlpha = 0f; |
|
|
|
|
|
|
|
|
|
|
|
// Swipe panning control |
|
|
|
// Swipe panning control |
|
|
|
|
|
|
|
[HideInInspector] |
|
|
|
|
|
|
|
public bool swipePanActive; |
|
|
|
|
|
|
|
[HideInInspector] |
|
|
|
|
|
|
|
public float swipeSpeedMultiplier = 1f; |
|
|
|
protected View swipePanViewA; |
|
|
|
protected View swipePanViewA; |
|
|
|
protected View swipePanViewB; |
|
|
|
protected View swipePanViewB; |
|
|
|
protected Vector3 previousMousePos; |
|
|
|
protected Vector3 previousMousePos; |
|
|
@ -426,7 +427,7 @@ namespace Fungus |
|
|
|
* Activates swipe panning mode. |
|
|
|
* Activates swipe panning mode. |
|
|
|
* The player can pan the camera within the area between viewA & viewB. |
|
|
|
* The player can pan the camera within the area between viewA & viewB. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public virtual void StartSwipePan(View viewA, View viewB, float duration, Action arriveAction) |
|
|
|
public virtual void StartSwipePan(View viewA, View viewB, float duration, float speedMultiplier, Action arriveAction) |
|
|
|
{ |
|
|
|
{ |
|
|
|
Camera camera = GetCamera(); |
|
|
|
Camera camera = GetCamera(); |
|
|
|
if (camera == null) |
|
|
|
if (camera == null) |
|
|
@ -436,6 +437,7 @@ namespace Fungus |
|
|
|
|
|
|
|
|
|
|
|
swipePanViewA = viewA; |
|
|
|
swipePanViewA = viewA; |
|
|
|
swipePanViewB = viewB; |
|
|
|
swipePanViewB = viewB; |
|
|
|
|
|
|
|
swipeSpeedMultiplier = speedMultiplier; |
|
|
|
|
|
|
|
|
|
|
|
Vector3 cameraPos = camera.transform.position; |
|
|
|
Vector3 cameraPos = camera.transform.position; |
|
|
|
|
|
|
|
|
|
|
@ -503,8 +505,8 @@ namespace Fungus |
|
|
|
if (camera != null) |
|
|
|
if (camera != null) |
|
|
|
{ |
|
|
|
{ |
|
|
|
Vector3 cameraDelta = camera.ScreenToViewportPoint(delta); |
|
|
|
Vector3 cameraDelta = camera.ScreenToViewportPoint(delta); |
|
|
|
cameraDelta.x *= -2f; |
|
|
|
cameraDelta.x *= -2f * swipeSpeedMultiplier; |
|
|
|
cameraDelta.y *= -2f; |
|
|
|
cameraDelta.y *= -2f * swipeSpeedMultiplier; |
|
|
|
cameraDelta.z = 0f; |
|
|
|
cameraDelta.z = 0f; |
|
|
|
|
|
|
|
|
|
|
|
Vector3 cameraPos = camera.transform.position; |
|
|
|
Vector3 cameraPos = camera.transform.position; |
|
|
|