Beispiel #1
0
    private void InitWeaponInstances()
    {
        _weaponPlacementDictionary = new Dictionary <WeaponType, WeaponPlacement>();

        WeaponKnife knife = Instantiate(_weaponList.GetWeaponList().Knife);

        knife.transform.parent        = _rightHandSocket;
        knife.transform.localPosition = Vector3.zero;
        WeaponPlacement wk = new WeaponPlacement(_knifeSocket, knife);

        _weaponPlacementDictionary.Add(WeaponType.Knife, wk);

        WeaponPistol pistol = Instantiate(_weaponList.GetWeaponList().Pistol);

        pistol.transform.parent        = _pistolSocket;
        pistol.transform.localPosition = Vector3.zero;
        pistol.transform.rotation      = _pistolSocket.rotation;
        WeaponPlacement wp = new WeaponPlacement(_pistolSocket, pistol);

        _weaponPlacementDictionary.Add(WeaponType.Pistol, wp);

        WeaponRifle rifle = Instantiate(_weaponList.GetWeaponList().Rifle);

        rifle.transform.parent        = _rifleSocket;
        rifle.transform.localPosition = Vector3.zero;
        rifle.transform.localRotation = _pistolSocket.rotation;
        WeaponPlacement wr = new WeaponPlacement(_rifleSocket, rifle);

        _weaponPlacementDictionary.Add(WeaponType.Rifle, wr);
    }
Beispiel #2
0
    private void PutWeaponOnHandSocket(WeaponType weaponType)
    {
        WeaponPlacement wp = _weaponPlacementDictionary[weaponType];

        wp.Weapon.transform.parent        = _rightHandSocket;
        wp.Weapon.transform.localPosition = Vector3.zero;
        wp.Weapon.transform.localRotation = Quaternion.Euler(Vector3.zero);
    }
Beispiel #3
0
 public void AddWeapon(WeaponPlacement placement)
 {
     this.Weapons.Add(placement);
 }