void InitProps() { List <string> enumValueList = GlobalData.EnumToListInfo(typeof(MsgProps), -1); GameObject propPre = ResourceManager.Instance.LoadAsset <GameObject>(UIType.PropItem.Path); for (int i = 0; i < enumValueList.Count; i++) { if (enumValueList[i] == "58" || enumValueList[i] == "59") { continue; } GameObject propBtn = GameObject.Instantiate(propPre); propBtn.transform.SetParent(toolsContainer); propBtn.transform.localScale = Vector3.one; propBtn.transform.localPosition = Vector3.zero; propBtn.name = enumValueList[i]; propBtn.transform.GetChild(0).GetComponent <Image>().sprite = ResourceManager.Instance.GetSpriteByName((int)EAtlasType.EPlaying, "prop_" + enumValueList[i]); propBtn.GetComponentInChildren <Text>().gameObject.SetActive(PlayerInfo.Instance.mPlayerData.hideFlag != 0); EventTriggerListener.Get(propBtn).onClick = OnToolsClick; btnList.Add(propBtn); } }