public bool SearchWeaponID(int ID, ref MYWeapon x) { int d = m_Weapon.Length; if (ID < d) { x = m_Weapon[ID]; return(true); } return(false); }
/* * /// <summary> * /// 初始化静态数据,音量画质等 * /// </summary> * private void Awake() * { * * }*/ public bool SearchWeapon(string name, ref MYWeapon x) { int d = m_Weapon.Length; for (int i = 0; i < d; i++) { if (m_Weapon[i].weapon_name == name) { x = m_Weapon[i]; return(true); } } return(false); }