void LoadNpcBtn() { for (int i = 0; i < Prebattle.Instance.npcContainer_.Count; i++) { //yicun x-3 y -8 GameObject npc = null; npc = Prebattle.Instance.npcContainer_[i].gameObject_; if (npc == null) { continue; } UIButton sp = GameObject.Instantiate(npcBtn) as UIButton; sp.gameObject.SetActive(true); sp.transform.parent = minmap.transform; sp.transform.localScale = Vector3.one; sp.transform.localPosition = new Vector3(((npc.transform.position.x + ssd.offsetX_) * miniMapWidth / mapWidth) * ssd.dir_, ((npc.transform.position.z + ssd.offsetY_) * miniMapHeight / mapHeight) * ssd.dir_, 0); sp.transform.localPosition = sp.transform.localPosition * ssd.zoom_; UIManager.SetButtonEventHandler(sp.gameObject, EnumButtonEvent.OnClick, OnClickMoveNpc, Prebattle.Instance.npcContainer_[i].npcId_, 0); UILabel la = sp.GetComponentInChildren <UILabel>(); la.text = NpcData.GetData(Prebattle.Instance.npcContainer_[i].npcId_).Name; gos.Add(sp); } }
static void UpdateEnviroment() { string content = File.ReadAllText(Application.dataPath + "/../../../Config/Tables/Npc.csv"); NpcData.ParseData(content, "Npc.csv"); content = File.ReadAllText(Application.dataPath + "/../../../Config/Tables/EntityAssets.csv"); EntityAssetsData.ParseData(content, "EntityAssets.csv"); Dictionary <int, NpcData> allNpc = NpcData.GetData(); foreach (NpcData nData in allNpc.Values) { //if (nData.sceneID_ == int.Parse(scene_.ID)) //{ // for (int i = 0; i < scene_.funcPointList.Count; ++i) // { // if (nData.pointID_ == int.Parse(((FunctionalPoint)scene_.funcPointList[i]).ID)) // { // string assName = EntityAssetsData.GetData(NpcData.GetData(nData.id_).assetsID_).assetsName_; // string path = "Assets/ResData/Role/Prefabs/" + assName + ".prefab"; // GameObject npc = Resources.LoadAssetAtPath(path, typeof(GameObject)) as GameObject; // npc = (GameObject)GameObject.Instantiate(npc) as GameObject; // npc.name = "NPC_" + nData.id_.ToString(); // npc.transform.position = new Vector3(((FunctionalPoint)scene_.funcPointList[i]).X, ((FunctionalPoint)scene_.funcPointList[i]).Y, ((FunctionalPoint)scene_.funcPointList[i]).Z); // npc.transform.rotation = new Quaternion(((FunctionalPoint)scene_.funcPointList[i]).RX, ((FunctionalPoint)scene_.funcPointList[i]).RY, ((FunctionalPoint)scene_.funcPointList[i]).RZ, ((FunctionalPoint)scene_.funcPointList[i]).RW); // Transform parent = funcObjList_[i].transform.parent; // DestroyImmediate(funcObjList_[i]); // funcObjList_[i] = npc; // npc.transform.parent = parent; // } // } //} } }
public bool ParseNavMeshInfo(string info, NpcType type = NpcType.NT_None) { if (StageMgr.Loading) { return(false); } if (TeamSystem.IsTeamLeader() || !TeamSystem.IsInTeam() || TeamSystem.AwayTeam(GamePlayer.Instance.InstId)) { if (type != NpcType.NT_None) { NetConnection.Instance.moveToNpc2(type); return(true); } if (string.IsNullOrEmpty(info)) { return(false); } // "|" 为scene和zone分隔符 // ";" 为scene和npc分隔符 string[] parse; int sceneId; if (info.Contains("|")) { parse = info.Split('|'); sceneId = int.Parse(parse[0]); int zoneId = int.Parse(parse[1]); NetConnection.Instance.moveToZone(sceneId, zoneId); } else { parse = info.Split(';'); sceneId = int.Parse(parse[0]); int npcId = int.Parse(parse[1]); NpcData npcd = NpcData.GetData(npcId); if (npcd.Type == NpcType.NT_Caiji1 || npcd.Type == NpcType.NT_Caiji2 || npcd.Type == NpcType.NT_Caiji3) { NetConnection.Instance.moveToNpc2(npcd.Type); } else { NetConnection.Instance.moveToNpc(npcId); } //Prebattle.Instance.selectedNpc_ = npcId; } return(true); } return(false); }
void AddItem(List <Npc> npcs) { for (int i = 0; i < npcs.Count; i++) { GameObject go = GameObject.Instantiate(item) as GameObject; go.SetActive(true); go.transform.parent = grid.transform; go.transform.localScale = Vector3.one; UIManager.SetButtonEventHandler(go, EnumButtonEvent.OnClick, OnClickButton, npcs[i].npcId_, 0); UILabel nameLable = go.GetComponentInChildren <UILabel>(); nameLable.text = NpcData.GetData(npcs[i].npcId_).Name; grid.repositionNow = true; } }
public static List <int> GetQuestAcceptableNpc(int npcid) { List <int> qlist = new List <int>(); NpcData ndata = NpcData.GetData(npcid); for (int i = 0; i < ndata.Quests.Length; ++i) { if (IsQuestAcceptable(ndata.Quests[i])) { qlist.Add(ndata.Quests[i]); } } return(qlist); }
public static string MakeNGUIStringQuestNPC(string chuansun) { if (string.IsNullOrEmpty(chuansun)) { return(""); } else { int npcid = int.Parse(chuansun.Split(new string[1] { ";" }, System.StringSplitOptions.RemoveEmptyEntries)[1]); NpcData nd = NpcData.GetData(npcid); return(string.Format(LanguageManager.instance.GetValue("gotoWhoAcceptQuest"), chuansun, nd.Name)); } }
public static bool IsQuestNeedNpc(int npcid) { NpcData ndata = NpcData.GetData(npcid); if (ndata.NeedQuests.Length == 0) { return(true); } for (int i = 0; i < ndata.NeedQuests.Length; ++i) { if (IsQuestDoing(ndata.NeedQuests[i])) { return(true); } } return(false); }
void Start() { _SkillTitle.text = LanguageManager.instance.GetValue("kill_Title"); item.SetActive(false); UIManager.SetButtonEventHandler(CloseBtn.gameObject, EnumButtonEvent.OnClick, OnclickClose, 0, 0); metad = NpcData.GetData(); foreach (NpcData npd in metad.Values) { if (npd.AssetsId == UIASSETS_ID.UIASSETS__BabySkillLearning) { listNdata.Add(npd); } } InitItem(listNdata); this.gameObject.transform.localPosition = new Vector3(0, 0, -2000); }
public static bool IsQuestAcceptableNpc(int npcid) { NpcData ndata = NpcData.GetData(npcid); if (ndata == null) { return(false); } for (int i = 0; i < ndata.Quests.Length; ++i) { if (IsQuestAcceptable(ndata.Quests[i])) { return(true); } } return(false); }
void InitData() { Quests.Clear(); NpcId = int.Parse(gameObject.name); NpcData data = NpcData.GetData(NpcId); int[] queststr = data.Quests; for (int i = 0; i < queststr.Length; i++) { QuestData qd = QuestData.GetData(queststr[i]); //if(qd==null)return false; Profession pro = Profession.get((JobType)GamePlayer.Instance.GetIprop(PropertyType.PT_Profession), GamePlayer.Instance.GetIprop(PropertyType.PT_ProfessionLevel)); //if(pro==null)return false; if (qd.questKind_ == QuestKind.QK_Profession) { if (qd.JobLevel_ != 1 && qd.JobLevel_ != 0) { if (qd.jobtype_ != (int)GamePlayer.Instance.GetIprop(PropertyType.PT_Profession) || qd.JobLevel_ - GamePlayer.Instance.GetIprop(PropertyType.PT_ProfessionLevel) != 1) { continue; } } } if (QuestSystem.IsFDailyQuest()) { if (qd.questKind_ == QuestKind.QK_Daily) { continue; } } Quests.Add(queststr[i]); } //如果是第一个职业任务npc 任务不在quest字段 而在附加参数字段 已避开正常任务的一部分逻辑 if (data.AssetsId == UIASSETS_ID.UIASSETS_ProfessionPanel) { string[] questStr = data.BabySkillLearn.Split(';'); for (int i = 0; i < questStr.Length; ++i) { Quests.Add(int.Parse(questStr[i])); } } }
void Start() { //GamePlayer.Instance.OnQuestUpdate += ChangeFuHao; //ChangeFuHao (); InitData(); QuestSystem.OnQuestUpdate += OnQuestUpdate; GamePlayer.Instance.PlayerLevelUpEvent += OnLevelUp; OnQuestUpdate(); Name = (GameObject.Instantiate(ApplicationEntry.Instance.nameLabel) as GameObject).GetComponent <UILabel>(); Name.transform.parent = ApplicationEntry.Instance.uiRoot.transform; Name.transform.localPosition = GlobalInstanceFunction.WorldToUI(gameObject.transform.position); Name.transform.localScale = Vector3.one; UISprite vip = Name.transform.GetComponentInChildren <UISprite>(); vip.gameObject.SetActive(false); NpcData ndata = NpcData.GetData(NpcId); Name.text = string.Format("[b]{0}[-]", ndata.Name); TalkData talk = TalkData.GetData(ndata.NpcTalk); if (talk != null && talk.BattleId != 0) { Name.color = new Color32(255, 144, 0, 255); } else { Name.color = new Color32(66, 255, 253, 255); } if (Application.loadedLevelName.Equals(GlobalValue.StageName_JiazuPkScene)) { bool isEnemyGuildMonster = familyMonsterData.isEnemyGuildMonster(GameManager.Instance.isLeft, NpcId); if (isEnemyGuildMonster) { Name.color = GlobalValue.RED; } } hasDestroyed = false; }
// Use this for initialization2294 【11372 BUG】主线任务应该不可以放弃 void Start() { //InitUIText (); crtSelect_ = 0; if (GamePlayer.Instance.GetIprop(PropertyType.PT_Profession) == (int)JobType.JT_Newbie) { NpcData nData = NpcData.GetData(NpcRenwuUI.NpcId); if (nData.BabySkillLearn != "") { questIds_ = nData.BabySkillLearn.Split(';'); } } UIManager.SetButtonEventHandler(CloseBtn_.gameObject, EnumButtonEvent.OnClick, OnClose, 0, 0); UIManager.SetButtonEventHandler(jobOkBtn.gameObject, EnumButtonEvent.OnClick, OnJobOk, 0, 0); for (int i = 0; i < profCellList.Count; i++) { UIManager.SetButtonEventHandler(profCellList[i].gameObject, EnumButtonEvent.OnClick, OnProfessionCell, i, 0); } selectCell = profCellList [0]; UpdateInfo(profCellList [0].jobId); }
NpcData StartNpc(int qid) { medata = NpcData.GetData(); foreach (int nid in medata.Keys) { npcIds.Add(nid); } for (int i = 0; i < npcIds.Count; i++) { NpcData ndata = NpcData.GetData(npcIds[i]); npcdatas.Add(ndata); } for (int i = 0; i < npcdatas.Count; i++) { for (int j = 0; j < npcdatas[i].Quests.Length; j++) { if (qid == npcdatas[i].Quests[j]) { return(npcdatas[i]); } } } return(null); }
void ShowTaskIonf(int qid) { string goal_str = ""; QuestData quest = QuestData.GetData(qid); if (quest == null) { return; } taskDescription.text = quest.QuestDes_; //ReceiveNpc.text = NpcData.GetData(qid).npcname_; NpcData npc = NpcData.GetData(quest.finishNpcId_); if (npc != null) { completeNpc.text = npc.NpcName; } if (quest.questType_ == QuestType.QT_Battle) { SceneData sData = SceneData.GetData(quest.targetId_); goal_str = string.Format("在{0}中发生{1}战斗", sData.sceneName_, quest.targetNum_); } else if (quest.questType_ == QuestType.QT_Dialog) { goal_str = quest.QuestDes_; } else if (quest.questType_ == QuestType.QT_Item) { ItemData iDta = ItemData.GetData(quest.targetId_); NpcData nData = NpcData.GetData(quest.finishNpcId_); goal_str = string.Format("把{0}个{1}交给{2}只", quest.targetNum_, iDta.name_, nData.Name); } else if (quest.questType_ == QuestType.QT_Kill) { BabyData bData = BabyData.GetData(quest.targetId_); if (bData != null) { goal_str = string.Format("杀死{0}{1}只", bData._Name, quest.targetNum_); } } taskgoal.text = goal_str; DropData droData = DropData.GetData(quest.DropID_); foreach (Transform tr in JGrid.transform) { Destroy(tr.gameObject); } jianliPanle.clipOffset = Vector2.zero; jianliPanle.transform.localPosition = Vector3.zero; jianliPanle.GetComponent <UIScrollView>().ResetPosition(); if (droData == null) { return; } if (droData.exp_ != 0) { GameObject cloneExp = GameObject.Instantiate(JItem) as GameObject; cloneExp.SetActive(true); cloneExp.transform.parent = JGrid.transform; cloneExp.transform.position = Vector3.zero; cloneExp.transform.localScale = Vector3.one; RewardCell rCellExp = cloneExp.GetComponent <RewardCell>(); rCellExp.RewardIcon.gameObject.SetActive(true); //rCellExp.RewardIcon.spriteName = "jingyan"; // rCellExp.icont.gameObject.SetActive(false); rCellExp.RewardIcon.MakePixelPerfect(); rCellExp.RewardLabel.text = droData.exp_.ToString();; HeadIconLoader.Instance.LoadIcon("jingyan_icon", rCellExp.icont); } if (droData.money_ != 0) { GameObject cloneJin = GameObject.Instantiate(JItem) as GameObject; cloneJin.SetActive(true); cloneJin.transform.parent = JGrid.transform; cloneJin.transform.position = Vector3.zero; cloneJin.transform.localScale = Vector3.one; RewardCell rCellJin = cloneJin.GetComponent <RewardCell>(); rCellJin.RewardIcon.gameObject.SetActive(true); //rCellJin.icont.gameObject.SetActive(false); //rCellJin.RewardIcon.spriteName = "jinbitubiao"; rCellJin.RewardIcon.MakePixelPerfect(); rCellJin.RewardLabel.text = droData.money_.ToString(); HeadIconLoader.Instance.LoadIcon("jingbitubiao", rCellJin.icont); } if (droData.item_1_ != 0) { GameObject clone = GameObject.Instantiate(JItem) as GameObject; clone.SetActive(true); clone.transform.parent = JGrid.transform; clone.transform.position = Vector3.zero; clone.transform.localScale = Vector3.one; RewardCell rCell = clone.GetComponent <RewardCell>(); rCell.RewardIcon.gameObject.SetActive(false); rCell.icont.gameObject.SetActive(true); UISprite sp = clone.GetComponent <UISprite>(); //rCell.RewardIcon.spriteName = ItemData.GetData (droData.item_1_).icon_; ItemCellUI ic = UIManager.Instance.AddItemCellUI(sp, (uint)droData.item_1_); ic.showTips = true; //HeadIconLoader.Instance.LoadIcon (ItemData.GetData (droData.item_1_).icon_, rCell.icont); rCell.RewardLabel.text = droData.item_num_1_.ToString(); rCell.RewardIcon.MakePixelPerfect(); } if (droData.item_2 != 0) { GameObject clone = GameObject.Instantiate(JItem) as GameObject; clone.SetActive(true); clone.transform.parent = JGrid.transform; clone.transform.position = Vector3.zero; clone.transform.localScale = Vector3.one; RewardCell rCell = clone.GetComponent <RewardCell>(); rCell.RewardIcon.gameObject.SetActive(false); rCell.icont.gameObject.SetActive(true); //rCell.RewardIcon.spriteName = ItemData.GetData (droData.item_2).icon_; UISprite sp = clone.GetComponent <UISprite>(); ItemCellUI ic = UIManager.Instance.AddItemCellUI(sp, (uint)droData.item_2); ic.showTips = true; //HeadIconLoader.Instance.LoadIcon (ItemData.GetData (droData.item_2).icon_, rCell.icont); rCell.RewardLabel.text = droData.item_num_2.ToString(); rCell.RewardIcon.MakePixelPerfect(); } if (droData.item_3 != 0) { GameObject clone = GameObject.Instantiate(JItem) as GameObject; clone.SetActive(true); clone.transform.parent = JGrid.transform; clone.transform.position = Vector3.zero; clone.transform.localScale = Vector3.one; RewardCell rCell = clone.GetComponent <RewardCell>(); rCell.RewardIcon.gameObject.SetActive(false); rCell.icont.gameObject.SetActive(true); //rCell.RewardIcon.spriteName = ItemData.GetData (droData.item_3).icon_;; UISprite sp = clone.GetComponent <UISprite>(); ItemCellUI ic = UIManager.Instance.AddItemCellUI(sp, (uint)droData.item_3); ic.showTips = true; //HeadIconLoader.Instance.LoadIcon (ItemData.GetData (droData.item_3).icon_, rCell.icont); rCell.RewardLabel.text = droData.item_num_3.ToString(); rCell.RewardIcon.MakePixelPerfect(); } if (droData.item_4 != 0) { GameObject clone = GameObject.Instantiate(JItem) as GameObject; clone.SetActive(true); clone.transform.parent = JGrid.transform; clone.transform.position = Vector3.zero; clone.transform.localScale = Vector3.one; RewardCell rCell = clone.GetComponent <RewardCell>(); rCell.RewardIcon.gameObject.SetActive(false); rCell.icont.gameObject.SetActive(true); UISprite sp = clone.GetComponent <UISprite>(); ItemCellUI ic = UIManager.Instance.AddItemCellUI(sp, (uint)droData.item_4); ic.showTips = true; //rCell.RewardIcon.spriteName = ItemData.GetData (droData.item_4).icon_;; //HeadIconLoader.Instance.LoadIcon (ItemData.GetData (droData.item_4).icon_, rCell.icont); rCell.RewardLabel.text = droData.item_num_4.ToString(); rCell.RewardIcon.MakePixelPerfect(); } if (droData.item_5 != 0) { GameObject clone = GameObject.Instantiate(JItem) as GameObject; clone.SetActive(true); clone.transform.parent = JGrid.transform; clone.transform.position = Vector3.zero; clone.transform.localScale = Vector3.one; RewardCell rCell = clone.GetComponent <RewardCell>(); rCell.icont.gameObject.SetActive(true); //rCell.RewardIcon.spriteName = ItemData.GetData (droData.item_5).icon_;; rCell.RewardIcon.gameObject.SetActive(false); UISprite sp = clone.GetComponent <UISprite>(); ItemCellUI ic = UIManager.Instance.AddItemCellUI(sp, (uint)droData.item_5); ic.showTips = true; //HeadIconLoader.Instance.LoadIcon (ItemData.GetData (droData.item_5).icon_, rCell.icont); rCell.RewardLabel.text = droData.item_num_5.ToString(); rCell.RewardIcon.MakePixelPerfect(); } if (droData.item_6 != 0) { GameObject clone = GameObject.Instantiate(JItem) as GameObject; clone.SetActive(true); clone.transform.parent = JGrid.transform; clone.transform.position = Vector3.zero; clone.transform.localScale = Vector3.one; RewardCell rCell = clone.GetComponent <RewardCell>(); rCell.icont.gameObject.SetActive(true); //rCell.RewardIcon.spriteName = ItemData.GetData (droData.item_6).icon_;; rCell.RewardIcon.gameObject.SetActive(false); UISprite sp = clone.GetComponent <UISprite>(); ItemCellUI ic = UIManager.Instance.AddItemCellUI(sp, (uint)droData.item_6); ic.showTips = true; //HeadIconLoader.Instance.LoadIcon (ItemData.GetData (droData.item_6).icon_, rCell.icont); rCell.RewardLabel.text = droData.item_num_6.ToString(); rCell.RewardIcon.MakePixelPerfect(); } // for (int i = 0; i < droData.item_num_1_; i++) // { // GameObject clone = GameObject.Instantiate(JItem) as GameObject; // clone.SetActive(true); // clone.transform.parent = JGrid.transform; // clone.transform.position = Vector3.zero; // clone.transform.localScale = Vector3.one; // RewardCell rCell = clone.GetComponent<RewardCell>(); // rCell.RewardIcon.gameObject.SetActive(false); // rCell.icont.gameObject.SetActive(true); // //rCell.RewardIcon.spriteName = ItemData.GetData (droData.item_1_).icon_; // HeadIconLoader.Instance.LoadIcon(ItemData.GetData(droData.item_1_).icon_, rCell.icont); // rCell.RewardLabel.text = droData.item_num_1_.ToString(); // rCell.RewardIcon.MakePixelPerfect(); // // } // for (int i = 0; i < droData.item_num_2; i++) // { // GameObject clone = GameObject.Instantiate(JItem) as GameObject; // clone.SetActive(true); // clone.transform.parent = JGrid.transform; // clone.transform.position = Vector3.zero; // clone.transform.localScale = Vector3.one; // RewardCell rCell = clone.GetComponent<RewardCell>(); // rCell.RewardIcon.gameObject.SetActive(false); // rCell.icont.gameObject.SetActive(true); // //rCell.RewardIcon.spriteName = ItemData.GetData (droData.item_2).icon_; // HeadIconLoader.Instance.LoadIcon(ItemData.GetData(droData.item_2).icon_, rCell.icont); // rCell.RewardLabel.text = droData.item_num_2.ToString(); // rCell.RewardIcon.MakePixelPerfect(); // // } // for (int i = 0; i < droData.item_num_3; i++) // { // GameObject clone = GameObject.Instantiate(JItem) as GameObject; // clone.SetActive(true); // clone.transform.parent = JGrid.transform; // clone.transform.position = Vector3.zero; // clone.transform.localScale = Vector3.one; // RewardCell rCell = clone.GetComponent<RewardCell>(); // rCell.RewardIcon.gameObject.SetActive(false); // rCell.icont.gameObject.SetActive(true); // //rCell.RewardIcon.spriteName = ItemData.GetData (droData.item_3).icon_;; // HeadIconLoader.Instance.LoadIcon(ItemData.GetData(droData.item_3).icon_, rCell.icont); // rCell.RewardLabel.text = droData.item_num_3.ToString(); // rCell.RewardIcon.MakePixelPerfect(); // // } // for (int i = 0; i < droData.item_num_4; i++) // { // GameObject clone = GameObject.Instantiate(JItem) as GameObject; // clone.SetActive(true); // clone.transform.parent = JGrid.transform; // clone.transform.position = Vector3.zero; // clone.transform.localScale = Vector3.one; // RewardCell rCell = clone.GetComponent<RewardCell>(); // rCell.RewardIcon.gameObject.SetActive(false); // rCell.icont.gameObject.SetActive(true); // //rCell.RewardIcon.spriteName = ItemData.GetData (droData.item_4).icon_;; // HeadIconLoader.Instance.LoadIcon(ItemData.GetData(droData.item_4).icon_, rCell.icont); // rCell.RewardLabel.text = droData.item_num_4.ToString(); // rCell.RewardIcon.MakePixelPerfect(); // // } // for (int i = 0; i < droData.item_num_5; i++) // { // GameObject clone = GameObject.Instantiate(JItem) as GameObject; // clone.SetActive(true); // clone.transform.parent = JGrid.transform; // clone.transform.position = Vector3.zero; // clone.transform.localScale = Vector3.one; // RewardCell rCell = clone.GetComponent<RewardCell>(); // rCell.icont.gameObject.SetActive(true); // //rCell.RewardIcon.spriteName = ItemData.GetData (droData.item_5).icon_;; // rCell.RewardIcon.gameObject.SetActive(false); // HeadIconLoader.Instance.LoadIcon(ItemData.GetData(droData.item_5).icon_, rCell.icont); // rCell.RewardLabel.text = droData.item_num_5.ToString(); // rCell.RewardIcon.MakePixelPerfect(); // // } // for (int i = 0; i < droData.item_num_6; i++) // { // GameObject clone = GameObject.Instantiate(JItem) as GameObject; // clone.SetActive(true); // clone.transform.parent = JGrid.transform; // clone.transform.position = Vector3.zero; // clone.transform.localScale = Vector3.one; // RewardCell rCell = clone.GetComponent<RewardCell>(); // rCell.icont.gameObject.SetActive(true); // //rCell.RewardIcon.spriteName = ItemData.GetData (droData.item_6).icon_;; // rCell.RewardIcon.gameObject.SetActive(false); // HeadIconLoader.Instance.LoadIcon(ItemData.GetData(droData.item_6).icon_, rCell.icont); // rCell.RewardLabel.text = droData.item_num_6.ToString(); // rCell.RewardIcon.MakePixelPerfect(); // // } JGrid.repositionNow = true; }
bool Talking() { if (TalkIndex >= TalkList.Count) { return(false); } string txt = TalkList[TalkIndex].second; NpcData npcData = NpcData.GetData(TalkList[TalkIndex].first); bool isSelf = (npcData == null); ENTITY_ID assetId = npcData == null ? (ENTITY_ID)GamePlayer.Instance.GetIprop(PropertyType.PT_AssetId) : (ENTITY_ID)npcData.AssetsID; if (!isSelf) { if (preNpcAssId != assetId) { if (pos2 != null) { DestroyImmediate(pos2); } } preNpcAssId = assetId; } bool hasGameObject = isSelf ? pos1 != null : pos2 != null; string actorname = isSelf? GamePlayer.Instance.InstName: npcData.Name; string playerName = GamePlayer.Instance.InstName; StringTool.RepColor(ref playerName, "00FF00"); StringTool.RepName(ref txt, playerName); ClearName(); if (pos1 != null) { pos1.SetActive(isSelf); } if (pos2 != null) { pos2.SetActive(!isSelf); } ShowName(isSelf, actorname); if (!hasGameObject) { GameManager.Instance.GetActorClone(assetId, isSelf ? (ENTITY_ID)GamePlayer.Instance.WeaponAssetID : (ENTITY_ID)0, EntityType.ET_Player, (GameObject go, ParamData data) => { if (hasDestroy_) { Destroy(go); return; } int dialogScale = 0; GlobalValue.Get(Constant.C_DialogScale, out dialogScale); if (data.bParam == true) { pos1 = go; pos1.transform.parent = model[0]; pos1.transform.localPosition = /*ector3.zero*/ new Vector3(0f, 0f, -200f); pos1.transform.Rotate(Vector3.up, 180f); float zoom = EntityAssetsData.GetData((int)assetId).zoom_; pos1.transform.localScale = new Vector3(zoom + dialogScale, zoom + dialogScale, zoom + dialogScale); } else { pos2 = go; pos2.transform.parent = model[1]; pos2.transform.localPosition = /*Vector3.zero*/ new Vector3(0f, 0f, -200f); pos2.transform.Rotate(Vector3.up, 180f); float zoom = EntityAssetsData.GetData((int)assetId).zoom_; pos2.transform.localScale = new Vector3(zoom + dialogScale, zoom + dialogScale, zoom + dialogScale); } //PlayerAsseMgr.DeleteAsset(assetId, false); }, new ParamData((int)assetId, isSelf), "UI", isSelf ? GamePlayer.Instance.DressID : 0); } NpcDialogue = txt; TalkIndex++; return(true); }
void Start() { item.SetActive(false); _TitleLable.text = LanguageManager.instance.GetValue("babyL_Title"); _SkillDesLable.text = LanguageManager.instance.GetValue("babyL_SkillDes"); _XiaoHaoLable.text = LanguageManager.instance.GetValue("babyL_XiaoHao"); _LearningLable.text = LanguageManager.instance.GetValue("babyL_Learning"); _SkillAttackLable.text = LanguageManager.instance.GetValue("babyL_SkillAttack"); _AttackMLable.text = LanguageManager.instance.GetValue("babyL_AttackM"); _StateAttackLable.text = LanguageManager.instance.GetValue("babyL_StateAttack"); _FZLable.text = LanguageManager.instance.GetValue("babyL_FZ"); UIManager.SetButtonEventHandler(CloseBtn.gameObject, EnumButtonEvent.OnClick, OnClickClose, 0, 0); for (int i = 0; i < btns.Count; i++) { UIManager.SetButtonEventHandler(btns[i].gameObject, EnumButtonEvent.OnClick, OnClickbtns, i, 0); } NpcData ndata = NpcData.GetData(NpcRenwuUI.NpcId); if (ndata.BabySkillLearn != "") { string [] str = ndata.BabySkillLearn.Split(';'); for (int i = 0; i < str.Length; i++) { lIds.Add(int.Parse(str[i])); } } for (int i = 0; i < lIds.Count; i++) { SkillData sData = SkillData.GetMinxiLevelData(lIds[i]); skillist.Add(sData); } for (int i = 0; i < skillist.Count; i++) { if (skillist[i]._LearnGroup == 5) { ATskillist.Add(skillist[i]); } else if (skillist[i]._LearnGroup == 6) { AMskillist.Add(skillist[i]); } else if (skillist[i]._LearnGroup == 7) { Sskillist.Add(skillist[i]); } else if (skillist[i]._LearnGroup == 8) { Fskillist.Add(skillist[i]); } } // List<COM_Skill> skills = GamePlayer.Instance.skill_list_; // string groupName = ""; // for(int i=0; i < skills.Count; ++i) // { // groupName = SkillData.GetData((int)skills[i].skillID_).groupName_; // if(groupName.Equals("null")) // { // continue; // } // skillist.Add(SkillData.GetData((int)skills[i].skillID_)); // } // for (int j = 0; j<skillist.Count-1; j++) { // for (int k = skillist.Count-1; k>j; k--) // { // if(skillist[k].groupName_.Equals(skillist[j].groupName_)) // { // skillist.RemoveAt(k); // } // } // } AddItem(ATskillist); }
public void ShowTaskIonf(int qid) { if (qidd == qid) { return; } qidd = qid; string goal_str = ""; QuestData quest = QuestData.GetData(qid); DropData droData = DropData.GetData(quest.DropID_); taskDescription.text = quest.QuestDes_; if (StartNpc(qid) != null) { ReceiveNpc.text = StartNpc(qid).Name; } completeNpc.text = NpcData.GetData(quest.finishNpcId_).Name; goal_str = string.Format("{0}", quest.miniDesc_); taskgoal.text = goal_str; if (droData == null) { for (int i = 0; i < rewardPool.Count; ++i) { rewardPool[i].SetActive(false); } return; } int totalReward = 0; Dictionary <int, int> itemIconDic = new Dictionary <int, int>(); if (droData.exp_ != 0) { totalReward += 1; itemIconDic.Add(5036, droData.exp_); } if (droData.money_ != 0) { totalReward += 1; itemIconDic.Add(5035, droData.money_); } totalReward += droData.itemList.Count; for (int i = 0; i < droData.itemList.Count; ++i) { if (droData.itemList[i] == 0 || itemIconDic.ContainsKey(droData.itemList[i])) { continue; } itemIconDic.Add(droData.itemList[i], droData.itemNumList[i]); } int count = 0; GameObject item = null; foreach (int itemId in itemIconDic.Keys) { if (count >= rewardPool.Count) { item = GameObject.Instantiate(JItem) as GameObject; item.transform.parent = JGrid.transform; item.transform.localScale = Vector3.one; rewardPool.Add(item); } else { item = rewardPool[count]; } item.SetActive(true); RewardCell rc = item.GetComponent <RewardCell>(); rc.RewardIcon.gameObject.SetActive(true); rc.RewardLabel.text = itemIconDic[itemId].ToString(); rc.RewardIcon.gameObject.SetActive(false); rc.icont.gameObject.SetActive(true); UISprite sp = item.GetComponent <UISprite>(); ItemCellUI ic = UIManager.Instance.AddItemCellUI(sp, (uint)itemId); ic.showTips = true; JGrid.repositionNow = true; rc.RewardIcon.MakePixelPerfect(); count++; } for (int i = count - 1; i < rewardPool.Count; ++i) { rewardPool[i].SetActive(false); } chuansongBtn.gameObject.SetActive(true); JGrid.Reposition(); }