Commit 37b370eb authored by Bošániová Monika's avatar Bošániová Monika
Browse files

tutorial update

parent 09346fcb
......@@ -11402,8 +11402,8 @@ MonoBehaviour:
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,
UpMaterial: {fileID: 2100000, guid: 51d0d8d3349a2f547b9a9bdc42876e8e, type: 2}
UpMaterialUnselected: {fileID: 2100000, guid: 918e7c62c0e1c9647997c41383afe77c,
type: 2}
DownMaterial: {fileID: 2100000, guid: 5601add48eb7ebe4cb5c251dde8c8998, type: 2}
DownMaterialUnselected: {fileID: 2100000, guid: 8368f85fde1a4b74783247dbd4550487,
......
......@@ -41,6 +41,7 @@ public class Automate : MonoBehaviour
// };
private CubeState cubeState;
private Rotator rotator;
// Start is called before the first frame update
......@@ -50,6 +51,7 @@ public class Automate : MonoBehaviour
cubeState = FindObjectOfType<CubeState>();
CubeState.started = true;
movingParts = new GameObject();
rotator = FindObjectOfType<Rotator>();
}
// Update is called once per frame
......@@ -69,7 +71,7 @@ public class Automate : MonoBehaviour
}
CubeState.autoRotating = false;
Rotator.Update2DMap(movingParts, cubeMap);
rotator.Update2DMap(movingParts, cubeMap);
var childsToEdit = new List<Transform>();
foreach (Transform child in movingParts.transform)
childsToEdit.Add(child);
......
......@@ -18,10 +18,13 @@ public class ColorButtons : MonoBehaviour
private string errorMassage = "You can't recolor middle pieces!";
private Rotator rotator;
private void Start()
{
errorTextOutput = GameObject.Find("Error Message").GetComponent<Text>();
rotator = FindObjectOfType<Rotator>();
}
void Update()
......@@ -49,7 +52,7 @@ public class ColorButtons : MonoBehaviour
mesh.material = actualMaterial;
colorsChanged = true;
errorTextOutput.text = "";
Rotator.Update2DMap(wholeCube, cube2DMap);
rotator.Update2DMap(wholeCube, cube2DMap);
}
}
......
......@@ -13,18 +13,18 @@ public class Rotator : MonoBehaviour
private Colors side = Colors.Blue;
public Material FrontMaterial;
public Material FrontMaterialUnselected;
public Material BackMaterial;
public Material BackMaterialUnselected;
public Material LeftMaterial;
public Material LeftMaterialUnselected;
public Material RightMaterial;
public Material RightMaterialUnselected;
public Material UpMaterial;
public Material UpMaterialUnselected;
public Material DownMaterial;
public Material DownMaterialUnselected;
public Material FrontMaterial;
public Material FrontMaterialUnselected;
public Material BackMaterial;
public Material BackMaterialUnselected;
public Material LeftMaterial;
public Material LeftMaterialUnselected;
public Material RightMaterial;
public Material RightMaterialUnselected;
public Material UpMaterial;
public Material UpMaterialUnselected;
public Material DownMaterial;
public Material DownMaterialUnselected;
Dictionary<Color, Color> darkToLight;
......@@ -194,7 +194,7 @@ public class Rotator : MonoBehaviour
}
}
public static void Update2DMap(GameObject movingParts2, GameObject Cube2DMap)
public void Update2DMap(GameObject movingParts2, GameObject Cube2DMap)
{
foreach (Transform cube in movingParts2.transform)
{
......@@ -247,12 +247,11 @@ public class Rotator : MonoBehaviour
continue;
Rotator r = new Rotator();
Cube2DMap
.transform.Find(side2D)
.transform.Find(index.ToString())
.transform.GetComponent<Image>()
.color = r.DarkToLight(plane.GetComponent<Renderer>().material.color);
.color = DarkToLight(plane.GetComponent<Renderer>().material.color);
Cube2DMap
.transform.Find(side2D)
......
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