//-------------------------------------------------
        // private void FireArrow()
        // {
        //  currentArrow.transform.parent = null;

        //  Arrow arrow = currentArrow.GetComponent<Arrow>();
        //  arrow.shaftRB.isKinematic = false;
        //  arrow.shaftRB.useGravity = true;
        //  arrow.shaftRB.transform.GetComponent<BoxCollider>().enabled = true;

        //  arrow.arrowHeadRB.isKinematic = false;
        //  arrow.arrowHeadRB.useGravity = true;
        //  arrow.arrowHeadRB.transform.GetComponent<BoxCollider>().enabled = true;

        //  arrow.arrowHeadRB.AddForce( currentArrow.transform.forward * bow.GetArrowVelocity(), ForceMode.VelocityChange );
        //  arrow.arrowHeadRB.AddTorque( currentArrow.transform.forward * 10 );

        //  nocked = false;
        //     // nockedWithType = GrabTypes.None;

        //  currentArrow.GetComponent<Arrow>().ArrowReleased( bow.GetArrowVelocity() );
        //  bow.ArrowReleased();

        //  allowArrowSpawn = false;
        //  Invoke( "EnableArrowSpawn", 0.5f );
        //  // StartCoroutine( ArrowReleaseHaptics() );

        //  currentArrow = null;
        // }


        // //-------------------------------------------------
        // private void EnableArrowSpawn()
        // {
        //  allowArrowSpawn = true;
        // }


        //-------------------------------------------------
        // private IEnumerator ArrowReleaseHaptics()
        // {
        //  yield return new WaitForSeconds( 0.05f );

        //  hand.otherHand.TriggerHapticPulse( 1500 );
        //  yield return new WaitForSeconds( 0.05f );

        //  hand.otherHand.TriggerHapticPulse( 800 );
        //  yield return new WaitForSeconds( 0.05f );

        //  hand.otherHand.TriggerHapticPulse( 500 );
        //  yield return new WaitForSeconds( 0.05f );

        //  hand.otherHand.TriggerHapticPulse( 300 );
        // }



        //-------------------------------------------------
        private void FindBow(Inventory inventory)
        {
            for (int i = 0; i < inventory.equippedSlots.Length; i++)
            {
                if (inventory.equippedSlots[i] != null)
                {
                    bow = inventory.equippedSlots[i].sceneItem.GetComponent <Longbow>();
                    if (bow != null)
                    {
                        return;
                    }
                }
            }
            // bow = inventory.otherInventory.GetComponentInChildren<Longbow>();
        }
Example #2
0
 //-------------------------------------------------
 private void FindBow()
 {
     bow = hand.otherHand.GetComponentInChildren <Longbow>();
 }