public override void SetItem() { transform.parent = CharacterContener.transform; CharacterContener.GetComponent <Character> ().Equip(this); GameObject AssociatedWeap = Instantiate(AssociatedWeapon) as GameObject; //create a version a the Weapon item if (PlayerController.HoldWeapon) { AssociatedWeap.transform.parent = GameObject.FindGameObjectWithTag("Melee").transform; //put it in the melee AssociatedWeap.transform.localPosition = new Vector3(-0.029f, 0.105f, 0.049f); AssociatedWeap.transform.localRotation = Quaternion.Euler(342.8103f, 240.5572f, 88.73794f); } else { AssociatedWeap.transform.parent = GameObject.FindGameObjectWithTag("Back").transform; //put it in the melee AssociatedWeap.transform.localPosition = new Vector3(0.05421448f, 0.3341688f, -0.1539937f); AssociatedWeap.transform.localRotation = Quaternion.Euler(79.88541f, 240.7424f, 61.1235f); } AssociatedWeap.GetComponent <PlayerAttack> ().SetSpeed(); PlayerInventory.UpdateContent(); }
public override void SetItem() { transform.parent = CharacterContener.transform; //put the item in the character content CharacterContener.GetComponent <Character> ().Equip(this); //equip it PlayerInventory.UpdateContent(); }