예제 #1
0
        private void CalculatingDominateGene()
        {
            float geneStrength = 0;
            int   selectedGene = 0;

            if (totalGenes.Count > 1)
            {
                for (int i = 0; i < totalGenes.Count; i++)
                {
                    if (totalGenes[i].GetPriority() > geneStrength)
                    {
                        geneStrength = totalGenes[i].GetPriority();
                        selectedGene = i;
                    }
                }
            }
            dominateGene = totalGenes[selectedGene];
        }
예제 #2
0
 public void ModifyGenes(Gene Modifier)
 {
     if (totalGenes.Count == 1)
     {
         bool canCombine          = false;
         Gene possibleCombination = null;
         (canCombine, possibleCombination) = GeneFunctionManager.FindCombineGenes(totalGenes[0], Modifier);
         if (canCombine)
         {
             totalGenes[0] = possibleCombination;
         }
         else
         {
             totalGenes.Add(Modifier);
         }
     }
     if (totalGenes.Count == 0)
     {
         totalGenes.Add(Modifier);
     }
 }
예제 #3
0
 public void ModifyGenes(Gene Modifier, SpriteRenderer primary, SpriteRenderer secondary)
 {
     if (totalGenes.Count == 1)
     {
         bool canCombine          = false;
         Gene possibleCombination = null;
         (canCombine, possibleCombination) = GeneFunctionManager.FindCombineGenes(totalGenes[0], Modifier);
         if (canCombine)
         {
             totalGenes[0]  = possibleCombination;
             primary.sprite = totalGenes[0].GetFlowerSprite();
         }
         else
         {
             totalGenes.Add(Modifier);
             secondary.sprite = totalGenes[1].GetFlowerSprite();
         }
     }
     if (totalGenes.Count == 0)
     {
         totalGenes.Add(Modifier);
     }
 }
예제 #4
0
파일: Gene.cs 프로젝트: Holo74/Planty-Game
 public abstract void Effect(Gene geneModifier);
예제 #5
0
 public override void Effect(Gene geneModifier)
 {
 }