public void Restart() { currentState = OwlbertStates.IDLE; _currentNodeIndex = 0; _currentTarget = TravelNodes[_currentNodeIndex].transform.position; this.transform.position = StartPoint.position; Invoke("StartMoving", 3); }
void OnTriggerEnter2D(Collider2D col) { if (col.name == "SwipHitBox") { _theGameManager.PapaPointsText.rectTransform.position = Camera.main.WorldToScreenPoint(new Vector2(col.transform.position.x + 1, col.transform.position.y)); _theGameManager.PapaPointsText.text = "+30"; Invoke("ResetText", 1); myGameManager.TheAuidoManager.PlaySFX(AudioLoader.instance.OwlbertHit); currentState = OwlbertStates.DEATH; } }
public void Death() { currentState = OwlbertStates.IDLE; myRigidbody.velocity = Vector2.zero; this.transform.position = new Vector3(500, 500, 500); if (myGameManager.OwlbertLives > 0) { myGameManager.OwlbertLives--; } else { myGameManager.GameOver(); } }
private void StartMoving() { currentState = OwlbertStates.FOLLOWROUTE; }