Example #1
0
        public override void OnHit(BaseCharacterController Attacker)
        {
            int dmg = 1;

            if (Dying)
            {
                return;
            }

            combatController.Damage(Attacker.combatController.CurrentDamage());

            if (combatController.TestForDying())
            {
                Levelable levelup = Attacker.GetComponent <Levelable>();

                if (levelup)
                {
                    levelup.currentxp += this.experiencePerKill;
                }

                DisableUI();
                movementController.StopMovement();
                animationController.DoDeathAnimation();
                Rigidbody2D   rbod = gameObject.transform.parent.GetComponent <Rigidbody2D>();
                BoxCollider2D box  = gameObject.transform.parent.GetComponent <BoxCollider2D>();
                box.enabled      = false;
                rbod.isKinematic = true;
                DestroyObject(gameObject.transform.parent.gameObject, 1.5f);
            }
            else
            {
                CreateCombatText(dmg.ToString());
                OnKnockback(Attacker, 1.5f, .4f);
            }
        }
    private void InitializeMouse()
    {
        playerController.pause = false;
        var mouseLook = playerController.GetComponent <MouseLook>();

        mouseLook.SetCursorLock(true);
        mouseLook.verticalSensitivity = 2;
        mouseLook.lateralSensitivity  = 2;
    }
Example #3
0
    /// <summary>
    /// From Event // PlayerHealth
    /// </summary>
    public void HandleDeath()
    {
        GameOverCanvas.enabled = true;
        playerController.pause = true;
        Time.timeScale         = 0;
        FindObjectOfType <WeaponSwitcher>().enabled = false;
        var mouseLook = playerController.GetComponent <MouseLook>();

        mouseLook.SetCursorLock(false);
        mouseLook.verticalSensitivity = 0;
        mouseLook.lateralSensitivity  = 0;
    }