Skip to content

Commit

Permalink
Finished Param methods
Browse files Browse the repository at this point in the history
  • Loading branch information
Personator01 committed Jan 18, 2024
1 parent b7e3ca6 commit 6ab9bae
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 7 additions & 3 deletions UnityBCI2000.cs
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ public int GetEvent(string eventName)
/// <param name="minValue">The parameter's minimum value</param>
/// <param name="maxValue">The parameter's maximum value</param>
public void AddParam(string section, string name, string defaultValue, string minValue, string maxValue) {
paramCmds.Enqueue("add parameter " + section + " string " + name + "= " + defaultValue + " " + defaultValue + " " + minValue + " " + maxValue);
paramAddCmds.Enqueue("add parameter " + section + " string " + name + "= " + defaultValue + " " + defaultValue + " " + minValue + " " + maxValue);
}

/// <summary>
Expand All @@ -223,7 +223,7 @@ public void AddParam(string section, string name, string defaultValue, string mi
/// <param name="defaultValue">The default value of the parameter</param>
public void AddParam(string section, string name, string defaultValue)
{
paramCmds.Enqueue("add parameter " + section + " string " + name + "= " + defaultValue + " " + defaultValue + " % %");
paramAddCmds.Enqueue("add parameter " + section + " string " + name + "= " + defaultValue + " " + defaultValue + " % %");
}

/// <summary>
Expand Down Expand Up @@ -283,6 +283,7 @@ public void ExecuteCommand(string command, bool now = false)
private Queue<string> cmds = new Queue<string>();
private bool afterFirst = false;
private Dictionary<string, List<string>> modules;
private Queue<string> paramAddCmds = new Queue<string>();
//Is set to true on first Update();
private bool isStarted = false;

Expand All @@ -302,7 +303,10 @@ void Start()
bci.LogStates = LogStates;
bci.LogPrompts = LogPrompts;

bci.Connect(InitCommands, eventnames.ToArray());
List<string> initCmdsWithParams = new List<string>(InitCommands);
initCmdsWithParams.AddRange(paramAddCmds);

bci.Connect(initCmdsWithParams.ToArray(), eventnames.ToArray());

List<string> module1ArgsList;
if (Module1Args.Length == 0)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name":"org.bci2000.unitybci2000",
"version":"0.1.0",
"version":"0.3.1",
"description":"Package which integrates BCI2000 with Unity",
"displayName":"BCI2000",
"unity":"2020.3",
Expand Down

0 comments on commit 6ab9bae

Please # to comment.