Beispiel #1
0
    // Update is called once per frame
    void Update()
    {
        hasGoneWithoutFoodForSecs += Time.deltaTime;

        if (hasGoneWithoutFoodForSecs > canGoWithoutFoodForSecs)
        {
            onDie.Die();
            Destroy(this.gameObject);
        }
    }