public void MissionChoose(int xml_index) { switch (xml_index) { case 0: fileName = "ningluoshuan.xml"; break; case 1: fileName = "boxian.xml"; break; case 2: fileName = "fangxianjia.xml"; break; case 3: fileName = "jiaxian.xml"; break; default: fileName = "init.xml"; break; } XMLLoad xmlLoad = new XMLLoad(); StartCoroutine(xmlLoad.GetXML(fileName)); mission_List = xmlLoad.mission_List; index = -1; btnNext.interactable = true; }
// Use this for initialization void Start() { XMLLoad xmlLoad = new XMLLoad(); StartCoroutine(xmlLoad.GetXML("score.xml")); //AddressData1.insertNode(22); }
string GetRoleType(string roleName) { string ret = ""; XElement retXE = XMLLoad.GetInstance().GetRoleList().Find(delegate(XElement xe) { return(xe.Attribute("Name").Value == roleName); }); ret = retXE.Attribute("Type").Value; return(ret); }
public override void OnJoinedRoom() { base.OnJoinedRoom(); //获取配置文件的角色列表 List <XElement> roleList = XMLLoad.GetInstance().GetRoleList(); //根据角色列表生成选择UI for (int i = 0; i < roleList.Count; i++) { GameObject roleItemGO = Instantiate(roleItemTemp); roleItemGO.transform.SetParent(chooseRoleUI); RoleItem roleItem = roleItemGO.GetComponent <RoleItem>(); string roleName = roleList[i].Attribute("Name").Value; string roleRemark = roleList[i].Attribute("Remark").Value; //设置选择角色的控件,传递一个photonView,让其可以使用这个photonView的RPC roleItem.SetRole(roleName, roleRemark, photonView); roleItemList.Add(roleItem); } }
private void Awake() { _XMLLoad = this; }
void Start() { audioSource = GetComponent <AudioSource>(); rend = GetComponent <Renderer>(); _controller = GetComponent <CharacterController>(); normClr = rend.material.color; clrDmg = Color.red; hitRed = false; if (GetComponent <Sinhronize>().isMine) { basePlane = GameObject.Find("Base"); ammoList = new Dictionary <string, int>(); XMLLoad load = basePlane.GetComponent <XMLLoad>(); foreach (KeyValuePair <string, XMLLoad.Ammo> am in load.ammoList) { ammoList.Add(am.Key, 0); } slots = new WeaponSlot[4]; for (int i = 0; i < 4; i++) { slots[i].active = true; slots[i].have = false; } //slots[0] - melee //slots[1] - pistol //slots[2] - first primary //slots[3] - second primary weaponList = load.weaponList; //WeaponName = "Beretta"; addWeaponToSlot("Beretta"); ActiveSlot = 1; mainRect = new Rect(Screen.width / 4, Screen.height / 4, Screen.width / 2, Screen.height / 2); centerRotateOfGUI = new Vector2(mainRect.x + mainRect.width / 2, mainRect.y + mainRect.height / 2); guiTexture = Resources.Load <Texture2D>("Textures/HurtSector"); guiTextures = new List <float>(); gotDirectTimers = new List <double>(); angle = 0f; phView = GetComponent <PhotonView>(); UnityEngine.Cursor.visible = false; Del ptr = Cont; pause = false; list = new List <ButtonDimas>(); list.Add(new ButtonDimas("Cont", ptr)); ptr = Exit; list.Add(new ButtonDimas("Exit", ptr)); //AmmoCur = 450; AmmoNow = Primary.ClipSize; TxtScope_Texture = Resources.Load <Texture2D>("Textures/aim"); TxtScope_TextureHit = Resources.Load <Texture2D>("Textures/aimHit"); TxtGotDamage = Resources.Load <Texture2D>("Textures/HurtImage70%"); /*clip_reload = Resources.Load<AudioClip>("reload"); * clip_shot = Resources.Load<AudioClip>("Sounds/shot"); * clip_hit = Resources.Load<AudioClip>("Sounds/decoder");*/ if (Primary.Burst == 1) { burst = -1; } else if (Primary.Burst == 0) { burst = 1; } else if (Primary.Burst > 0) { burst = Primary.Burst; } } }