// Process to trigger the conjugaison private void TryToConjugateCell(OrganismMutation otherOrgMutation) { // If collided object is a shield and conjugaison chance is triggered if (otherOrgMutation && otherOrgMutation.GetShieldHealth() > GetShieldHealth() && Random.Range(0, 1) < conjugaisonProba) { // Change shield health if collided object has a larger health amount SetShieldHealth(otherOrgMutation.GetShieldHealth()); } }
protected virtual void InitComponents() { rb = GetComponent <Rigidbody2D>(); render = transform.GetChild(0).GetComponent <SpriteRenderer>(); bodyColl = transform.GetChild(0).GetComponent <CircleCollider2D>(); orgMovement = GetComponent <OrganismMovement>(); orgAttack = GetComponent <OrganismAttack>(); orgDuplication = GetComponent <OrganismDuplication>(); orgMutation = GetComponent <OrganismMutation>(); }
/***** OUTCOME FUNCTIONS *****/ //Called by player when he dies public void GameOver(bool deathByCollision) { // Hide the indicators CloseEnnemyUI.Instance.HideAllIndicators(); // Shake the screen CameraShake.Instance.HeavyScreenShake(); // Update the UI uiController.TriggerGameOver(deathByCollision); OrganismDuplication.StopDuplication(); OrganismMutation.StopMutation(); }