private void SetCurSelectCrops(CropsShopGridUI target) { if (null == target) { return; } if (null != mOldSelected) { mOldSelected.SetSelect(false); } mOldSelected = target; mOldSelected.SetSelect(true); mPropertyPanel.SetActive(true); //设置属性信息 SetCurSelecteProperty(target.GetCropsId()); SetCurSelecteStarsLv(target.GetCropsId()); SetCurSelecteSkill(target.GetCropsId()); SetCropsBtn(target.GetCropsId()); NPCTableItem npc = DataManager.NPCTable[target.GetCropsId()] as NPCTableItem; if (null == npc) { return; } mPreview.SetupCharacter(npc.model, null, -1, uint.MaxValue); mPreview.ChangeWeapon(npc.weaponid); }
override public bool Init(ObjectInitParam param) { CropsInitParam cropsParam = (CropsInitParam)param; if (!DataManager.NPCTable.ContainsKey(cropsParam.crops_res_id)) { return(false); } mRes = DataManager.NPCTable[cropsParam.crops_res_id] as NPCTableItem; mModelResID = mRes.model; if (!base.Init(param)) { return(false); } resid = mRes.resID; mBattleUintAI = AIFactory.Instance.CreateAIObject(this, mRes.ai); if (mBattleUintAI == null) { return(false); } if (cropsParam.talk_id >= 0) { mTalkID = cropsParam.talk_id; } else { mTalkID = mRes.talkID; } if (cropsParam.league != LeagueDef.InvalidLeague) { SetLeague(cropsParam.league); } else { SetLeague(mRes.league); } mDestroyWaiting = true; mMaxDisappearTime = mRes.DisappearTime; mMaxWaitDisappearTime = mRes.WaitDisappearTime; mSummonerAttr = cropsParam.summonerAttr; InitProperty(cropsParam); if (mRes.bossHpUnit < 0 && mRes.showHp) { mBloodNode = BloodUIManager.Instance.CreateBloodUI(); } GetCrySound(); return(true); }
override public bool Init(ObjectInitParam param) { NpcInitParam npcParam = (NpcInitParam)param; if (!DataManager.NPCTable.ContainsKey(npcParam.npc_res_id)) { return(false); } mRes = DataManager.NPCTable[npcParam.npc_res_id] as NPCTableItem; mModelResID = mRes.model; if (!base.Init(param)) { return(false); } mBattleUintAI = AIFactory.Instance.CreateAIObject(this, mRes.ai); if (mBattleUintAI == null) { return(false); } if (npcParam.talk_id >= 0) { mTalkID = npcParam.talk_id; } else { mTalkID = mRes.talkID; } InitTalk(); SetLeague(mRes.league); mDestroyWaiting = true; mMaxDisappearTime = mRes.DisappearTime; mMaxWaitDisappearTime = mRes.WaitDisappearTime; mLifeTime = npcParam.lifeTime; mSummonerAttr = npcParam.summonerAttr; InitProperty(); if (mRes.bossHpUnit < 0 && mRes.showHp) { mBloodNode = BloodUIManager.Instance.CreateBloodUI(); } GetCrySound(); return(true); }