public wep DeepCopy() { wep Copytem = new wep(); Copytem.shotSoundIndex = this.shotSoundIndex; Copytem.volume = this.volume; Copytem.soundRadious = this.soundRadious; Copytem.slashTime = this.slashTime; Copytem.shotBullet = this.shotBullet; Copytem.consumeBullet = this.consumeBullet; Copytem.walkSpeed_P = this.walkSpeed_P; Copytem.shotSpeed_P = this.shotSpeed_P; Copytem.reLoadTime = this.reLoadTime; Copytem.BulletCount = this.BulletCount; Copytem.spr = this.spr; Copytem.tr = this.tr; Copytem.scale = this.scale; Copytem.CoolTime = this.CoolTime; Copytem.bulletPos = this.bulletPos; Copytem.weaponIndex = this.weaponIndex; Copytem.ClusterRate = this.ClusterRate; Copytem.OfflineSlash = this.OfflineSlash; Copytem.offlineBullet = this.offlineBullet; return(Copytem); }
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); } }
private void Awake() { for (int j = 1; j < temCount; j++) { GameObject go = Resources.Load("Sources/Items/item" + j) as GameObject; if (go != null) { temPrefabs.Add(go); } } for (int i = 0; i < temPrefabs.Count; i++) { tem tem = temPrefabs[i].GetComponent <Item>().item.DeepCopy(); temDatas.Add(tem); if (tem.weaponIndex > 0) { wep weapon = temPrefabs[i].GetComponent <weapon>().weaponObj.DeepCopy(); weaponList.Add(weapon); } } }
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; } }
private static extern bool EnumWindows(wep ewp, int lp);