private void makeDecision() { Enums.TakeType takeDecision = (Enums.TakeType)Random.Range(1, (int)Enums.TakeType.COUNT); holdItem = takeControl.take(takeDecision); if (holdItem != null) { //20% Chance etwas zu essen. Ansonsten essen. if (Random.Range(0, 6) == 0) { anim.SetTrigger(animId_tGrabItem); eat(holdItem); } else { anim.SetTrigger(animId_tThrowItem); finishedPuttingIntoCart(); } audio.PlayOneShot(m_AudioTakeItem); } }
// Update is called once per frame void Update() { if (KassenEvent.isRunning()) { KassenInput(); return; } if (Input.GetButtonDown("ActionLeft")) { if (motherBehaviour.handsFree() && motherBehaviour.quicktimeEvent.running) { motherBehaviour.takeFromChild(); } else if (!motherBehaviour.handsFree()) { motherBehaviour.throwAway(); } } else if (Input.GetButtonDown("ActionUp") && !motherBehaviour.handsFree()) { motherBehaviour.giveToChild(); } else if (Input.GetButtonDown("ActionDown")) { if (motherBehaviour.handsFree()) { motherBehaviour.checkChildItem(); } else if (motherBehaviour.inspecting) { motherBehaviour.putIntoCart(); } else { motherBehaviour.inspect(); } } IItem item = null; if (motherBehaviour.handsFree()) { if (Input.GetButtonDown("takeOben")) { item = takeControl.take(Enums.TakeType.Oben); } else if (Input.GetButtonDown("takeMitte")) { item = takeControl.take(Enums.TakeType.Mitte); } else if (Input.GetButtonDown("takeUnten")) { item = takeControl.take(Enums.TakeType.Unten); } } if (item != null) { motherBehaviour.takeFromShelf(item); } }