目录

GetTouchpadTouchPos

获取当前控制器触摸板的触摸位置向量。

Parameter

Parameter Name

Parameter Type

Description

pos

Vector2

将当前控制器的位置向量(x,y)写入pos

手柄触摸板获取到的位置向量的坐标系如下所示,使用时需根据实际坐标系作转换:

Return Values

调用函数成功返回0,失败返回-1。

Examples

if (null == controller) {
    Debug.LogError("Controller is null");
} else {
    Vector2 touchpdPos = new Vector2();
    int ret = controller.GetTouchpadTouchPos(ref touchpdPos);
    if (ret == 0) {
        Debug.Log("Get controller touchpdPos success!");
    } else {
        Debug.Log("Get controller touchpdPos failed!");
    }
}