added cables
This commit is contained in:
@@ -7,15 +7,15 @@ public class CableMiniGame : MonoBehaviour
|
||||
[System.Serializable]
|
||||
public class Cable
|
||||
{
|
||||
public string colorName; // Název barvy kabelu
|
||||
public Button sourceButton; // Zdrojový konektor
|
||||
public Button targetButton; // Cílový konektor
|
||||
public Image cableImage; // Pro změnu barvy kabelu
|
||||
public string colorName;
|
||||
public Button sourceButton;
|
||||
public Button targetButton;
|
||||
public Image cableImage;
|
||||
}
|
||||
|
||||
public Cable[] cables;
|
||||
public string previousSceneName; // Scéna kam se vrátit při chybě
|
||||
public Color wrongAttemptColor = Color.white; // Bliknutí při špatném pokusu
|
||||
public string previousSceneName;
|
||||
public Color wrongAttemptColor = Color.white;
|
||||
public float blinkDuration = 0.2f;
|
||||
|
||||
private string selectedColor = null;
|
||||
@@ -42,13 +42,11 @@ public class CableMiniGame : MonoBehaviour
|
||||
|
||||
if (selectedColor == cable.colorName)
|
||||
{
|
||||
// Správné propojení
|
||||
Debug.Log("Správně!");
|
||||
cable.cableImage.color = GetColorFromName(selectedColor);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Špatné propojení – reset scény
|
||||
Debug.Log("Špatně, restart!");
|
||||
StartCoroutine(BlinkAndReset(cable.cableImage));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user