//显示功能界面 private void OnShowOptionUi() { conIcon.gameObject.SetActive(false); conOption.parent.gameObject.SetActive(true); bg_task.gameObject.SetActive(false); NpcRole npc = dialog.m_npc; List <int> listtid = npc.listTaskId; if (listtid != null) { for (int i = 0; i < listtid.Count; i++) { int id = listtid[i]; string name = tkModel.GetTaskDataById(id).taskName; bool isMain = tkModel.GetTaskDataById(id).taskT == TaskType.MAIN; GameObject btnClon = Instantiate(optionTemp) as GameObject; //if (isMain) //else switch (tkModel.GetTaskDataById(id).taskT) { case TaskType.MAIN: btnClon.transform.FindChild("sign/main").gameObject.SetActive(true); break; case TaskType.BRANCH: btnClon.transform.FindChild("sign/branch").gameObject.SetActive(true); break; case TaskType.CLAN: btnClon.transform.FindChild("sign/clan").gameObject.SetActive(true); break; case TaskType.ENTRUST: btnClon.transform.FindChild("sign/entrust").gameObject.SetActive(true); break; } btnClon.transform.FindChild("Text").GetComponent <Text>().text = name; btnClon.transform.SetParent(conOption, false); btnClon.SetActive(true); BaseButton btn = new BaseButton(btnClon.transform); btn.onClick = OnOptionBtnClick; btn.gameObject.name = id.ToString(); } } if (npc.openid != "") { GameObject btnClon = Instantiate(optionTemp) as GameObject; btnClon.transform.FindChild("sign/func").gameObject.SetActive(true); if (npc.openid == "a3_warehouse") { btnClon.transform.FindChild("Text").GetComponent <Text>().text = ContMgr.getCont("npctasktalk5"); } if (npc.openid == "A3_FindBesto") { btnClon.transform.FindChild("Text").GetComponent <Text>().text = ContMgr.getCont("npctasktalk6"); } if (npc.openid == "a3_resetlvl") { btnClon.transform.FindChild("Text").GetComponent <Text>().text = ContMgr.getCont("npctasktalk0"); } if (npc.openid == "A3_Smithy") { btnClon.transform.FindChild("Text").GetComponent <Text>().text = ContMgr.getCont("npctasktalk7"); } if (npc.openid == "a3_npc_shop") { btnClon.transform.FindChild("Text").GetComponent <Text>().text = ContMgr.getCont("npctasktalk8"); npc_id = npc.id; } if (npc.openid == "a3_legion_dart") { btnClon.transform.FindChild("Text").GetComponent <Text>().text = ContMgr.getCont("npctasktalk9"); } btnClon.transform.SetParent(conOption, false); btnClon.SetActive(true); BaseButton btn = new BaseButton(btnClon.transform); btn.onClick = OnOptionBtnClick; btn.gameObject.name = npc.openid; } }