Skip to content

Commit 7b518a7

Browse files
author
MaxAl
committed
accord-netGH-1050 Improved text coloring in Animat; Added unity sample for simple jump learning with activation network;
1 parent bf22798 commit 7b518a7

File tree

279 files changed

+472128
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

279 files changed

+472128
-1
lines changed

Samples/Unity/Unity MachineLearning Animat/Assets/Scripts/References.cs

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ public class References : MonoBehaviour {
1616

1717
public GameObject[] Levels;
1818

19+
private Color _disabledColor = Color.gray;
20+
private Color _enabledColor = Color.black;
21+
1922
public void OnLevelDropdown_ValueChanged() {
2023
for (int i = 0; i < Levels.Length; i++) {
2124
Levels[i].SetActive(false);
@@ -24,14 +27,30 @@ public void OnLevelDropdown_ValueChanged() {
2427
}
2528

2629
public void EnableControls(bool enable) {
27-
LevelSelection.enabled = enable;
30+
LevelSelection.enabled = enable;
2831
LearningAlgorithm.enabled = enable;
32+
33+
LevelSelection.GetComponentInChildren<Text>().color = GetColor(enable);
34+
LearningAlgorithm.GetComponentInChildren<Text>().color = GetColor(enable);
35+
2936
InitialExplorationRate.enabled = enable;
3037
InitialLearningRate.enabled = enable;
3138
LearningIterations.enabled = enable;
3239

40+
InitialExplorationRate.textComponent.color = GetColor(enable);
41+
InitialLearningRate.textComponent.color = GetColor(enable);
42+
LearningIterations.textComponent.color = GetColor(enable);
43+
3344
StartTraining.enabled = enable;
3445
ShowSolution.enabled = enable;
3546
Stop.enabled = !enable;
47+
48+
StartTraining.GetComponentInChildren<Text>().color = GetColor(enable);
49+
ShowSolution.GetComponentInChildren<Text>().color = GetColor(enable);
50+
Stop.GetComponentInChildren<Text>().color = GetColor(!enable);
51+
}
52+
53+
private Color GetColor(bool enable) {
54+
return enable ? _enabledColor : _disabledColor;
3655
}
3756
}

Samples/Unity/Unity Neuro Jump2D/Assets/Plugins.meta

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)