Ejemplo n.º 1
0
 public void Go()
 {
     r.AddForce(i.AttachedHand.CurrentForward * force, ForceMode.VelocityChange);
     //i.AttachedHands.Clear ();
     i.EndInteraction(i.AttachedHand);
     if (e != null)
     {
         e.Activate();
     }
 }
Ejemplo n.º 2
0
    // Update is called once per frame
    void Update()
    {
        if (go)
        {
            RaycastHit[] hit = Physics.RaycastAll(this.transform.position, this.transform.forward, 1.3f);
            for (int i = 0; i < hit.Length; i++)
            {
                if (hit[i].rigidbody != null)
                {
                    hit[i].rigidbody.AddForce(this.transform.forward * force, ForceMode.Impulse);
                    Explo e = hit[i].transform.GetComponent <Explo> ();
                    if (e != null)
                    {
                        e.Activate();
                    }
                }
            }
        }

        if (interact)
        {
            munition = Physics.RaycastAll(this.transform.position, this.transform.forward, 1.3f);
        }
    }