public void DropCurrentWeapon() { GunContainer dropGunContainer = ((GameObject)Instantiate(gunContainerPrefab, GetSpawnLocation(), new Quaternion())).GetComponent <GunContainer>(); dropGunContainer.SetContainedGun(currentWeapon); currentWeapon = null; }
public void SpawnWeapon() { GameObject gunContainer = (GameObject)Instantiate(containerPrefab, transform.position, new Quaternion()); GunContainer gunContainerScript = gunContainer.GetComponent <GunContainer>(); gunContainerScript.SetContainedGun(((GameObject)Instantiate(weapon)).GetComponent <IWeapon>()); //NetworkServer.Spawn(gunContainer); }