@Quantos2007

Не знаю почему выдает ошибку cs1585? Строка(32,9)?

using UnityEngine;
using UnityEngine.InputSystem;

namespace InfimaGames.LowPolyShooterPack
{
///
/// Time Manager.
///
public class TimeHandler : MonoBehaviour
{
public InputAction
[Header("Settings")]

[Tooltip("Value the time scale gets updated by every time.")]
[SerializeField]

///
/// Determines if the time is stopped.
///

///
/// Current Time Scale.
///

///
/// Updates The Time Scale.
///

public float increment = 0.1f;
public bool paused;
public float current = 1.0f;
///
public void Scale()
{
//Update Time Scale.
Time.timeScale = current;
}

///
/// Change Time Scale.
///
public void Change(float value = 1.0f)
{
//Save Value.
current = value;

//Update.
Scale();
}

///
/// Increase Time Scale Value.
///
private void Increase(float value = 1.0f)
{
//Change.
Change(Mathf.Clamp01(current + value));
}

///
/// Pause.
///
private void Pause()
{
//Pause.
paused = true;

//Pause.
Time.timeScale = 0.0f;
}

///
/// Toggle Pause.
///
private void Toggle()
{
//Toggle Pause.
if (paused)
Unpause();
else
Pause();
}

///
/// Unpause.
///
private void Unpause()
{
//Unpause.
paused = false;

//Unpause.
Change(current);
}

///
/// Increase Time Scale Event.
///
public virtual void OnIncrease(InputAction.CallbackContext context)
{
//Switch.
switch (context.phase)
{
//Performed.
case InputActionPhase.Performed:
//Increase.
Increase(increment);
break;
}
}

///
/// Increase Time Scale Event.
///
public virtual void OnDecrease(InputAction.CallbackContext context)
{
//Switch.
switch (context.phase)
{
//Performed.
case InputActionPhase.Performed:
//Increase.
Increase(-increment);
break;
}
}

///
/// Toggle Time Scale Stop.
///
public virtual void OnToggle(InputAction.CallbackContext context)
{
//Switch.
switch (context.phase)
{
//Performed.
case InputActionPhase.Performed:
//Toggle.
Toggle();
break;
}
}
}
}
  • Вопрос задан
  • 59 просмотров
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Похожие вопросы