public wep GetWeapon(int Index) { wep tem = weaponList.Find(data => data.weaponIndex == Index); wep copyTem = new wep(); if (tem != null) { copyTem = tem.DeepCopy(); return(copyTem); } else { print(Index + "(이)라는 인덱스는 없어용!"); return(copyTem); } }
public void changeWeapon(wep weapon, bool isFirst) //무기바꾸기 { if (weapon.weaponIndex > 0) { if (PhotonNetwork.OfflineMode) { armgunSetTrue(); //setSprite(weapon.weaponIndex); gunAnimRPC(weapon.weaponIndex.ToString(),true); } else { pv.RPC("armgunSetTrue", RpcTarget.All); //pv.RPC("setSprite", RpcTarget.AllBuffered,weapon.weaponIndex); pv.RPC("gunAnimRPC",RpcTarget.All,weapon.weaponIndex.ToString(),true); } isHaveGun = true; currentWeapon = weapon.DeepCopy(); gun.transform.localPosition = currentWeapon.tr + savedGunPos; gun.transform.eulerAngles=Vector3.zero; bulletTr.localPosition =currentWeapon.bulletPos.position; leftBullet.reLoadTime = currentWeapon.reLoadTime; leftBullet.SetBullet(currentWeapon.BulletCount,playerItem.selectedIndex, isFirst); offlineSlash = currentWeapon.OfflineSlash; offLineBullet = currentWeapon.offlineBullet; soundRadious = currentWeapon.soundRadious; volume = currentWeapon.volume; shotSoundIndex=currentWeapon.shotSoundIndex-1; if (gun.GetComponent<Animator>()!=null) //애니메이터가 있으면 gun.GetComponent<Animator>().enabled = true; } else { currentWeapon.consumeBullet = 100; } }