Exemple #1
0
    public void DropCurrentWeapon()
    {
        GunContainer dropGunContainer = ((GameObject)Instantiate(gunContainerPrefab, GetSpawnLocation(), new Quaternion())).GetComponent <GunContainer>();

        dropGunContainer.SetContainedGun(currentWeapon);

        currentWeapon = null;
    }
Exemple #2
0
    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);
    }