コード例 #1
0
ファイル: Pickup.cs プロジェクト: gbdb71/Ludum-Dare-40
    private void OnTriggerEnter2D(Collider2D other)
    {
        if (_wasPickedUp)
        {
            return;
        }
        _wasPickedUp = true;

        _collider.enabled          = false;
        _spriteRenderer.enabled    = false;
        _wasPickedUpEvent.position = transform.position;
        _wasPickedUpEvent.Raise(this, _wasPickedUpEvent);
        StartCoroutine(HideCoroutine());
    }
コード例 #2
0
    private void HandleCharacterWasHit()
    {
        if (_isDying)
        {
            return;
        }

        _characterDidDieEvent.Raise(this, _characterDidDieEvent);

        _isDying     = true;
        _gun.enabled = false;
        _movementController.enabled           = false;
        _characterAnimationController.enabled = false;

        StartCoroutine(DyingCoroutine(Vector2.right));
    }