Ejemplo n.º 1
0
    private void ThrowBomb()
    {
        //更新炸弹数量
        AmmoUI.Instance.UpdateBombNumber();

        GrabedObject.transform.parent = null;
        GrabedObject.AddComponent <Rigidbody>();
        Hand_animator.SetBool("Catch", false);
        this_grabedObjectType = GrabedObjectType.None;

        Vector3 velocity        = controllerEvents.GetVelocity();
        Vector3 angularVelocity = controllerEvents.GetAngularVelocity();

        GrabedObject.GetComponent <Rigidbody>().velocity        = transform.parent.parent.TransformDirection(velocity) * m_ThrowMulitiple;
        GrabedObject.GetComponent <Rigidbody>().angularVelocity = transform.parent.parent.TransformDirection(angularVelocity);
        GrabedObject.GetComponent <Bomb>().IsThrow = true;
        GrabedObject = null;
        m_IsUseBomb  = false;

        //UsePistol();
    }