Exemplo n.º 1
0
        private void CreateArrow()
        {
            ArrowBase arrow = _arrowFactory.CreateArrow <Arrow>();

            arrow.transform.position = _arrowStartPosition.position;
            ShotArrow(arrow);
        }
Exemplo n.º 2
0
 // Use this for initialization
 void Start()
 {
     hand     = FindObjectOfType <ArrowHand>();
     notchObj = transform.GetChild(0);
     lr       = GetComponent <LineRenderer>();
     lr.SetVertexCount(51);
     nocked = null;
     src    = gameObject.AddComponent <AudioSource>();
 }
Exemplo n.º 3
0
    void Release()
    {
        AudioSource.PlayClipAtPoint(shootSounds[Random.Range(0, shootSounds.Length)], transform.position);

        nocked.GetComponent <Rigidbody>().isKinematic = false;

        Rigidbody rb = transform.root.GetComponent <Rigidbody>();

        nocked.GetComponent <Rigidbody>().velocity = transform.forward * NockedPotentialVelocity(); //rb.velocity

        nocked.GetComponent <ArrowHoming>().target = target;


        nocked = null;
    }
Exemplo n.º 4
0
 void Nock(ArrowBase ab)
 {
     nocked = ab;
 }
Exemplo n.º 5
0
 private void ShotArrow(ArrowBase arrow)
 {
     arrow.Rigidbody.AddRelativeForce(1000, 0, 0);
 }