Example #1
0
    private void ShootSecondary()
    {
        if (mana.mana < manaSecondary)
        {
            return;
        }
        mana.UseMana(manaSecondary);

        GameObject  grenadeInstance = Instantiate(grenade, bulletSpawn.position, Quaternion.identity);
        Rigidbody2D grenRigidBody   = grenadeInstance.GetComponent <Rigidbody2D>();

        grenRigidBody.velocity = transform.TransformDirection(bulletSpawn.transform.right * throwForce);
    }
Example #2
0
 //减少当前角色的魔法值
 public void DecreaseMP()
 {
     playerMana.UseMana(this.skillInfo.intMP);
 }