Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Bošániová Monika
Rubics_cube
Commits
58e5d89b
Commit
58e5d89b
authored
Jul 13, 2021
by
Bošániová Monika
Browse files
small changes
parent
497e633d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Assets/Scenes/CubeSolver.unity
View file @
58e5d89b
...
@@ -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
...
...
Assets/Scripts/Automate.cs
View file @
58e5d89b
...
@@ -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>();
...
...
Assets/Scripts/ColorButtons.cs
View file @
58e5d89b
...
@@ -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
;
}
}
}
Assets/Scripts/SolveTwoFace.cs
View file @
58e5d89b
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
);
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment