예제 #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);
    }
예제 #2
0
    private void MakeNewBlob()
    {
        if (partner == null)
        {
            currentIncubation = 0;
            incubatedEnergy   = 0;
            return;
        }

        currentIncubation++;
        energy          -= 1000 * (int)size;
        incubatedEnergy += (int)(500 * size);

        if (currentIncubation >= incubationTicks && partner != null)
        {
            GameObject newGameObject = Instantiate(gameObject, transform.position, transform.rotation);
            ReproductionUtil.ReproduceBlob(this, newGameObject);
        }
    }
예제 #3
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;
        }
    }