- Home /
BCE0044 erro only shows when trying to build .apk
Hello there,
My problem is kinda weird. In the editor my game run fine but when I try to build the .apk it appears in the console:
Assets/Scripts/AnySwipe.js(322,1): BCE0044: expecting }, found ''.
My script is the following:
#pragma strict
public var minLenght : int = 50; //the minimum length to be consider an swipe
@Range(0.0f, 1f)
public var relevance : float = 0.9f; //amount of relevance to take into account for checking
//if an swipe is swiped according to the desired direction
#if UNITY_EDITOR
public var touchEnabled : boolean; //useful if you would like to use touch input from the editor if using UNTIY REMOTE
#endif
private var touchStart : Vector2; //swipe starting position
private var touchEnd : Vector2; //swipe ending position
private var dir : Vector2; //direction of swipe
private var isInit : boolean; //determines if swipes can be check against
private var reset : boolean;
private var isTouchDown : boolean;
//JUMPS HANDLER
public var jump :int;
public var jump2 :int;
//Get current swipe direction
public function get Dir() : Vector2{
return dir;
}
#if UNITY_EDITOR
function OnEnable(){
if(touchEnabled)
Debug.Log ("AnySwipe : Tounch Input Enabled");
}
#endif
//-------------------------
//-------------------------
public function CheckForSwipe (swipe : Vector2) : boolean {
if(isInit){
//compare current swipe to desired swipe direction
var dot : float = Vector2.Dot(swipe, dir);
//round to 2 decimal places
dot = Mathf.Round(dot * 100)/100;
//check if current swipe is within match to desired swipe direction
if(dot >= relevance){
return true;
}
}
#if UNITY_EDITOR
if(!isInit){
//display error
Debug.LogError("AnySwipe, Must call IsSwiped(), before you can use CheckForSwipe()");
}
#endif
return false;
}
//-------------------------
//-------------------------
public function IsSwiped() : boolean{
#if UNITY_EDITOR
if(!touchEnabled){
if(!isTouchDown){
if(Input.GetMouseButtonDown(0)){
isInit = true;
isTouchDown = true;
touchStart = Input.mousePosition;
}
}
else{
if(Input.GetMouseButtonUp(0)){
isTouchDown = false;
touchEnd = Input.mousePosition;
dir = touchEnd - touchStart;
reset = true;
//check lenght
if(dir.sqrMagnitude >= minLenght * minLenght){
dir.Normalize();
return true;
}
else {Debug.Log("JUMP");
jump = 1;
jump2 = 1;
}
}
}
}
else{
if(Input.touchCount > 0){
var touch : Touch = Input.GetTouch(0);
if(!isTouchDown){
isInit = true;
isTouchDown = true;
touchStart = touch.position;
}
else{
touchEnd = touch.position;
}
}
else{
if(isTouchDown){
isTouchDown = false;
dir = touchEnd - touchStart;
reset = true;
//check lenght
if(dir.sqrMagnitude >= (minLenght * minLenght)){
dir.Normalize();
return true;
}
}
}
}
#elif UNITY_WEBPLAYER || UNITY_STANDALONE
if(!isTouchDown){
if(Input.GetMouseButtonDown(0)){
isInit = true;
isTouchDown = true;
touchStart = Input.mousePosition;
}
}
else{
if(Input.GetMouseButtonUp(0)){
isTouchDown = false;
touchEnd = Input.mousePosition;
dir = touchEnd - touchStart;
reset = true;
//check lenght
if(dir.sqrMagnitude >= minLenght * minLenght){
dir.Normalize();
return true;
}
else {Debug.Log("JUMP");
jump = 1;
jump2 = 1;
}
}
}
#elif UNITY_IOS || UNITY_ANDROID
if(Input.touchCount > 0){
var touch : Touch = Input.GetTouch(0);
if(!isTouchDown){
isInit = true;
isTouchDown = true;
touchStart = touch.position;
}
else{
touchEnd = touch.position;
}
}
else{
if(isTouchDown){
isTouchDown = false;
dir = touchEnd - touchStart;
reset = true;
//check lenght
if(dir.sqrMagnitude >= minLenght * minLenght){
dir.Normalize();
return true;
}
else {Debug.Log("JUMP");
jump = 1;
jump2 = 1;
}
}
}
#endif
if(reset){
reset = false;
isInit = false;
}
return false;
}
Well, as you can see the referred line does not even exist. Can this be related to the fact that I'm using an Editor extension?
Please format your code properly so we can see the line numbers.
Your answer
Follow this Question
Related Questions
Fog not moving with camera on mobile build 0 Answers
How to exclude "Selection & Handles" and other editor-specific code in builds? 2 Answers
Corrupted sprites in builds ONLY 4 Answers
Object speed is much slower on iOS and Android build than on Editor 2 Answers
Create custom warning dialog on build, if a script or gameobject exists in the scene 2 Answers