So my game is basically of a bird who has to fly through small circles in order to gain speed and lift…its on android …so what i want is that to make my bird go left and right by touch on two gui texture and also give them a small rotation on z axis…my cose works fine on pc but its horrible in mobile(zte blade)…my draw calls are 18-25 and both dynamic batching and static happens…my verts are 5k and tris are 7k so i know my frame rates are solid 45 to 60…
my code
#pragma strict
var gf:Transform;
var g:float=0;
public var left=false;
var xx:int;
var gui:GUITexture;
///InvokeRepeating("ggg", 0, 0.01);
function Awake()
{
}
function FixedUpdate () {
if(Input.touchCount>0){
var touch:Touch=Input.touches[0];
if(touch.phase==TouchPhase.Began || touch.phase==TouchPhase.Stationary){
if(guiTexture.HitTest(touch.position)){
g=g-0.04;
if(g<-1){
g=-1;
}else{
}
}
}
}else{
if(g<0){
g=g+0.04;
if(g>0){
g=0;
}
}
}
if(Input.touchCount>0) {
var touch2:Touch=Input.touches[0];
if(touch2.phase==TouchPhase.Began ||touch2.phase==TouchPhase.Stationary){
if(gui.HitTest(touch2.position)) {
g=g+0.04;
if(g>1){
g=1;
}else{
}
}
}
}else{
if(g>0){
g=g-0.04;
if(g<0) {
g=0;
}
}
}
gf.transform.localEulerAngles.z=-g*25;
//transform.RotateAround(Vector3(0,0,g),5);
gf.transform.Rotate(Vector3(0,g*Time.smoothDeltaTime*xx*2,0),Space.World);
}