public void ControllerEnter2D(CharacterController2D1 controller) { if (JumpSound != null) AudioSource.PlayClipAtPoint (JumpSound, transform.position); controller.SetVerticalForce (JumpMagnitude); }
public void Awake() { // Collider2D collider = GetComponent<Collider2D>(); GameManager.Instance.ResetLives (LivesOfPlayer); _controller = GetComponent<CharacterController2D1> (); _isFacingRight = transform.localScale.x > 0; Health = MaxHealth; Debug.Log (Health); }
public void Start() { _controller = GetComponent<CharacterController2D1> (); _direction = new Vector2 (-1, 0); _startPosition = transform.position; }