MagicaPhysicsManagerAPI.cs 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. // Magica Cloth.
  2. // Copyright (c) MagicaSoft, 2020-2022.
  3. // https://magicasoft.jp
  4. using UnityEngine;
  5. namespace MagicaCloth
  6. {
  7. /// <summary>
  8. /// MagicaPhysicsManager API
  9. /// </summary>
  10. public partial class MagicaPhysicsManager : CreateSingleton<MagicaPhysicsManager>
  11. {
  12. /// <summary>
  13. /// 1秒あたりの更新回数
  14. /// Updates per second.
  15. /// </summary>
  16. public UpdateTimeManager.UpdateCount UpdatePerSeccond
  17. {
  18. get
  19. {
  20. return (UpdateTimeManager.UpdateCount)UpdateTime.UpdatePerSecond;
  21. }
  22. set
  23. {
  24. UpdateTime.SetUpdatePerSecond(value);
  25. }
  26. }
  27. /// <summary>
  28. /// 更新モード
  29. /// Update mode.
  30. /// </summary>
  31. public UpdateTimeManager.UpdateMode UpdateMode
  32. {
  33. get
  34. {
  35. return UpdateTime.GetUpdateMode();
  36. }
  37. set
  38. {
  39. UpdateTime.SetUpdateMode(value);
  40. }
  41. }
  42. /// <summary>
  43. /// グローバルタイムスケールを設定する
  44. /// Set the global time scale.
  45. /// </summary>
  46. /// <param name="timeScale">0.0-1.0</param>
  47. public void SetGlobalTimeScale(float timeScale)
  48. {
  49. UpdateTime.TimeScale = Mathf.Clamp01(timeScale);
  50. }
  51. /// <summary>
  52. /// グローバルタイムスケールを取得する
  53. /// Get global time scale.
  54. /// </summary>
  55. /// <returns></returns>
  56. public float GetGlobalTimeScale()
  57. {
  58. return UpdateTime.TimeScale;
  59. }
  60. /// <summary>
  61. /// 遅延実行時の未来予測率(0.0-1.0)
  62. /// Future prediction rate at the time of delayed execution (0.0-1.0).
  63. /// </summary>
  64. public float FuturePredictionRate
  65. {
  66. get
  67. {
  68. return UpdateTime.FuturePredictionRate;
  69. }
  70. set
  71. {
  72. UpdateTime.FuturePredictionRate = value;
  73. }
  74. }
  75. }
  76. }