Example #1
0
    private void LateUpdate()
    {
        if (!HeroSpawned())
        {
            return;
        }

        if (!JumpDragging && !Dashing && _jumper.TrajectoryInUse())
        {
            _jumper.CancelJump();
            _jumpDragInitialized = false;
            _dashInitialized     = false;
        }
    }
Example #2
0
    public override void Die(Transform killer = null, Audio sound = null, float volume = 1f)
    {
        if (Dead)
        {
            return;
        }

        Dead = true;
        Stickiness.Detach();
        Jumper?.CancelJump();

        if (killer != null)
        {
            Stickiness.Rigidbody.AddForce((Transform.position - killer.position).normalized * 10000);
        }

        if (sound != null)
        {
            _audioManager.PlaySound(_audioSource, sound, volume);
        }

        SetAllBehavioursActivation(false, false);
        StopDisplayGhosts();
        Renderer.color = ColorUtils.Red;
        _timeManager.StartSlowDownProgressive(.3f);

        if (DynamicInteraction.Interacting)
        {
            DynamicInteraction.StopInteraction(false);
        }



        StartCoroutine(Dying());
    }