private void JoystickExecuted(FingersJoystickScript script, Vector2 amount) { Vector3 pos = Mover.transform.position; pos.x += (amount.x * Speed * Time.deltaTime); pos.y += (amount.y * Speed * Time.deltaTime); Mover.transform.position = pos; }
private void JoystickExecuted(FingersJoystickScript script, Vector2 amount) { #if LOG_JOYSTICK Debug.LogFormat("Joystick: {0:0.000000},{1:0.000000}", amount.x, amount.y); #endif GameObject mover = (script == JoystickScript ? Mover : Mover2); if (mover != null) { Vector3 pos = mover.transform.position; pos.x += (amount.x * Speed * Time.deltaTime); pos.y += (amount.y * Speed * Time.deltaTime); mover.transform.position = pos; } }