public void Disarm()
 {
     equipScript = null;
     Armed = false;
 }
 public void Respawn()
 {
     alive = true;
     transform.position = respawnPoint;
     GameObject r = Instantiate(rapier,Vector3.zero,Quaternion.identity) as GameObject;
     r.transform.parent = equipmentHand.transform;
     r.transform.localPosition = new Vector3(0.5f,0,0);
     r.transform.eulerAngles = new Vector3(0,0,270);
     r.transform.localScale = new Vector3(0.4f,0.4f,0.4f);
     r.GetComponent<FencingEquipment>().ResetColor(color);
     equipScript = r.GetComponent<FencingEquipment>();
     equipScript.owner = this.gameObject;
     ResetRigidBodyConstraints();
 }
    // Use this for initialization
    void Start()
    {
        //sound =  GetComponent<AudioSource>();
        cam = Camera.main.GetComponent<FencingCameraController>();
        rend = GetComponent<Renderer>();
        rb = GetComponent<Rigidbody>();
        anim = GetComponent <Animator>();
        equipScript = GetComponentInChildren<FencingEquipment>();
        //deathScript = transform.GetComponentInChildren<ConfettiScript>();
        shield = GetComponent<SphereCollider>();
        shield.enabled = false;

        input = GetComponent<FencingInputHandler>();
        input.rb = rb;
        input.control = this;
        input.player = gameObject;

        alive = true;
        Armed = true;
        rend.material.color = color;
        equipScript.owner = this.gameObject;
        equipScript.ResetColor(color);
        movementAllowed = true;

        ResetRigidBodyConstraints();
    }
 public GameObject PickUp(GameObject equip)
 {
     if (equipmentHand.transform.childCount > 1)
     {
         Debug.Log("Something is weird. Equipscript is " + equipScript);
     }
     if (equipScript == null)
     {
         equipScript = equip.GetComponent<FencingEquipment>();
         equip.transform.parent = equipmentHand.transform;
         Armed = true;
         return this.gameObject;
     }
     return null;
 }