Example #1
0
    public void ControllerEnter2D(CharacterController2D1 controller)
    {
        if (JumpSound != null)
            AudioSource.PlayClipAtPoint (JumpSound, transform.position);

        controller.SetVerticalForce (JumpMagnitude);
    }
Example #2
0
    public void Awake()
    {
        // Collider2D collider = GetComponent<Collider2D>();

        GameManager.Instance.ResetLives (LivesOfPlayer);

        _controller = GetComponent<CharacterController2D1> ();
        _isFacingRight = transform.localScale.x > 0;

        Health = MaxHealth;
        Debug.Log (Health);
    }
Example #3
0
 public void Start()
 {
     _controller = GetComponent<CharacterController2D1> ();
     _direction = new Vector2 (-1, 0);
     _startPosition = transform.position;
 }