public void Play(ScaleOption option = null) { if (option == null) { option = new ScaleOption(Intensity, Duration); } switch (FeedbackType) { case FeedbackType.DotMode: if (DotPoints == null) { Debug.LogError("DotPoints not defined"); return; } player.Submit(_key, ToPositionType(Position), DotPoints, TimeMillis); break; case FeedbackType.PathMode: if (Points == null) { Debug.LogError("Points not defined"); return; } player.Submit(_key, ToPositionType(Position), new List <PathPoint>(Convert(Points)), TimeMillis); break; case FeedbackType.TactFile: if (!isOriginFileRegistered) { isOriginFileRegistered = true; var feedbackFile = CommonUtils.ConvertJsonStringToTactosyFile(FeedbackFile.Value); //Debug.Log("Register tact file " + FeedbackFile.Id + ", " + FeedbackFile.Key); player.Register(FeedbackFile.Id, feedbackFile.Project); } if (FeedbackFile.Type == BhapticsUtils.TypeVest) { player.SubmitRegisteredVestRotation(FeedbackFile.Id, _key, new RotationOption(VestRotationAngleX + TactFileOffsetX, VestRotationOffsetY + TactFileOffsetY), option); } else if (FeedbackFile.Type == BhapticsUtils.TypeTactosy && IsReflectTactosy) { if (!isRegistered) { isRegistered = true; var project = BhapticsUtils.ReflectLeftRight(FeedbackFile.Value); player.Register(FeedbackFile.Id + "Reflect", project); } player.SubmitRegistered(FeedbackFile.Id + "Reflect", _key, option); } else { player.SubmitRegistered(FeedbackFile.Id, _key, option); } break; } }
public void Play(ScaleOption option = null) { if (option == null) { option = new ScaleOption(Intensity, Duration); } switch (FeedbackType) { case FeedbackType.DotMode: if (DotPoints == null) { Debug.LogError("DotPoints not defined"); return; } player.Submit(_key, ToPositionType(Position), DotPoints, TimeMillis); break; case FeedbackType.PathMode: if (Points == null) { Debug.LogError("Points not defined"); return; } player.Submit(_key, ToPositionType(Position), new List <PathPoint>(Convert(Points)), TimeMillis); break; case FeedbackType.TactFile: if (currentFeedbackFileKey != FeedbackFile.Id) { currentFeedbackFileKey = FeedbackFile.Id; player.RegisterTactFileStr(currentFeedbackFileKey, FeedbackFile.Value); } if (FeedbackFile.Type == BhapticsUtils.TypeVest || FeedbackFile.Type == BhapticsUtils.TypeTactot) { player.SubmitRegisteredVestRotation(currentFeedbackFileKey, _key, new RotationOption(VestRotationAngleX + TactFileOffsetX, VestRotationOffsetY + TactFileOffsetY), option); } else if (IsReflectTactosy && (FeedbackFile.Type == BhapticsUtils.TypeTactosy || FeedbackFile.Type == BhapticsUtils.TypeTactosy2)) { var reflectKey = FeedbackFile.Id + "Reflect"; if (currentFeedbackFileKeyReflect != reflectKey) { player.RegisterTactFileStrReflected(reflectKey, FeedbackFile.Value); currentFeedbackFileKeyReflect = reflectKey; } player.SubmitRegistered(reflectKey, _key, option); } else { player.SubmitRegistered(currentFeedbackFileKey, _key, option); } break; } }
public void Play(ScaleOption option = null) { if (option == null) { option = new ScaleOption(Intensity, Duration); } switch (FeedbackType) { case FeedbackType.DotMode: if (DotPoints == null) { Debug.LogError("DotPoints not defined"); return; } player.Submit(_key, ToPositionType(Position), DotPoints, TimeMillis); break; case FeedbackType.PathMode: if (Points == null) { Debug.LogError("Points not defined"); return; } player.Submit(_key, ToPositionType(Position), new List <PathPoint>(Convert(Points)), TimeMillis); break; case FeedbackType.TactFile: if (!isOriginFileRegistered) { isOriginFileRegistered = true; player.RegisterTactFileStr(FeedbackFile.Id, FeedbackFile.Value); } //#if UNITY_EDITOR_WIN // // WHEN CHANGED // TODO player.RegisterTactFileStr(FeedbackFile.Id, FeedbackFile.Value); //#endif if (FeedbackFile.Type == BhapticsUtils.TypeVest || FeedbackFile.Type == BhapticsUtils.TypeTactot) { player.SubmitRegisteredVestRotation(FeedbackFile.Id, _key, new RotationOption(VestRotationAngleX + TactFileOffsetX, VestRotationOffsetY + TactFileOffsetY), option); } else if (IsReflectTactosy && (FeedbackFile.Type == BhapticsUtils.TypeTactosy || FeedbackFile.Type == BhapticsUtils.TypeTactosy2)) { var reflectKey = FeedbackFile.Id + "Reflect"; if (!isRegistered) { isRegistered = true; player.RegisterTactFileStrReflected(reflectKey, FeedbackFile.Value); } player.SubmitRegistered(reflectKey, _key, option); } else { player.SubmitRegistered(FeedbackFile.Id, _key, option); } break; } }