void handleElementA() { if (call.getmixElementA() == "water") { rend.material = Resources.Load("Water", typeof(Material)) as Material; rend.sharedMaterial = rend.material; } else if (call.getmixElementA() == "nitrogen") { rend.material = Resources.Load("seethrough", typeof(Material)) as Material; rend.sharedMaterial = rend.material; } }
// Update is called once per frame void Update() { checkOrder = GameObject.Find("Mixsolution").GetComponent <CheckOrder> (); call = GameObject.Find("GameObject").GetComponent <LoadClassroom>(); elementOrder = checkOrder.getMixOrder(); if (elementOrder [0] == call.getmixElementA() && elementOrder [1] == call.getmixElementB()) { handleMixReaction(); checkOrder.setEmpty(); } else if (elementOrder [0] == call.getmixElementB() && elementOrder [1] == call.getmixElementA()) { handleMixReverseReaction(); checkOrder.setEmpty(); } }
public void HandleTimedInput() { if (currentObj.name == "ElementA_text") { if (call.getmixElementAType() == "liquid") { addAColor = GameObject.Find("test-tube_solutionA").GetComponent <addTestTubeAColor> (); if (isElementAadded == false) { addAColor.addColortoMix(); isElementAadded = true; } } animationA = GameObject.Find("Test-tube-A").GetComponent <Animation> (); animationA.Play(); mixCheckOrder.setElement(call.getmixElementA()); testTubeA = GameObject.Find("ElementA_text").GetComponent <TestTubeA> (); testTubeA.setElementA(true); } }