Commit 58e5d89b authored by Bošániová Monika's avatar Bošániová Monika
Browse files

small changes

parent 497e633d
......@@ -456,7 +456,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 7c2285ac273aba44692349e20e117c1f, type: 3}
m_Name:
m_EditorClassIdentifier:
cubeState: {fileID: 0}
errorMsgBox: {fileID: 213162959}
--- !u!1 &62275331
GameObject:
m_ObjectHideFlags: 0
......
......@@ -13,7 +13,7 @@ public class Automate : MonoBehaviour
//static List<string> undoMoveList = new List<string>() { };
public static int actualPosition = 0;
public static bool shuffleDone = false;
bool AutomatePlaying = false;
public static bool AutomatePlaying = false;
//bool automateRotation = false;
//CubeMapMatrix cubeMap;
Colors side = Colors.Blue;
......@@ -91,8 +91,9 @@ public class Automate : MonoBehaviour
//moveList.Remove(moveList[0]);
}
if (shuffleDone && actualPosition == moveList.Count)
if (actualPosition == moveList.Count)
{
//shuffleDone remove from if
//print("2");
shuffleDone = false;
......@@ -143,7 +144,7 @@ public class Automate : MonoBehaviour
public void Shuffle()
{
AutomatePlaying = false;
//dopisat aby sa negenerovali opacne
List<string> moves = new List<string>();
int shuffleLength = UnityEngine.Random.Range(10, 30);
......@@ -163,6 +164,7 @@ public class Automate : MonoBehaviour
shuffleDone = true;
actualPosition = 0;
//ClickableRotator.SetActive(false);
AutomatePlaying = true;
//moveList = new List<string>();
......
......@@ -14,6 +14,7 @@ public class ColorButtons : MonoBehaviour
public Material actualMaterial;
private Colors beforeButtonColor;
private bool colorsChanged = false;
private string errorMassage = "You can't recolor middle pieces!";
......@@ -45,6 +46,8 @@ public class ColorButtons : MonoBehaviour
if (actualMaterial)
{
mesh.material = actualMaterial;
colorsChanged = true;
errorTextOutput.text = "";
Rotator.Update2DMap(wholeCube, cube2DMap);
}
}
......@@ -103,4 +106,14 @@ public class ColorButtons : MonoBehaviour
button.Find("Text").GetComponent<Text>().text = "";
}
}
public void setColorsChanged(bool b)
{
colorsChanged = b;
}
public bool getColorsChanged()
{
return colorsChanged;
}
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using Kociemba;
public class SolveTwoFace : MonoBehaviour
{
//public ReadCube readCube;
public CubeState cubeState;
public Text errorMsgBox;
private CubeState cubeState;
private bool doOnce = true;
// Start is called before the first frame update
......@@ -44,11 +46,13 @@ public class SolveTwoFace : MonoBehaviour
////convert the solved moves from a string to a list
List<string> solutionList = StringToList(solution);
////Automate the list
//Automate.shuffleDone = false;
//Automate.setAutomateList(new List<string> { "F" } );
Automate.setAutomateList(solutionList);
Automate.actualPosition = 0;
Automate.AutomatePlaying = true;
print(solution);
}
......@@ -80,8 +84,13 @@ public class SolveTwoFace : MonoBehaviour
//Automate.shuffleDone = false;
//Automate.setAutomateList(new List<string> { "F" } );
Automate.setAutomateList(solutionList);
//Automate.actualPosition = 0;
Automate.actualPosition = 0;
Automate.AutomatePlaying = true;
if(info == "Error")
{
errorMsgBox.text = "Cube is not solvable!";
}
print("solution:" + solution);
print(info);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment