Commit 086285a3 authored by Bošániová Monika's avatar Bošániová Monika
Browse files

Reset button, bug fixed

parent 5e82b67d
Assets/Icons/rubik timeline.png

2.21 KB | W: | H:

Assets/Icons/rubik timeline.png

10.8 KB | W: | H:

Assets/Icons/rubik timeline.png
Assets/Icons/rubik timeline.png
Assets/Icons/rubik timeline.png
Assets/Icons/rubik timeline.png
  • 2-up
  • Swipe
  • Onion skin
Assets/Prefabs/Inkedtutorial_LI.jpg

1.42 MB | W: | H:

Assets/Prefabs/Inkedtutorial_LI.jpg

245 KB | W: | H:

Assets/Prefabs/Inkedtutorial_LI.jpg
Assets/Prefabs/Inkedtutorial_LI.jpg
Assets/Prefabs/Inkedtutorial_LI.jpg
Assets/Prefabs/Inkedtutorial_LI.jpg
  • 2-up
  • Swipe
  • Onion skin
......@@ -466,7 +466,7 @@ RectTransform:
m_Children:
- {fileID: 1083674771}
m_Father: {fileID: 320450172}
m_RootOrder: 7
m_RootOrder: 8
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
......@@ -706,7 +706,7 @@ RectTransform:
m_Children:
- {fileID: 298701061}
m_Father: {fileID: 320450172}
m_RootOrder: 3
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 1, y: 0}
m_AnchorMax: {x: 1, y: 0}
......@@ -1133,7 +1133,7 @@ RectTransform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 320450172}
m_RootOrder: 10
m_RootOrder: 11
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
......@@ -1579,7 +1579,7 @@ RectTransform:
- {fileID: 888545538}
- {fileID: 645594858}
m_Father: {fileID: 320450172}
m_RootOrder: 9
m_RootOrder: 10
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 1, y: 0}
m_AnchorMax: {x: 1, y: 0}
......@@ -2115,6 +2115,7 @@ RectTransform:
m_Children:
- {fileID: 379963032}
- {fileID: 981341156}
- {fileID: 1797561858}
- {fileID: 1733321296}
- {fileID: 89088904}
- {fileID: 634459033}
......@@ -2854,7 +2855,7 @@ RectTransform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 320450172}
m_RootOrder: 11
m_RootOrder: 12
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
......@@ -3114,7 +3115,7 @@ RectTransform:
m_Children:
- {fileID: 1328158149}
m_Father: {fileID: 320450172}
m_RootOrder: 8
m_RootOrder: 9
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
......@@ -3674,7 +3675,7 @@ RectTransform:
m_Children:
- {fileID: 1576110456}
m_Father: {fileID: 320450172}
m_RootOrder: 4
m_RootOrder: 5
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 1, y: 0}
m_AnchorMax: {x: 1, y: 0}
......@@ -4661,6 +4662,162 @@ Transform:
type: 3}
m_PrefabInstance: {fileID: 740083493}
m_PrefabAsset: {fileID: 0}
--- !u!1 &740857838
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 740857839}
- component: {fileID: 740857841}
- component: {fileID: 740857840}
m_Layer: 5
m_Name: Text (TMP)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &740857839
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 740857838}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1797561858}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: -0.00015258789, y: 0}
m_SizeDelta: {x: 350.92175, y: 66.97693}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &740857840
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 740857838}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: RESET CUBE
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_fontSharedMaterials: []
m_fontMaterial: {fileID: 0}
m_fontMaterials: []
m_fontColor32:
serializedVersion: 2
rgba: 4294967295
m_fontColor: {r: 1, g: 1, b: 1, a: 1}
m_enableVertexGradient: 0
m_colorMode: 3
m_fontColorGradient:
topLeft: {r: 1, g: 1, b: 1, a: 1}
topRight: {r: 1, g: 1, b: 1, a: 1}
bottomLeft: {r: 1, g: 1, b: 1, a: 1}
bottomRight: {r: 1, g: 1, b: 1, a: 1}
m_fontColorGradientPreset: {fileID: 0}
m_spriteAsset: {fileID: 0}
m_tintAllSprites: 0
m_overrideHtmlColors: 0
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_outlineColor:
serializedVersion: 2
rgba: 4278190080
m_fontSize: 50
m_fontSizeBase: 50
m_fontWeight: 400
m_enableAutoSizing: 0
m_fontSizeMin: 18
m_fontSizeMax: 72
m_fontStyle: 1
m_textAlignment: 514
m_characterSpacing: 0
m_wordSpacing: 0
m_lineSpacing: 0
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 0
m_enableWordWrapping: 1
m_wordWrappingRatios: 0.4
m_overflowMode: 0
m_firstOverflowCharacterIndex: -1
m_linkedTextComponent: {fileID: 0}
m_isLinkedTextComponent: 0
m_isTextTruncated: 0
m_enableKerning: 1
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_parseCtrlCharacters: 1
m_isOrthographic: 1
m_isCullingEnabled: 0
m_ignoreRectMaskCulling: 0
m_ignoreCulling: 1
m_horizontalMapping: 0
m_verticalMapping: 0
m_uvLineOffset: 0
m_geometrySortingOrder: 0
m_VertexBufferAutoSizeReduction: 1
m_firstVisibleCharacter: 0
m_useMaxVisibleDescender: 1
m_pageToDisplay: 1
m_margin: {x: 0, y: 0, z: 0, w: 0}
m_textInfo:
textComponent: {fileID: 740857840}
characterCount: 10
spriteCount: 0
spaceCount: 1
wordCount: 2
linkCount: 0
lineCount: 1
pageCount: 1
materialCount: 1
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0
m_spriteAnimator: {fileID: 0}
m_hasFontAssetChanged: 0
m_subTextObjects:
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
m_baseMaterial: {fileID: 0}
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
--- !u!222 &740857841
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 740857838}
m_CullTransparentMesh: 0
--- !u!1 &752663639
GameObject:
m_ObjectHideFlags: 0
......@@ -9077,7 +9234,7 @@ RectTransform:
m_Children:
- {fileID: 1668506854}
m_Father: {fileID: 320450172}
m_RootOrder: 5
m_RootOrder: 6
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
......@@ -10331,7 +10488,7 @@ RectTransform:
m_Children:
- {fileID: 1273888895}
m_Father: {fileID: 320450172}
m_RootOrder: 2
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 1, y: 0}
m_AnchorMax: {x: 1, y: 0}
......@@ -10614,7 +10771,7 @@ RectTransform:
- {fileID: 1785578063}
- {fileID: 1683026937}
m_Father: {fileID: 320450172}
m_RootOrder: 12
m_RootOrder: 13
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
......@@ -10933,6 +11090,160 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1786435071}
m_CullTransparentMesh: 0
--- !u!1 &1797561857
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1797561858}
- component: {fileID: 1797561861}
- component: {fileID: 1797561860}
- component: {fileID: 1797561859}
- component: {fileID: 1797561862}
m_Layer: 5
m_Name: ResetCube Button
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1797561858
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1797561857}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 740857839}
m_Father: {fileID: 320450172}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 1, y: 0}
m_AnchorMax: {x: 1, y: 0}
m_AnchoredPosition: {x: -1518.46, y: 543}
m_SizeDelta: {x: 350.922, y: 66.97691}
m_Pivot: {x: 1, y: 0}
--- !u!114 &1797561859
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1797561857}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Navigation:
m_Mode: 3
m_SelectOnUp: {fileID: 0}
m_SelectOnDown: {fileID: 0}
m_SelectOnLeft: {fileID: 0}
m_SelectOnRight: {fileID: 0}
m_Transition: 1
m_Colors:
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
m_HighlightedColor: {r: 0.62352943, g: 0.5764706, b: 0.6901961, a: 0.5882353}
m_PressedColor: {r: 0.62352943, g: 0.5764706, b: 0.6901961, a: 0.7058824}
m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
m_ColorMultiplier: 1
m_FadeDuration: 0.1
m_SpriteState:
m_HighlightedSprite: {fileID: 0}
m_PressedSprite: {fileID: 0}
m_SelectedSprite: {fileID: 0}
m_DisabledSprite: {fileID: 0}
m_AnimationTriggers:
m_NormalTrigger: Normal
m_HighlightedTrigger: Highlighted
m_PressedTrigger: Pressed
m_SelectedTrigger: Selected
m_DisabledTrigger: Disabled
m_Interactable: 1
m_TargetGraphic: {fileID: 1797561860}
m_OnClick:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 1797561862}
m_MethodName: resetCube
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
--- !u!114 &1797561860
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1797561857}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.62352943, g: 0.5764706, b: 0.6901961, a: 1}
m_RaycastTarget: 1
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0}
m_Type: 1
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!222 &1797561861
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1797561857}
m_CullTransparentMesh: 0
--- !u!114 &1797561862
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1797561857}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: ee90c6a4f2a8f5745b6a3d0e00858805, type: 3}
m_Name:
m_EditorClassIdentifier:
wholeCube: {fileID: 22452980}
cubeMap: {fileID: 981341155}
algorthmPhaseBox: {fileID: 458956189}
errorMsgBox: {fileID: 213162959}
timeline: {fileID: 1773919001}
red: {fileID: 2100000, guid: 008ed915e9747194d8473e08a7536708, type: 2}
orange: {fileID: 2100000, guid: 2e33c8fb25bdc3941b1d3dfde4ddeb9e, type: 2}
blue: {fileID: 2100000, guid: 8b908df66e033894e952ac577be7884d, type: 2}
yellow: {fileID: 2100000, guid: 51d0d8d3349a2f547b9a9bdc42876e8e, type: 2}
white: {fileID: 2100000, guid: 5601add48eb7ebe4cb5c251dde8c8998, type: 2}
green: {fileID: 2100000, guid: 21f899676ae3b3e458ec298f4589efe4, type: 2}
--- !u!1 &1812481253
GameObject:
m_ObjectHideFlags: 0
......@@ -12129,7 +12440,7 @@ RectTransform:
m_Children:
- {fileID: 337925873}
m_Father: {fileID: 320450172}
m_RootOrder: 6
m_RootOrder: 7
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
......
......@@ -24,6 +24,7 @@ public class Automate : MonoBehaviour
private Vector3 targetVector;
private float progressOfRotation;
private float angle = 0;
private static List<string> clearList = new List<string>();
private string firstPhase = "Solve white face";
private string secondPhase = "Solve second row";
......@@ -382,7 +383,16 @@ public class Automate : MonoBehaviour
public static void setAutomateList(List<string> moves)
{
movelist.AddCollection(moves);
movelistIterator.Reset();
if(moves.Count == 4 && moves[0] == "1")
{
movelist.AddCollection(clearList);
movelistIterator.Reset();
}
else
{
movelist.AddCollection(moves);
movelistIterator.Reset();
}
}
}
......@@ -18,6 +18,7 @@ public class ColorButtons : MonoBehaviour
private string errorMassage = "You can't recolor middle pieces!";
private void Start()
{
errorTextOutput = GameObject.Find("Error Message").GetComponent<Text>();
......@@ -116,4 +117,6 @@ public class ColorButtons : MonoBehaviour
{
return colorsChanged;
}
}
using System.Collections;
using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class ResetCube : MonoBehaviour
{
public GameObject wholeCube;
public GameObject cubeMap;
public Text algorthmPhaseBox;
public Text errorMsgBox;
public GameObject timeline;
public Material red;
public Material orange;
public Material blue;
public Material yellow;
public Material white;
public Material green;
private List<string> clearList = new List<string>();
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
public void resetCube()
{
if (!CubeState.autoRotating)
{
ResetTextBoxes();
Automate.setAutomateList(clearList);
foreach (Transform cube in wholeCube.transform)
{
foreach (Transform plane in cube.transform)
{
Vector3 roundedPos = new Vector3(
(float)Math.Round(plane.transform.position.x * 10) / 10f,
(float)Math.Round(plane.transform.position.y * 10) / 10f,
(float)Math.Round(plane.transform.position.z * 10) / 10f);
string side2D = "";
int index = 0;
if (roundedPos.x == 1.5)
{
side2D = "Right";
plane.GetComponent<Renderer>().material = orange;
index = (-(int)roundedPos.y + 1) * 3 + (int)roundedPos.z + 1;
}
else
if (roundedPos.x == -1.5)
{
side2D = "Left";
plane.GetComponent<Renderer>().material = red;
index = (-(int)roundedPos.y + 1) * 3 - (int)roundedPos.z + 1;
}
else
if (roundedPos.y == 1.5)
{
side2D = "Up";
plane.GetComponent<Renderer>().material = white;
index = (-(int)roundedPos.z + 1) * 3 + (int)roundedPos.x + 1;
}
else
if (roundedPos.y == -1.5)
{
side2D = "Down";
plane.GetComponent<Renderer>().material = yellow;
index = ((int)roundedPos.z + 1) * 3 + (int)roundedPos.x + 1;
}
else
if (roundedPos.z == 1.5)
{
side2D = "Back";
plane.GetComponent<Renderer>().material = green;
index = (-(int)roundedPos.y + 1) * 3 - (int)roundedPos.x + 1;
}
else
if (roundedPos.z == -1.5)
{
side2D = "Front";
plane.GetComponent<Renderer>().material = blue;
index = (-(int)roundedPos.y + 1) * 3 + (int)roundedPos.x + 1;
}
else
continue;
cubeMap
.transform.Find(side2D)
.transform.Find(index.ToString())
.transform.GetComponent<Image>()
.color = plane.GetComponent<Renderer>().material.color;
cubeMap
.transform.Find(side2D)
.transform.Find(index.ToString()).tag = plane.GetComponent<Renderer>().material.name[0].ToString();