Beispiel #1
0
    private static void UpdateLeftJoystickPosition(Joystick_Controller leftJoystickController)
    {
        Touch[] touches = Input.touches;

        if (Input.touchCount == 0)
        {
            leftJoystickController.ResetPosition();
        }

        for (int i = 0; i < Input.touchCount; i++)
        {
            if (touches[i].position.x < Screen.width / 3 && touches[i].position.y < Screen.height / 2)
            {
                leftJoystickController.UpdatePosition(touches[i].position);
            }
        }
    }
Beispiel #2
0
	void Start () {
        GameObject leftJoystick = GameObject.Find("Left_Joystick");
        leftJoystickController = leftJoystick.GetComponent<Joystick_Controller>();
	}