merge
merge and property
This commit is contained in:
29
Assets/Scripts/UVC/TopUI/SimulatorSpeedCommand.cs
Normal file
29
Assets/Scripts/UVC/TopUI/SimulatorSpeedCommand.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
using Simulator;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UVC.Network;
|
||||
using UVC.UI.Commands;
|
||||
using Simulator.Config;
|
||||
|
||||
namespace Simulator.UI.Commands
|
||||
{
|
||||
public class SimulatorSpeedCommand : ICommand
|
||||
{
|
||||
private List<int> _parameter = new List<int> { 1, 2, 3, 5, 10 };
|
||||
int index = 0;
|
||||
public SimulatorSpeedCommand(object? parameter = null)
|
||||
{
|
||||
//_parameter = parameter as List<int>;
|
||||
}
|
||||
|
||||
public async void Execute(object? parameter = null)
|
||||
{
|
||||
if (index++ >= _parameter.Count - 1)
|
||||
{
|
||||
index = 0;
|
||||
}
|
||||
SimulationConfig.param.speed = _parameter[index];
|
||||
SimulationSettings.Instance.SetSimulationConfig();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user