Hi,
I’m having a problem with my app and the video’s in the app. When a user clicks on a thumb to play the movie the movie starts en everything works well. But when the video is played and the user clicks on done it switches back to my app but the app is frozen and needs to be restarted to get it working again.
This is the code i’m executing when tapping to start the movie:
Handheld.PlayFullScreenMovie("Chapter1.mp4", Color.black, FullScreenMovieControlMode.Full);
Can anyone help me with this?
EDIT:
I just found out that the app doesn’t freeze just the swipe gestures aren’t working anymore…
EDIT 2:
Right so everything works except for the swipe gestures i’m using to rotate a 3D object.
Still can’t find the solution for this one, i tried debugging lines in the swipe recognition but that doesn’t seem to work either
any help? I’ll post my swipe controls script below:
#pragma strict
public static var SC : SwipeControls;
private var vetPen : GameObject;
private var speed : float = 20;
private var timeEase = -3;
private var swipeAngle;
//Inertia Variables
private var rotateVelocityX : float = 0;
private var itemTimeTouchPhaseEnded : float;
private var timeTouchPhaseEnded : float;
private var inertiaDuration : float = 2.5f;
private var scrollVelocity : float = 0;
private var scrollPosition : Vector2 = Vector2.zero;
private var rotationRate : float = 0.5f;
private var inertiaValue : float;
private var vetPenKit : GameObject;
private var parent : GameObject;
private var summaryPanel : GameObject;
private var swipeDirection : String;
function Start()
{
SC = this;
vetPen = GameObject.Find("VetPen");
parent = GameObject.Find("VetPen Parent");
vetPenKit = GameObject.Find("StarterKit");
summaryPanel = GameObject.Find("Summary Panel");
}
function Update()
{
CheckIfHorizontal();
if(Input.touchCount == 0 !MenuManager.MM.getScreenActive())
{
if(float.IsInfinity(rotateVelocityX))
{
if(swipeDirection == "Right")
rotateVelocityX = 150;
else
rotateVelocityX = -150;
}
if(rotateVelocityX == float.MaxValue)
{
if(swipeDirection == "Right")
rotateVelocityX = 1200000;
else
rotateVelocityX = -1200000;
}
Inertia();
}
}
function On_Swipe(gesture : Gesture)
{
if(gesture.swipe == EasyTouch.SwipeType.Right MenuManager.MM.getTestimonialActive())
{
if(vetPenKit.activeSelf)
iTween.MoveTo(vetPenKit, {"x": 2200, "time": 1, "isLocal": true, "oncompletetarget": gameObject, "oncomplete": "TurnOff"});
if(summaryPanel.activeSelf)
iTween.MoveTo(summaryPanel, {"x": 2200, "time": 1, "isLocal": true, "oncompletetarget": gameObject, "oncomplete": "TurnOff"});
}
if(EasyTouch.SwipeType.Left !MenuManager.MM.getScreenActive())
{
swipeDirection == "Left";
rotateVelocityX = 0.0;
parent.transform.Rotate(new Vector3(0, -1, 0) * gesture.deltaPosition.x * Time.deltaTime * speed);
CheckIfHorizontal();
}
else if(EasyTouch.SwipeType.Right !MenuManager.MM.getScreenActive())
{
swipeDirection == "Right";
rotateVelocityX = 0.0;
CheckIfHorizontal();
parent.transform.Rotate(new Vector3(0, 1, 0) * gesture.deltaPosition.x * Time.deltaTime * speed);
}
if(EasyTouch.SwipeType.Up !MenuManager.MM.getScreenActive())
{
swipeDirection == "Up";
CheckIfHorizontal();
rotateVelocityX = 0.0;
vetPen.transform.Rotate(new Vector3(0, 0, 1) * gesture.deltaPosition.y * Time.deltaTime * speed);
}
else if(EasyTouch.SwipeType.Down !MenuManager.MM.getScreenActive())
{
swipeDirection == "Down";
CheckIfHorizontal();
rotateVelocityX = 0.0;
vetPen.transform.Rotate(new Vector3(0, 0, -1) * gesture.deltaPosition.y * Time.deltaTime * speed);
}
}
function On_SwipeEnd(gesture : Gesture)
{
CheckIfHorizontal();
if(gesture.swipe == EasyTouch.SwipeType.Left)
{
if(Mathf.Abs(gesture.deltaPosition.x) >= 3)
{
rotateVelocityX = gesture.deltaPosition.x / gesture.deltaTime;
}
itemTimeTouchPhaseEnded = Time.time;
}
if(gesture.swipe == EasyTouch.SwipeType.Right)
{
if(Mathf.Abs(gesture.deltaPosition.x) >= 3)
{
rotateVelocityX = gesture.deltaPosition.x / gesture.deltaTime;
}
itemTimeTouchPhaseEnded = Time.time;
}
}
function Inertia()
{
CheckIfHorizontal();
if(scrollVelocity != 0.0)
{
CheckIfHorizontal();
var t : float = (Time.time - timeTouchPhaseEnded) / inertiaDuration;
var frameVelocity : float = Mathf.Lerp(scrollVelocity, 0, t);
scrollPosition.x -= frameVelocity * Time.deltaTime;
if(t >= inertiaDuration)
scrollVelocity = 0.0f;
}
if(rotateVelocityX != 0.0f)
{
CheckIfHorizontal();
var ty : float = (Time.time - itemTimeTouchPhaseEnded) / inertiaDuration;
var XVelocity : float = Mathf.Lerp(rotateVelocityX, 0, ty);
}
if(ty >= inertiaDuration)
{
CheckIfHorizontal();
rotateVelocityX = 0.0f;
}
if(XVelocity > 1500)
{
XVelocity = 1500;
}
if(XVelocity < -1500)
{
XVelocity = -1500;
}
inertiaValue = -XVelocity * Time.deltaTime * rotationRate;
if(float.IsNaN(inertiaValue))
{
}
else
{
CheckIfHorizontal();
//vetPen.transform.Rotate(0, inertiaValue, 0);
parent.transform.Rotate(0, inertiaValue, 0);
CheckIfHorizontal();
}
}
function TurnOff()
{
MenuManager.MM.summaryClose();
MenuManager.MM.starterKitClose();
MenuManager.MM.setTestmonialActive(false);
}
function CheckIfHorizontal()
{
if(parent.transform.eulerAngles.x != 0 || parent.transform.rotation.x != 0)
{
parent.transform.eulerAngles.x = 0;
}
}