/* * Start: inicializa todos los atributos. */ public void Start() { miniCameraController = FindObjectOfType <MiniCameraCotroller>(); plantComponent = gameObject.GetComponent <Plant>(); if (gameObject.CompareTag("Plantas")) { StartCoroutine(GrowPlant(plantComponent.plantGrowTime)); timeOfLife = 0.0f; return; } baseAgent = GetComponent <BaseAgent>(); if (!gameObject.CompareTag("HuevosRana") && !gameObject.CompareTag("HuevosPez")) { dna = baseAgent.dna; perfectDna = baseAgent.perfectDna; worstDna = baseAgent.worstDna; return; } if (agent != null) { dna = gameObject.GetComponent <Roe>().dna; perfectDna = gameObject.GetComponent <Roe>().perfectDna; worstDna = gameObject.GetComponent <Roe>().worstDna; } timeOfLife = 0.0f; timeInPhase = 0.0f; }
/* * Awake: inicializa valores al crearse el agente. */ public void Awake() { lC = gameObject.GetComponent <LifeCycle>(); miniCameraController = FindObjectOfType <MiniCameraCotroller>(); mainC = sR.color; }