fix:修改体感服不震动问题,先隐藏手臂震动

This commit is contained in:
bzx
2025-08-14 11:19:19 +08:00
parent 19064f1aaf
commit 53c76aa20d
4 changed files with 321 additions and 4 deletions

View File

@@ -119,13 +119,19 @@ public class TrueGearEffectManager : MonoBehaviour
androidConnector.ConnectToDevice(item.address);
Debug.Log(string.Format("Device Connect: {0}, {1}", item.name, item.address));
isGetConnect = true;
androidConnector.ModifyElectricalPercent(30);
return;
}
}
Debug.Log("No device found");
}
public void ChangeElectricalLevel()
{
TruegearAndroidConnector androidConnector = TruegearAndroidConnector.Instance;
bool isZD= androidConnector.ModifyElectricalPercent(150);
Debug.LogError("是否震动:"+isZD);
}
/// <summary>
/// 断开连接
/// </summary>
@@ -169,7 +175,7 @@ public class TrueGearEffectManager : MonoBehaviour
{
string indexStr = string.Join(",", motorIndex);
bool isOne=actionType != "Shake";
if (!isOne)
if (isOne)
endTime = 0;
Debug.Log(indexStr);
string json = $@"
@@ -218,6 +224,7 @@ public class TrueGearEffectManager : MonoBehaviour
}
public void OnHit(bool isUp, int index,bool isArm)
{
//ChangeElectricalLevel();
List<int> motorIDs = new List<int>();
string hitPart= hitParts[index];
switch (hitPart)