public WeaponGameObjectSelector() { _backGameObject = new List <GameObject>(); _twoHandGameObject = new List <GameObject>(); _leftHand = new SingleHandWeapon(); _rightHand = new SingleHandWeapon(); }
//複製物件 public SingleHandWeapon CopyInstantiate(SingleHandWeapon singleHandWeapon) { //SingleHandWeapon singleHandWeapon = new SingleHandWeapon(); //快速武器 if (_fastAttackWeapon != null) { singleHandWeapon._fastAttackWeapon = Instantiate(_fastAttackWeapon); } if (_fastDefenseWeapon != null) { singleHandWeapon._fastDefenseWeapon = Instantiate(_fastDefenseWeapon); } //_listHandWeapon = new List<GameObject>(); //切換武器 if (_listHandWeapon != null) { foreach (GameObject weapon in _listHandWeapon) { singleHandWeapon._listHandWeapon.Add(Instantiate(weapon)); /* * try * { * * } * catch(Exception ex) * { * Debug.Log(ex.Message); * } */ } } return(singleHandWeapon); }