Beispiel #1
0
    public void takeFromChild()
    {
        float value = Random.Range(0.0f, 3.0f) * quickTimeRate;

        if (quicktimeEvent.influenceEvent(-value) && child.holdItem != null)
        {
            holdItem = child.TakeItem(true);
            audio.PlayOneShot(m_AudioTakeFromChild);
            throwAway();
        }
    }
Beispiel #2
0
    // Update is called once per frame
    void Update()
    {
        anim.SetBool(animId_bHoldItem, holdItem != null);
        if (KassenEvent.isRunning())
        {
            return;
        }


        //M�gliche aktive Effekte berechnen: verschnellert oder verlangsamt Simulation
        float deltaTime = calculateEffectValue(Time.deltaTime);


        if (quicktimeEvent.running)
        {
            if (eatingProgress == 1.0f)
            {
                quicktimeEvent.finishEvent();
                finishedEating();
            }
            else
            {
                quicktimeEvent.influenceEvent(quickTimeRate * deltaTime);
                eatingProgress = Mathf.Clamp01(eatingProgress + eatingRate * Time.deltaTime);
            }
        }

        //Abklingzeit und es darf nichts halten
        if (DoSomethingCooldown[0] <= 0.0f && holdItem == null)
        {
            makeDecision();
        }

        if (DoSomethingCooldown[0] > 0)
        {
            DoSomethingCooldown[0] -= deltaTime;
        }

        if (soothedEffect[0] > 0)
        {
            soothedEffect[0] -= Time.deltaTime;
        }

        if (enrageEffect[0] > 0)
        {
            enrageEffect[0] -= Time.deltaTime;
        }
    }