public GunRow GetGunRow(GunRow row) { GunRow ne = new GunRow(); ne.id = row.id; ne.path = row.path; ne.gunType = row.gunType; ne.isAuto = row.isAuto; ne.range = row.range; ne.rangDiscount = row.rangDiscount; ne.cartridge = row.cartridge; ne.maxCartridge = row.maxCartridge; ne.carryCap = row.carryCap; ne.maxCarryCap = row.maxCarryCap; ne.reloadTime = row.reloadTime; ne.singelAtk = row.singelAtk; ne.singelBulletCount = row.singelBulletCount; ne.bulletOffsetMax = row.bulletOffsetMax; ne.interval = row.interval; ne.offset = row.offset; ne.sighting = row.sighting; ne.usePosition = row.usePosition; ne.useRotation = row.useRotation; ne.useScale = row.useScale; ne.standbyPosition = row.standbyPosition; ne.standbyRotation = row.standbyRotation; ne.standbyScale = row.standbyScale; return(ne); }
public override void Open() { gunTxt.Clear(); gunIm.Clear(); base.Open(); foreach (var item in playerDic.Keys) { Destroy(playerDic[item]); } playerDic.Clear(); foreach (var item in RoomSingle.GetInfos().Keys) { if (NetworkTools.GetLocalIP().Equals(item)) { continue;//忽略自己 } GameObject obj = Instantiate <GameObject>(playerPrefab, playerParent.transform); obj.SetActive(true); obj.transform.localScale = Vector3.one; BattlePlayerUI bpui = obj.GetComponent <BattlePlayerUI>(); bpui.UpdatePanel(item, 1, 1);//初始让其满血 playerDic.Add(item, bpui); } gunIm.Add(RoomSingle.GetInfos()[NetworkTools.GetLocalIP()].gun1ID, gun1Image); gunIm.Add(RoomSingle.GetInfos()[NetworkTools.GetLocalIP()].gun2ID, gun2Image); gunTxt.Add(RoomSingle.GetInfos()[NetworkTools.GetLocalIP()].gun1ID, gun1Text); gunTxt.Add(RoomSingle.GetInfos()[NetworkTools.GetLocalIP()].gun2ID, gun2Text); gun1Image.sprite = Resources.Load <Sprite>("UI/WeaponIcon/Gun" + RoomSingle.GetInfos()[NetworkTools.GetLocalIP()].gun1ID); gun2Image.sprite = Resources.Load <Sprite>("UI/WeaponIcon/Gun" + RoomSingle.GetInfos()[NetworkTools.GetLocalIP()].gun2ID); GunRow g1Row = GunModel_S.Instance.GetGunInfo(RoomSingle.GetInfos()[NetworkTools.GetLocalIP()].gun1ID); UpdateGunMessage(RoomSingle.GetInfos()[NetworkTools.GetLocalIP()].gun1ID, g1Row.Cartridge, g1Row.CarryCap); GunRow g2Row = GunModel_S.Instance.GetGunInfo(RoomSingle.GetInfos()[NetworkTools.GetLocalIP()].gun2ID); UpdateGunMessage(RoomSingle.GetInfos()[NetworkTools.GetLocalIP()].gun2ID, g2Row.Cartridge, g2Row.CarryCap); hpImage.fillAmount = 1; gun1Use.SetActive(true); gun2Use.SetActive(false); EventCenterManager._Instance.AddListener(EventType.UpdatePlayerUI, UpdatePlayerMsgCallBack); EventCenterManager._Instance.AddListener(EventType.UpdateBattleGunUI, UpdateGunMsgCallBack); EventCenterManager._Instance.AddListener(EventType.SwitchGun, SwitchGunCallBack); EventCenterManager._Instance.AddListener(EventType.OpenAimed, OpenAniedCallBack); }
protected void BaseAwake() { //data = new GunData(); data = GunModel_S.Instance.GetGunInfo(data.ID); }