private void OnTriggerExit2D(Collider2D other) { itemOver = null; gettingItem = false; tanamaquina = false; maquinaover = null; }
private void OnTriggerEnter2D(Collider2D other) { // if(other.gameObject.CompareTag("TAGferramenta") && InteragirButtonPress()){ // Debug.Log("teste"); // } if (other.gameObject.CompareTag("TAGitem")) { itemOver = other.GetComponent <ItemBehaviour>(); objetoOver = other.gameObject; gettingItem = true; } if (other.gameObject.CompareTag("TAGmaquina")) { tanamaquina = true; maquinaover = other.GetComponent <MachineBehaviour>(); } }
void Start() { inventory = FindObjectOfType(typeof(InventoryController)) as InventoryController; machine = FindObjectOfType(typeof(MachineBehaviour)) as MachineBehaviour; // if (!allowGlassware) // { // inventory.DisactiveAllGlassware(); // } // else // { // /inventory.ActiveAllGlassware(); // } // // if (!allowLiquids) // { // inventory.DisactiveAllReagentsLiquid(); // } // else // { // inventory.ActiveAllReagentsLiquid(); // } // // if (!allowSolids) // { // inventory.DisactiveAllReagentsSolid(); // } // else // { // inventory.ActiveAllReagentsSolid(); // } // // if (!allowCharts) // { // inventory.DisactiveAllCharts(); // } // else // { // inventory.ActiveAllCharts(); // } }
//! Actions by clicking on an item. /*! If the application is "lab_workBench", remove reagent liquid from inventory, else if the liquid is in inventory, set the name and the concentration. */ public void MsgMouseDown() { if (Application.loadedLevelName == "lab_workBench") { WorkBench wb = FindObjectOfType(typeof(WorkBench)) as WorkBench; Enable(); inventory.RemoveReagentLiquid(this); // wb.useSlot(this, null); //TODO descomentar isso, fazendo as alteraçoes necessarias no workbench } else { MachineBehaviour machine = FindObjectOfType(typeof(MachineBehaviour)) as MachineBehaviour; if (machine != null && inventory) { if (machine.textResult != null) { machine.textResult.text = "waiting"; } machine.actualReagent = info.Formula; machine.actualConcentration = concentration; } } }