no i mean this “powered by unity” splash screen. now i have reinstalled unity but with no luck.
my game is a 2d platformer where you be a ball that have to jump over cubes on the random loaded platforms where are moving from right to left across the screen.
this is my scoring script. the score start counting if the scene is loaded. if the ball falling from the platform or is colliding with an cube the StopScore() function is called from another script:
static var score : int = 0;
var mystyle : GUIStyle;
var fontColor : Color;
var outColor : Color;
var guiposition : Rect;
static var savedhighscore;
savedhighscore = PlayerPrefs.GetInt("highscore");
static var scoring : boolean = true;
function Awake () {
score = 0;
scoring = true;
}
function Update(){
if (scoring == true){
score += Mathf.Round(Time.deltaTime*100);
}
}
function OnGUI(){
guiposition = Rect((Screen.width/2)-400, 25, 800, 50);
// mystyle.normal.textColor = outColor;
// guiposition.x--;
// GUI.Label (guiposition, ""+ score, mystyle);
// guiposition.x +=2;
// GUI.Label (guiposition, ""+ score, mystyle);
// guiposition.x--;
// guiposition.y--;
// GUI.Label (guiposition, ""+ score, mystyle);
// guiposition.y +=2;
// GUI.Label (guiposition, ""+ score, mystyle);
// guiposition.y--;
mystyle.normal.textColor = fontColor;
GUI.Label (guiposition, ""+ score, mystyle);
}
function StopScore(){
scoring = false;
if (score > savedhighscore ){
PlayerPrefs.SetInt("highscore", score);
}
Application.LoadLevel (2);
}
in the Mac OS X build the score is counting very very slow.
with the tilt of the device the user can rotate the platforms in the android build. i use Input.GetAxis(“Horizontal”) for this in the Mac build to rotate the platforms and the cubes. this are this two scripts:
this for the platforms:
function Update () {
//transform.Translate(-5 * Time.deltaTime, 0, 0);
transform.position.x -= 5 * Time.deltaTime;
////with tilt control
//transform.Rotate(0, 0, -Input.acceleration.y);
transform.Rotate(0, 0, Input.GetAxis("Horizontal")/10);
}
and this for the cubes:
function Update () {
//rigidbody.velocity.y = -15;
////with tilt control
transform.position.x -= 5 * Time.deltaTime;
//transform.Rotate(0, 0, -Input.acceleration.y);
transform.Rotate(0, 0, Input.GetAxis("Horizontal")/10);
}
function OnCollisionEnter (collisionInfo : Collision) {
//transform.parent = collisionInfo.gameObject.transform;
////destroy if hit another badcube
if (collisionInfo.gameObject.tag == "Badcube"){
Destroy (gameObject);
}
}
in the game view all looks fine. but in the Mac build this reacts much more sensitive.