private void OnCollisionExit(Collision collision) { GameObject obj = collision.gameObject; IngredientValue scr = obj.GetComponent <IngredientValue>(); if (scr != null) { potionId = potionId / scr.getIngredientPrime(scr.myIngredient); scr.getIngredientsFromId(potionId); } }
// Update is called once per frame void Update() { if (buttonPressed) { countDown -= Time.deltaTime; if (countDown <= 0) { countDown = baseCountdown; buttonPressed = false; } } if (Input.GetKeyDown(KeyCode.E)) { GameObject obj = anyIngredient; IngredientValue scr = obj.GetComponent <IngredientValue>(); GetComponent <Animation>().Play(); StatusScript statScr = otherPlayer.GetComponent <StatusScript>(); buttonPressed = true; Debug.Log(scr.getPotion(potionId, leftShelf, statScr)); } }