Esempio n. 1
0
    private void TryToDuplicateOrganism()
    {
        // Compute duplication proba depending on number of current similar organism
        float currentDuplicationProba = maxDuplicationProba - duplicationProbaIncreaseRate * Mathf.Min(selfOrganism.GetListCount() - 1, duplicationSoftCap - 1);

        // If duplication is triggered
        if (canDuplicate && Random.Range(0f, 1f) < currentDuplicationProba)
        {
            // Buffer to prevent quick duplication
            StartCoroutine(DuplicationRecall(duplicationRecallTime));

            // Spawn new organism
            SpawnDuplicatedOrganism();
        }
    }