public void DropLoot()
    {
        if (weaponDrop != EnumDefinitions.WeaponType.None)
        {
            GameObject obj = Resources.Load(string.Format("Prefabs/Drops/Weapons/{0} Drop", weaponDrop.ToString())) as GameObject;
            Instantiate(obj, transform.position, Quaternion.identity);
        }

        if (miscDrops != EnumDefinitions.MiscDropTypes.None)
        {
            GameObject obj = Resources.Load(string.Format("Prefabs/Drops/Misc/{0} Drop", miscDrops.ToString())) as GameObject;
            Instantiate(obj, transform.position, Quaternion.identity);
        }

        coinPrefab = Resources.Load("Prefabs/Drops/Misc/Coin Drop") as GameObject;

        for (int i = 0; i < coinAmount; i++)
        {
            Instantiate(coinPrefab, transform.position, Quaternion.identity);
        }
    }
Beispiel #2
0
    public void SwitchWeapons(EnumDefinitions.WeaponType nextWeapon)
    {
        if (nextWeapon != EnumDefinitions.WeaponType.None)
        {
            Destroy(currentWeapon);
            GameObject weaponPrefab = Resources.Load(string.Format("Prefabs/Weapons/{0} Weapon", nextWeapon.ToString())) as GameObject;
            currentWeapon = Instantiate(weaponPrefab, weaponSpawn.position, weaponSpawn.rotation);
            currentWeapon.transform.parent = weaponSpawn;
            currentWeapon.GetComponent <Weapon>().PassEntityAnimator(entityAnimator);

            // currentWeapon.GetComponent<CopyLocation>().CopyLocationOf(playerHands);
            // currentWeapon.GetComponent<CopyLocation>().ToggleAxis(2);

            // Pull the targets from the weapon here
            // provide the ik hands the target here

            LeftHand.ProvideNewTarget(currentWeapon.GetComponent <Weapon>().leftIKTarget);
            RightHand.ProvideNewTarget(currentWeapon.GetComponent <Weapon>().rightIKTarget);

            uiController.ChangeWeaponInfo(currentWeapon.GetComponent <Weapon>().weaponIcon, currentWeapon.GetComponent <Weapon>().maxProjectileCount);
        }
    }