void handleElementB() { if (call.getmixElementB() == "water") { rend.material = Resources.Load("Water", typeof(Material)) as Material; rend.sharedMaterial = rend.material; } else if (call.getmixElementB() == "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 == "ElementB_text") { if (call.getmixElementBType() == "liquid") { addBColor = GameObject.Find("test-tube_solutionB").GetComponent <addTestTubeBColor> (); print("hereeeeeee"); if (isElementBadded == false) { addBColor.addColortoMix(); isElementBadded = true; } } animationB = GameObject.Find("Test-tube-B").GetComponent <Animation> (); animationB.Play(); // return new WaitForSeconds(2); StartCoroutine(WaitForAnimation()); mixCheckOrder.setElement(call.getmixElementB()); testTubeB = GameObject.Find("ElementB_text").GetComponent <TestTubeB> (); testTubeB.setElementB(true); } }
// Use this for initialization public void callB() { // LoadClassroom.getmixElementB (); call = GameObject.Find("GameObject").GetComponent <LoadClassroom>(); testtubeBSolution = GameObject.Find("test-tube_solutionB"); elementBText = GameObject.Find("ElementB_text").GetComponent <Text> (); rend = testtubeBSolution.GetComponent <Renderer>(); rend.enabled = true; print("B is : " + call.getmixElementB()); handleElementB(); }