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

small changes

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