本文整理汇总了C#中Blob.Hatch方法的典型用法代码示例。如果您正苦于以下问题:C# Blob.Hatch方法的具体用法?C# Blob.Hatch怎么用?C# Blob.Hatch使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Blob
的用法示例。
在下文中一共展示了Blob.Hatch方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FirstTimeSetup
public void FirstTimeSetup()
{
Blob blob = new Blob();
blob.male = true;
blob.Hatch();
blob.birthday = blob.birthday - gm.breedingAge;
blob.SetRandomTextures();
blob.id = gm.gameVars.blobsSpawned++;
blob.SetGeneActivationForAll();
blob.ApplyGeneEffects(blob.activeGenes);
blob.sellValue = 10 + Mathf.FloorToInt(blob.level * 1.5f);
blobs.Add(blob);
blob = new Blob();
blob.male = false;
blob.Hatch();
blob.birthday = blob.birthday - gm.breedingAge;
blob.SetRandomTextures();
blob.id = gm.gameVars.blobsSpawned++;
blob.SetGeneActivationForAll();
blob.ApplyGeneEffects(blob.activeGenes);
blob.sellValue = 10 + Mathf.FloorToInt(blob.level * 1.5f);
blobs.Add(blob);
}
示例2: GenerateVisitor
public void GenerateVisitor()
{
Blob visitor = new Blob();
visitor.male = true;
visitor.Hatch();
visitor.birthday = visitor.birthday - gm.breedingAge;
visitor.level = gm.GetAverageLevel();
visitor.quality = Blob.GetRandomQuality();
visitor.SetRandomTextures();
visitor.id = gm.gameVars.blobsSpawned++;
gm.gameVars.visitorsSpawned++;
List<Gene> goodGenes = GeneManager.GetGenesWithPositiveEffect(gm.mum.genes);
List<Gene> badGenes = GeneManager.GetGenesWithNegativeEffect(gm.mum.genes);
int allowedGenes = visitor.allowedGeneCount;
for(int i=0; i<allowedGenes; i++)
{
Gene geneToadd = null;
if((i%3) == 0)
{
geneToadd = GeneManager.GetRandomGeneBasedOnRarity(goodGenes);
goodGenes.Remove(geneToadd);
}
else if(i==1)
{
geneToadd = badGenes[UnityEngine.Random.Range(0, badGenes.Count)];
badGenes.Remove(geneToadd);
}
visitor.unprocessedGenes.Add(geneToadd);
}
if(gm.gameVars.visitorsSpawned == 1)
{
visitor.unprocessedGenes.Clear();
visitor.unprocessedGenes.Add(gm.mum.GetGeneByName("Better Babies"));
}
if(gm.gameVars.visitorsSpawned == 2)
{
visitor.unprocessedGenes.Clear();
visitor.unprocessedGenes.Add(gm.mum.GetGeneByName("Blue"));
}
if(gm.gameVars.visitorsSpawned == 3)
{
visitor.unprocessedGenes.Clear();
visitor.unprocessedGenes.Add(gm.mum.GetGeneByName("Fertility"));
}
visitor.SetGeneActivationForAll();
visitor.ApplyGeneEffects(visitor.activeGenes);
visitors.Add(visitor);
visitorCost.Add(gm.gameVars.visitorsSpawned * 50);
visitorTimers.Add(DateTime.Now + new TimeSpan(0,1,0,0));
gm.popup.Show("New Visitor", "A new Blob visitor has arrived to check out your kingdom!");
}