Example #1
0
    public virtual void CalculatedJump(Vector2 velocity)
    {
        _stickiness.Detach();
        _stickiness.StopWalking(false);
        LoseJump();
        _dynamicEntity.Rigidbody.velocity = velocity;

        _poolManager.GetPoolable <Dash>(Transform.position, Quaternion.LookRotation(Vector3.forward, velocity));

        if (TrajectoryInUse())
        {
            CommitJump();
        }
    }
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());
    }