Not exactly an answer - everything works fine, buttons stay in place regardless the screen rezolution, multitouch works - however this weird behavior occurs: every other control (DriveBackwards and Right now) won't work. I added Right code first, worked, added Left - left worked right stopped to work. Do I have a typo somewhere or is worse?
using UnityEngine;
using System.Collections;
public class PlayerTracksController : TankTracksController {
public float steerG = 0.0f;
public float accelG = 0.0f;
public GUITexture buttonTurnRight;
public GUITexture buttonTurnLeft;
public GUITexture buttonDriveBackwards;
public GUITexture buttonDrive;
public bool Right = false;
public bool Left = false;
public bool DriveBackwards = false;
public bool Drive = false;
void MovementControl(Vector2 position)
{
if (buttonTurnRight.GetScreenRect().Contains(position))
{
Right = true;
}
if (buttonTurnLeft.GetScreenRect().Contains(position))
{
Left = true;
}
if (buttonDriveBackwards.GetScreenRect().Contains(position))
{
DriveBackwards = true;
}
if (buttonDrive.GetScreenRect().Contains(position))
{
Drive = true;
}
}
void Update(){
Right = false;
Left = false;
DriveBackwards = false;
Drive = false;
for (int i=0; i
↧