示例#1
0
    public static float numKeenEyes(WorldState ws)
    {
        BaseTrait trait = TraitFactory.createKeenEyes();

        float c = 0;

        foreach (GameObject partyMember in ws.GetParty().GetMembers())
        {
            Animal animal = partyMember.GetComponent <Animal> ();
            if (animal != null)
            {
                if (animal.Traits.Contains(trait))
                {
                    c++;
                }
            }
        }
        return(c);
    }
 public static void instantiateAllTraits()
 {
     TraitFactory.createStrong();
     TraitFactory.createWeak();
     TraitFactory.createQuick();
     TraitFactory.createAggressive();
     TraitFactory.createDocile();
     TraitFactory.createSpikes();
     TraitFactory.createKeenEyes();
     TraitFactory.createKeenSmell();
     TraitFactory.createLoyal();
     TraitFactory.createFlying();
     TraitFactory.createHorned();
     TraitFactory.createArmored();
     TraitFactory.createIndependent();
     TraitFactory.createClimb();
     TraitFactory.createDig();
     TraitFactory.createStealthy();
     TraitFactory.createSwim();
     TraitFactory.createMarbled();
     TraitFactory.createDelicious();
     TraitFactory.createFat();
 }