Example #1
0
    private void GenerateFruit()
    {
        GameObject g = Instantiate(MotherNature.Creatures["Fruit"], GetComponent <Idlespace>().PickPoint(), Quaternion.identity);

        g.SetActive(true);
        g.GetComponent <VectorCreature>().agent = SymAgent.Create("Fruit", g.GetComponent <VectorCreature>(), Random.Range(0, 2.0f));
    }
Example #2
0
    public static SymAgent Create(string specie, VectorCreature vector, float phase = 0)
    {
        SymAgent sym = new SymAgent(specie, vector, phase);

        if (!All.ContainsKey(specie))
        {
            All[specie] = new List <SymAgent>();
        }
        All[specie].Add(sym);
        return(sym);
    }
Example #3
0
 public void Populate(int pula, bool spawninfant = false)
 {
     for (int i = 0; i < pula; i++)
     {
         GameObject g = Instantiate(MotherNature.Creatures[creature], /*transform.position + Random.insideUnitSphere * 2*/ GetComponent <Idlespace>().PickPoint(), Quaternion.identity);
         g.SetActive(true);
         g.GetComponent <VectorCreature>().agent = SymAgent.Create(creature, g.GetComponent <VectorCreature>(), UnityEngine.Random.Range(0, 2.0f));
         if (!spawninfant)
         {
             g.GetComponent <VectorCreature>().RandomAge(i / (float)pula);
         }
         //  g.GetComponent<Fish>().IdleInSpace(GetComponent<Idlespace>());
     }
 }
Example #4
0
    void Simulate(Collected colle)
    {
        Dictionary <string, CensusEntry> census = Censor.self.Census();
        string   nome = colle.name;
        SymAgent sy   = SymAgent.PickAdult(nome);

        if (sy == null)
        {
            return;
        }
        else
        {
            PlayerController.self.score += sy.vector.gameObject.GetComponent <Collectable>().score;
            sy.vector.Kill();
        }
    }