Beispiel #1
0
    private void Germinate()
    {
        if (genes == null || LocationUtil.IsInShade(transform.position))
        {
            isSterile = true;
            return;
        }

        GameObject newGameObject = Instantiate(treePrefab, transform.position, transform.rotation);

        ReproductionUtil.GerminateTree(genes, transform.position, newGameObject, fruitPrefab);

        Destroy(this.gameObject);
        Destroy(this);
    }
Beispiel #2
0
    private void RandomPoop()
    {
        if (seedInPoop == null)
        {
            return;
        }

        if (Random.value < poopChance)
        {
            if (LocationUtil.IsInShade(transform.position))
            {
                return;
            }

            GameObject newGameObject = Instantiate(treePrefab, transform.position, transform.rotation);
            ReproductionUtil.GerminateTree(seedInPoop, transform.position, newGameObject, fruitPrefab);
            seedInPoop = null;
        }
    }