Commit 09346fcb authored by Bošániová Monika's avatar Bošániová Monika
Browse files

tutorial update

parent b64b096f
......@@ -331,6 +331,8 @@ GameObject:
- component: {fileID: 22452982}
- component: {fileID: 22452985}
- component: {fileID: 22452988}
- component: {fileID: 22452989}
- component: {fileID: 22452990}
m_Layer: 0
m_Name: Cube
m_TagString: Untagged
......@@ -485,6 +487,42 @@ MonoBehaviour:
Goal: {fileID: 1329246066}
nextButton: {fileID: 1844095519}
result: {fileID: 376775525}
--- !u!114 &22452989
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 22452980}
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!114 &22452990
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 22452980}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 916933c63c015ca4a952829043b91c1a, type: 3}
m_Name:
m_EditorClassIdentifier:
progressBar: {fileID: 1955910192}
--- !u!1 &29483550
GameObject:
m_ObjectHideFlags: 0
......@@ -10735,6 +10773,7 @@ RectTransform:
- {fileID: 981341156}
- {fileID: 1329246067}
- {fileID: 376775524}
- {fileID: 889118086}
m_Father: {fileID: 320450172}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
......@@ -11351,6 +11390,24 @@ MonoBehaviour:
m_EditorClassIdentifier:
rubicsCube: {fileID: 22452980}
Cubes2DMap: {fileID: 981341155}
FrontMaterial: {fileID: 2100000, guid: 2e33c8fb25bdc3941b1d3dfde4ddeb9e, type: 2}
FrontMaterialUnselected: {fileID: 2100000, guid: 2affacaf028215442864c5cdc755496a,
type: 2}
BackMaterial: {fileID: 2100000, guid: 008ed915e9747194d8473e08a7536708, type: 2}
BackMaterialUnselected: {fileID: 2100000, guid: fbcb85227584c9c4595c0ceb742de327,
type: 2}
LeftMaterial: {fileID: 2100000, guid: 21f899676ae3b3e458ec298f4589efe4, type: 2}
LeftMaterialUnselected: {fileID: 2100000, guid: 9547951ddf9347f4c887d906b94b391e,
type: 2}
RightMaterial: {fileID: 2100000, guid: 8b908df66e033894e952ac577be7884d, type: 2}
RightMaterialUnselected: {fileID: 2100000, guid: 1c50e70cec7762242824914c167c7835,
type: 2}
UpMaterial: {fileID: 2100000, guid: 2e33c8fb25bdc3941b1d3dfde4ddeb9e, type: 2}
UpMaterialUnselected: {fileID: 2100000, guid: 2affacaf028215442864c5cdc755496a,
type: 2}
DownMaterial: {fileID: 2100000, guid: 5601add48eb7ebe4cb5c251dde8c8998, type: 2}
DownMaterialUnselected: {fileID: 2100000, guid: 8368f85fde1a4b74783247dbd4550487,
type: 2}
--- !u!65 &837318597
BoxCollider:
m_ObjectHideFlags: 0
......@@ -12156,6 +12213,81 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 888545537}
m_CullTransparentMesh: 0
--- !u!1 &889118085
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 889118086}
- component: {fileID: 889118088}
- component: {fileID: 889118087}
m_Layer: 5
m_Name: ProgressBarBackground
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &889118086
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 889118085}
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: 1955910191}
m_Father: {fileID: 768850481}
m_RootOrder: 4
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, y: 467}
m_SizeDelta: {x: 500, y: 75}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &889118087
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 889118085}
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: 1, g: 1, b: 1, a: 0.23921569}
m_RaycastTarget: 1
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 0}
m_Type: 0
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 &889118088
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 889118085}
m_CullTransparentMesh: 0
--- !u!1 &896409798
GameObject:
m_ObjectHideFlags: 0
......@@ -23305,6 +23437,17 @@ MonoBehaviour:
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
- m_Target: {fileID: 22452989}
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 &1844095522
MonoBehaviour:
m_ObjectHideFlags: 0
......@@ -23367,7 +23510,7 @@ MonoBehaviour:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1844095519}
m_Enabled: 1
m_Enabled: 0
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4e2407f613e40544d94d16109d7c0cd0, type: 3}
m_Name:
......@@ -24336,6 +24479,80 @@ MonoBehaviour:
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
--- !u!1 &1955910190
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1955910191}
- component: {fileID: 1955910193}
- component: {fileID: 1955910192}
m_Layer: 5
m_Name: ProgressBar
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1955910191
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1955910190}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 889118086}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0.5}
m_AnchorMax: {x: 0, y: 0.5}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 500, y: 75}
m_Pivot: {x: 0, y: 0.5}
--- !u!114 &1955910192
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1955910190}
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.30311564, g: 0.9811321, b: 0.28230685, a: 0.80784315}
m_RaycastTarget: 1
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 0}
m_Type: 0
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 &1955910193
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1955910190}
m_CullTransparentMesh: 0
--- !u!1 &1957685601
GameObject:
m_ObjectHideFlags: 0
......
......@@ -23,7 +23,7 @@ public class Automate : MonoBehaviour
private List<string> waitingMoves = new List<string>();
private Vector3 targetVector;
private float progressOfRotation = 20;
private float progressOfRotation;
private float angle = 0;
private static List<string> clearList = new List<string>();
......@@ -32,6 +32,8 @@ public class Automate : MonoBehaviour
private string thirdPhase = "Solve third rows's corners";
private string fourthPhase = "Solve third row's middles";
const int StepsToRotate = 20;
//private readonly List<string> allMoves = new List<string>()
// { "U", "D", "L", "R", "F", "B",
// "U2", "D2", "L2", "R2", "F2", "B2",
......@@ -44,6 +46,7 @@ public class Automate : MonoBehaviour
// Start is called before the first frame update
void Start()
{
Debug.Log("new Automate");
cubeState = FindObjectOfType<CubeState>();
CubeState.started = true;
movingParts = new GameObject();
......@@ -56,9 +59,9 @@ public class Automate : MonoBehaviour
if (CubeState.autoRotating)
{
Debug.Log("progressOfRotation " + progressOfRotation);
movingParts.transform.RotateAround(Vector3.zero, targetVector, angle/20);
movingParts.transform.RotateAround(Vector3.zero, targetVector, angle / StepsToRotate);
progressOfRotation++;
if(progressOfRotation >= 20)
if(progressOfRotation >= StepsToRotate)
{
foreach (Transform child in movingParts.transform)
{
......@@ -78,9 +81,9 @@ public class Automate : MonoBehaviour
}
else
{
Debug.Log("waitingMoves.Count " + waitingMoves.Count);
if (waitingMoves.Count > 0)
{
Debug.Log("waitingMoves.Count " + waitingMoves.Count);
DoMoveNow(waitingMoves[0]);
waitingMoves.RemoveAt(0);
}
......@@ -166,8 +169,8 @@ public class Automate : MonoBehaviour
int shuffleLength = UnityEngine.Random.Range(10, 30);
for (int i = 0; i < shuffleLength; i++)
{
int randomMove = UnityEngine.Random.Range(0, Enum.GetNames(typeof(Assets.Scripts.Moves)).Length);
moves.Add(((Assets.Scripts.Moves)randomMove).ToString());
int randomMove = UnityEngine.Random.Range(0, Enum.GetNames(typeof(Moves)).Length);
moves.Add(((Moves)randomMove).ToString());
//allMoves[randomMove]);
}
movelist.AddCollection(moves);
......
using System.Collections;
using System.Collections.Generic;
public enum Colors
{
White, Red, Blue, Orange, Green, Yellow
}
fileFormatVersion: 2
guid: 3eeb1e74cacf3c84884d1421e13e9bee
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
namespace Assets.Scripts
{
public enum Moves
{ U, D, L, R, F, B,
public enum Moves
{ U, D, L, R, F, B,
U2, D2, L2, R2, F2, B2,
Ui, Di, Li, Ri, Fi, Bi,
};
};
public enum Colors
{
White, Red, Blue, Orange, Green, Yellow
}
public enum Materials
{
FrontMaterial,
FrontMaterialUnselected,
BackMaterial,
BackMaterialUnselected,
LeftMaterial,
LeftMaterialUnselected,
RightMaterial,
RightMaterialUnselected,
UpMaterial,
UpMaterialUnselected,
DownMaterial,
DownMaterialUnselected,
}
......@@ -23,10 +23,27 @@ public class PieceSelection : MonoBehaviour
public Material DownMaterial;
public Material DownMaterialUnselected;
Dictionary<string, Material> materials;
// Start is called before the first frame update
void Start()
{
materials = new Dictionary<string, Material>()
{
{ "Orange", FrontMaterial },
{ "Orange - Unselected", FrontMaterialUnselected },
{ "Red", BackMaterial },
{ "Red - Unselected", BackMaterialUnselected },
{ "Green", LeftMaterial },
{ "Green - Unselected", LeftMaterialUnselected },
{ "Blue", RightMaterial },
{ "Blue - Unselected", RightMaterialUnselected },
{ "Yellow", UpMaterial },
{ "Yellow - Unselected", UpMaterialUnselected },
{ "White", DownMaterial },
{ "White - Unselected", DownMaterialUnselected },
};
}
// Update is called once per frame
......@@ -47,35 +64,54 @@ public class PieceSelection : MonoBehaviour
public void UnHideSide(string sides)
{
if (sides.Contains("F") && Front.activeSelf && Front.GetComponent<MeshRenderer>().sharedMaterial.name != FrontMaterial.name)
Front.GetComponent<MeshRenderer>().sharedMaterial = FrontMaterial;
if (sides.Contains("B") && Back.activeSelf && Back.GetComponent<MeshRenderer>().sharedMaterial.name != BackMaterial.name)
Back.GetComponent<MeshRenderer>().sharedMaterial = BackMaterial;
if (sides.Contains("L") && Left.activeSelf && Left.GetComponent<MeshRenderer>().sharedMaterial.name != LeftMaterial.name)
Left.GetComponent<MeshRenderer>().sharedMaterial = LeftMaterial;
if (sides.Contains("R") && Right.activeSelf && Right.GetComponent<MeshRenderer>().sharedMaterial.name != RightMaterial.name)
Right.GetComponent<MeshRenderer>().sharedMaterial = RightMaterial;
if (sides.Contains("U") && Up.activeSelf && Up.GetComponent<MeshRenderer>().sharedMaterial.name != UpMaterial.name)
Up.GetComponent<MeshRenderer>().sharedMaterial = UpMaterial;
if (sides.Contains("D") && Down.activeSelf && Down.GetComponent<MeshRenderer>().sharedMaterial.name != DownMaterial.name)
Down.GetComponent<MeshRenderer>().sharedMaterial = DownMaterial;
string unselected = " - Unselected";
if (sides.Contains("F") && Front.activeSelf && Front.GetComponent<MeshRenderer>().sharedMaterial.name.Contains(unselected))
Front.GetComponent<MeshRenderer>().sharedMaterial = materials[Front.GetComponent<MeshRenderer>().sharedMaterial.name.Split(' ')[0]] ;
if (sides.Contains("B") && Back.activeSelf && Back.GetComponent<MeshRenderer>().sharedMaterial.name.Contains(unselected))
Back.GetComponent<MeshRenderer>().sharedMaterial = materials[Back.GetComponent<MeshRenderer>().sharedMaterial.name.Split(' ')[0]];
if (sides.Contains("L") && Left.activeSelf && Left.GetComponent<MeshRenderer>().sharedMaterial.name.Contains(unselected))
Left.GetComponent<MeshRenderer>().sharedMaterial = materials[Left.GetComponent<MeshRenderer>().sharedMaterial.name.Split(' ')[0]];
if (sides.Contains("R") && Right.activeSelf && Right.GetComponent<MeshRenderer>().sharedMaterial.name.Contains(unselected))
Right.GetComponent<MeshRenderer>().sharedMaterial = materials[Right.GetComponent<MeshRenderer>().sharedMaterial.name.Split(' ')[0]];
if (sides.Contains("U") && Up.activeSelf && Up.GetComponent<MeshRenderer>().sharedMaterial.name.Contains(unselected))
Up.GetComponent<MeshRenderer>().sharedMaterial = materials[Up.GetComponent<MeshRenderer>().sharedMaterial.name.Split(' ')[0]];
if (sides.Contains("D") && Down.activeSelf && Down.GetComponent<MeshRenderer>().sharedMaterial.name.Contains(unselected))
Down.GetComponent<MeshRenderer>().sharedMaterial = materials[Down.GetComponent<MeshRenderer>().sharedMaterial.name.Split(' ')[0]];
}
public void HideSide(string sides)
{
if (sides.Contains("F") && Front.activeSelf && Front.GetComponent<MeshRenderer>().sharedMaterial.name != FrontMaterialUnselected.name)
Front.GetComponent<MeshRenderer>().sharedMaterial = FrontMaterialUnselected;
if (sides.Contains("B") && Back.activeSelf && Back.GetComponent<MeshRenderer>().sharedMaterial.name != BackMaterialUnselected.name)
Back.GetComponent<MeshRenderer>().sharedMaterial = BackMaterialUnselected;
if (sides.Contains("L") && Left.activeSelf && Left.GetComponent<MeshRenderer>().sharedMaterial.name != LeftMaterialUnselected.name)
Left.GetComponent<MeshRenderer>().sharedMaterial = LeftMaterialUnselected;
if (sides.Contains("R") && Right.activeSelf && Right.GetComponent<MeshRenderer>().sharedMaterial.name != RightMaterialUnselected.name)
Right.GetComponent<MeshRenderer>().sharedMaterial = RightMaterialUnselected;
if (sides.Contains("U") && Up.activeSelf && Up.GetComponent<MeshRenderer>().sharedMaterial.name != UpMaterialUnselected.name)
Up.GetComponent<MeshRenderer>().sharedMaterial = UpMaterialUnselected;
if (sides.Contains("D") && Down.activeSelf && Down.GetComponent<MeshRenderer>().sharedMaterial.name != DownMaterialUnselected.name)
Down.GetComponent<MeshRenderer>().sharedMaterial = DownMaterialUnselected;
string unselected = " - Unselected";
if (sides.Contains("F") && Front.activeSelf && !Front.GetComponent<MeshRenderer>().sharedMaterial.name.Contains(unselected))
Front.GetComponent<MeshRenderer>().sharedMaterial = materials[Front.GetComponent<MeshRenderer>().sharedMaterial.name.Split(' ')[0] + unselected];
if (sides.Contains("B") && Back.activeSelf && !Back.GetComponent<MeshRenderer>().sharedMaterial.name.Contains(unselected))
Back.GetComponent<MeshRenderer>().sharedMaterial = materials[Back.GetComponent<MeshRenderer>().sharedMaterial.name.Split(' ')[0] + unselected];
if (sides.Contains("L") && Left.activeSelf && !Left.GetComponent<MeshRenderer>().sharedMaterial.name.Contains(unselected))
Left.GetComponent<MeshRenderer>().sharedMaterial = materials[Left.GetComponent<MeshRenderer>().sharedMaterial.name.Split(' ')[0] + unselected];
if (sides.Contains("R") && Right.activeSelf && !Right.GetComponent<MeshRenderer>().sharedMaterial.name.Contains(unselected))
Right.GetComponent<MeshRenderer>().sharedMaterial = materials[Right.GetComponent<MeshRenderer>().sharedMaterial.name.Split(' ')[0] + unselected];
if (sides.Contains("U") && Up.activeSelf && !Up.GetComponent<MeshRenderer>().sharedMaterial.name.Contains(unselected))
Up.GetComponent<MeshRenderer>().sharedMaterial = materials[Up.GetComponent<MeshRenderer>().sharedMaterial.name.Split(' ')[0] + unselected];
if (sides.Contains("D") && Down.activeSelf && !Down.GetComponent<MeshRenderer>().sharedMaterial.name.Contains(unselected))
Down.GetComponent<MeshRenderer>().sharedMaterial = materials[Down.GetComponent<MeshRenderer>().sharedMaterial.name.Split(' ')[0] + unselected];
}
//public static string GetOriginalStringMaterial(this Materials me)
//{
// switch (me)
// {
// case Materials.None:
// return "NO ERRORS";
// case Materials.Low:
// return "LOW LEVEL ERROR";
// case Materials.Medium:
// return "MEDIUM LEVEL ERROR";
// case Materials.High:
// return "HIGH LEVEL ERROR";
// default:
// return "NO VALUE GIVEN";
// }
//}
}
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class ProgressBar : MonoBehaviour
{
public Image progressBar;
private float maxScore = 100;
private float actualScore = 0;
// Start is called before the first frame update
void Start()
{
UpdateHealtBar();
}
// Update is called once per frame
void UpdateHealtBar()
{
float ratio = actualScore / maxScore;
progressBar.rectTransform.localScale = new Vector3(ratio, 1, 1);
}
internal void badAnswer(float badScore)
{
actualScore -= badScore;
if(actualScore < 0)
{
actualScore = 0;
}
UpdateHealtBar();
}
internal void goodAnswer(float goodScore)
{
actualScore += goodScore;
if (actualScore > maxScore)
{
actualScore = maxScore;
}
UpdateHealtBar();
}
}
......@@ -55,16 +55,16 @@ public class ResetCube : MonoBehaviour
if (roundedPos.x == 1.5)
{
side2D = "Right";
plane.GetComponent<Renderer>().material = orange;
side2D = "Back";
plane.GetComponent<Renderer>().material = red;
index = (-(int)roundedPos.y + 1) * 3 + (int)roundedPos.z + 1;
}
else
if (roundedPos.x == -1.5)
{
side2D = "Left";
plane.GetComponent<Renderer>().material = red;
side2D = "Front";
plane.GetComponent<Renderer>().material = orange;
index = (-(int)roundedPos.y + 1) * 3 - (int)roundedPos.z + 1;
}
......@@ -73,7 +73,7 @@ public class ResetCube : MonoBehaviour
{
side2D = "Up";
plane.GetComponent<Renderer>().material = white;
plane.GetComponent<Renderer>().material = yellow;
index = (-(int)roundedPos.z + 1) * 3 + (int)roundedPos.x + 1;
}
......@@ -81,14 +81,14 @@ public class ResetCube : MonoBehaviour
if (roundedPos.y == -1.5)
{
side2D = "Down";
plane.GetComponent<Renderer>().material = yellow;
plane.GetComponent<Renderer>().material = white;
index = ((int)roundedPos.z + 1) * 3 + (int)roundedPos.x + 1;
}
else
if (roundedPos.z == 1.5)
{
side2D = "Back";
side2D = "Left";
plane.GetComponent<Renderer>().material = green;
index = (-(int)roundedPos.y + 1) * 3 - (int)roundedPos.x + 1;
......@@ -96,7 +96,7 @@ public class ResetCube : MonoBehaviour
else
if (roundedPos.z == -1.5)
{
side2D = "Front";
side2D = "Right";
plane.GetComponent<Renderer>().material = blue;
index = (-(int)roundedPos.y + 1) * 3 + (int)roundedPos.x + 1;
......
......@@ -12,12 +12,62 @@ public class Rotator : MonoBehaviour
private Vector2 startMousePosition;
private Colors side = Colors.Blue;
public Material FrontMaterial;
public Material FrontMaterialUnselected;