Beispiel #1
0
    protected void ChangeWeapon(WeaponId id)
    {
        var weaponAssets = GameViewAssetManager.instance.weaponAssets.Get(id.ToString());
        var weaponPrefab = weaponAssets.ItemPrefab;

        if (weaponPrefab != null)
        {
            var obj = Instantiate(weaponPrefab);
            obj.transform.SetParent(rightHand);
            obj.transform.localPosition = Vector3.zero;
            obj.transform.localRotation = Quaternion.identity;
        }
        else
        {
            Debug.LogWarning("WeaponId " + id + " itemPrefab Is Null");
        }

        ChangeAnim(new AnimData("Idle", weaponAssets.idleAnim), new AnimData("Walk", weaponAssets.animation));
    }
Beispiel #2
0
 public void AddWeapon(WeaponId weaponId)
 {
     AddWeapon(WeaponRuntime.Parse(WeaponManager.Get(weaponId.ToString())));
 }