示例#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;
        }
    }