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)); }
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); }
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>()); } }
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(); } }