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(); }
//Called when the player win public void PlayerWon() { // Do not activate with tutorial if (SceneManager.GetActiveScene().buildIndex > 1) { UpdateCurrentLevelPref(); SetCanPlayerMove(false); // Hide the indicators CloseEnnemyUI.Instance.HideAllIndicators(); // Update the UI and restart uiController.TriggerVictory(); PlayerController.Instance.UpdateFireAnalytics(); OrganismDuplication.StopDuplication(); } }