//玩家移动 private void PlayerAdMove(Vector3 mvDir) { Iselfplayer player = PlayerManager.Instance.LocalPlayer;//获取本地玩家 if (HolyTech.Skill.BuffManager.Instance.isHaveStopBuff(player.GameObjGUID)) { return; } if (player.FSM == null) { return; } if (player.FSM.State == FsmState.FSM_STATE_DEAD || player.FSM.State == FsmState.FSM_STATE_RUN || player.FSM.State == FsmState.FSM_STATE_FORCEMOVE || player.FSM.State == FsmState.FSM_STATE_RELIVE) { return; } float mvSpeed = player.EntityFSMMoveSpeed;//获取玩家速度 if (mvSpeed <= 0) { mvSpeed = 3.0f; } //指定玩家状态机的位置,速度和方向。 player.EntityFSMChangedata(player.realObject.transform.position, mvDir, mvSpeed); player.OnFSMStateChange(PlayerAdMoveFSM.Instance); }
public override void ExcuseTask() { base.ExcuseTask(); if (Time.frameCount % 5 != 0) { return; } if (PlayerManager.Instance.LocalPlayer == null || mIsTaskCoolDown) { return; } Iselfplayer player = PlayerManager.Instance.LocalPlayer; if (player.realObject == null) { return; } float mDisToBorn = Vector3.Distance(player.realObject.transform.position, mGuideInfo.EventValue0); if (ToBuyEquip && mDisToBorn <= mGuideInfo.EventValue2) { ToBuyEquip = false; } if (!ToBuyEquip && mDisToBorn > mGuideInfo.EventValue2) { ToBuyEquip = true; mIsTaskCoolDown = true; mTaskTime = Time.realtimeSinceStartup; EventCenter.Broadcast <int>((Int32)GameEventEnum.GameEvent_AdvancedGuideShowTip, this.mTaskId); } }
public override void Update(float deltaTime) { if (Time.frameCount % 5 != 0) { return; } //check player info distance up lockDistance; Iselfplayer player = PlayerManager.Instance.LocalPlayer; foreach (var item in mEnemyTeamList) { if (item.Player == null || item.Player.realObject == null) { continue; } float dis = Vector3.Distance(item.Player.realObject.transform.position, player.realObject.transform.position); if (item.Player.FSM.State == HolyTech.FSM.FsmState.FSM_STATE_DEAD || dis > GameConstDefine.PlayerLockTargetDis || item.Player.realObject.activeSelf == false) { item.CloseInfo(); } else { item.OnUpdateHp(); if (item.Player == player.SyncLockTarget) { item.OnSelect(true); } else { item.OnSelect(false); } } } }
private void ShowAltarSelectPic() { Iselfplayer pl = PlayerManager.Instance.LocalPlayer; VirtualStickUI.Instance.SetVirtualStickUsable(false); for (int i = 0; i < 2; i++) { if (pl.AbsorbMonsterType[i] != 0) { AltarHeadPhoto[1 + i].gameObject.SetActive(true); AltarHeadPhoto[1 + i].spriteName = ConfigReader.GetNpcInfo((int)pl.AbsorbMonsterType[i]).HeadPhoto.ToString(); } } if (TrAltar.EntityHoldNpcType == 0) { if (AltarData.AllAltarDic != null && AltarData.AllAltarDic.Count != 0 && AltarData.AllAltarDic.ContainsKey(TrAltar.MapObgId)) { TrAltar.EntityHoldNpcType = AltarData.AllAltarDic[TrAltar.MapObgId]; } else { return; } } AltarHeadPhoto[0].gameObject.SetActive(true); AltarHeadPhoto[0].spriteName = ConfigReader.GetNpcInfo(TrAltar.EntityHoldNpcType).HeadPhoto.ToString(); }
private void OnTriggerEnter(Collider other) { if (this.SyncEntity == null || !(other is SphereCollider)) { return; } Iselfplayer player = PlayerManager.Instance.LocalPlayer; if (this.SyncEntity.GameObjGUID != player.GameObjGUID) //当前ENTITY 不是玩家 { return; } Entity entity = other.gameObject.GetComponent <Entity>(); if (entity == null || entity.SyncEntity == null) //进入对象的entity为空 { return; } if (player.AbsorbMonsterType[0] == 0 && player.AbsorbMonsterType[1] == 0) //没有附身对象 { return; } if (entity.SyncEntity.EntityCamp != player.EntityCamp || entity.SyncEntity.entityType != EntityType.Building || //如果进入的不是友方祭坛、 entity.SyncEntity.NPCCateChild != ENPCCateChild.eNPCChild_BUILD_Altar) { return; } BlGame.AudioManager.Instance.PlayEffectAudio(player.GetAltarClip()); EventCenter.Broadcast(EGameEvent.eGameEvent_PlayerEnterAltar); if (UIAltarSelect.Instance == null) { BlGameUI.Instance.OnOpenUI(GameConstDefine.AltarSoldierSelect); UIAltarSelect.Instance.OnTriggerAltar(entity.SyncEntity); } }
private void OnTriggerExit(Collider other) { if (UIAltarSelect.Instance == null) { return; } if (this.SyncEntity == null || !(other is SphereCollider)) { return; } Iselfplayer player = PlayerManager.Instance.LocalPlayer; if (this.SyncEntity.GameObjGUID != player.GameObjGUID) //当前ENTITY 不是玩家 { return; } Entity entity = other.gameObject.GetComponent <Entity>(); if (entity == null || entity.SyncEntity == null) //退出对象的entity为空 { return; } if (UIAltarSelect.Instance.TrAltar == entity.SyncEntity) { Destroy(UIAltarSelect.Instance.gameObject); } }
void OnEvent(UInt64 kill, int deadType, int deadId, int reason) { if (isSet) { return; } Iselfplayer player = PlayerManager.Instance.LocalPlayer; bool isFirstBlood = false; if (player.GameObjGUID == kill && SceneGuideTaskManager.Instance().IsFakeHero(deadId)) { isFirstBlood = true; } else if (player.NpcGUIDType == deadId && SceneGuideTaskManager.Instance().GetFakeHero(kill) != null) { isFirstBlood = true; } if (isFirstBlood) { string name = SceneGuideTaskManager.Instance().GetFakeHeroName(deadId); string readXml = ConfigReader.GetMsgInfo(10008).content; MsgInfoManager.Instance.SetKills(MsgInfoManager.eKillMsgType.eFirstBlood, false, player.GameUserNick, name, readXml); MsgInfoManager.Instance.SetAuido(MsgInfoManager.eKillMsgType.eFirstBlood, false); isSet = true; } }
public UserPackageItem(Transform head) : base(head) { ShopType = UIShop.ShopSelectType.TypeUser; // Clear(); localPlayer = PlayerManager.Instance.LocalPlayer; OnShowItemInUserInterface(); }
//播放特效 void PlayFinishVedio(UInt64 ObjID) { BlGame.AudioManager.Instance.StopHeroAudio(); GameTimeData.Instance.EndCountTime(); ProgressBarInterface.hideProgressBar(); //UIPlay.OpenUIPlay(false); //if (UIDeathInterface.Instance != null) //{ // GameObject.DestroyImmediate(UIDeathInterface.Instance.gameObject); //} DeathCtrl.Instance.Exit(); Iselfplayer player = PlayerManager.Instance.LocalPlayer; if (player != null) { player.RemoveRuinWarning(); } GameMethod.CreateWindow(GameConstDefine.GameOverBoxPath, Vector3.zero, GameMethod.GetUiCamera.transform); if (Camera.main != null && Camera.main.gameObject != null) { Camera.main.gameObject.AddComponent <BaseDaBomb>(); } GameMethod.GetMainCamera.target = null; GameMethod.GetMainCamera.enabled = false; //ToReview wincamp没用上 UInt64 sGUID; sGUID = ObjID; Ientity entity = EntityManager.Instance.GetEntity(sGUID); for (int i = EntityManager.AllEntitys.Count - 1; i >= 0; i--) { var item = EntityManager.AllEntitys.ElementAt(i); if (item.Value.RealEntity != null) { item.Value.RealEntity.PlayerFreeAnimation(); item.Value.RealEntity.SyncEntity = null; item.Value.RealEntity.enabled = false; } if (item.Value.entityType == EntityType.Player || item.Value.entityType == EntityType.Building) { continue; } EntityManager.AllEntitys.Remove(item.Key); } if (entity != null) { BaseDaBomb.Instance.SetBaseBomb(true, entity, GameUserModel.Instance.GameMapID); //ToReview int->uint } AltarData.Instance.DelAllAltar(); BattleingData.Instance.ClearAllGoods(); BattleingData.Instance.ClearAllBattleData(); }
public void SetSkillDestribe(SkillType skillType, Iselfplayer player) { if (!player.SkillIdDic.ContainsKey(skillType) || !player.BaseSkillIdDic.ContainsKey(skillType)) { return; } int skillId = player.SkillIdDic[skillType]; SetSkillDestribe(skillId, (Iplayer)player); }
private void UpdateLockHead(Ientity entity) { bool mCanAbsorb = false; if (entity == null)//如果实体销毁为空了 { CurrLockEntity = null; mLockRoot.localPosition = new Vector3(5000, 0, 0); //显示的头像位置重新设定 ShowLockEffect(false); //隐藏锁定特效 EventCenter.Broadcast <string>((Int32)GameEventEnum.GameEvent_ResetLockHead, null); } else { string head = ""; CurrLockEntity = entity; spriteLockBg2.gameObject.SetActive(false); if (entity.entityType == EntityType.Player)//如果锁定的敌方英雄 { HeroSelectConfigInfo info = ConfigReader.GetHeroSelectInfo(entity.NpcGUIDType); head = info.HeroSelectHead.ToString(); } else //野怪,士兵,箭塔士兵 { NpcConfigInfo info = ConfigReader.GetNpcInfo(entity.NpcGUIDType); head = info.HeadPhoto.ToString(); if (entity.entityType == EntityType.Monster || entity.entityType == EntityType.Soldier || entity.entityType == EntityType.AltarSoldier && !PlayerManager.Instance.IsLocalSameType(entity)) { if (entity.BloodBar != null) { entity.BloodBar.IsBloodBarCpVib(true);//显示血条,cp() } Iselfplayer player = PlayerManager.Instance.LocalPlayer; //此目标与玩家吸收的野怪类型都不同,那么就允许吸收 if (player != null && player.AbsorbMonsterType[0] != entity.NpcGUIDType && player.AbsorbMonsterType[1] != entity.NpcGUIDType) { //目标是小野怪或者大野怪或者践踏士兵 并且和玩家不是一个阵营的, if (entity.NPCCateChild == ENPCCateChild.eNPCChild_SmallMonster || entity.NPCCateChild == ENPCCateChild.eNPCChild_HugeMonster || entity.entityType == EntityType.AltarSoldier && !PlayerManager.Instance.IsLocalSameType(entity)) { spriteLockBg2.gameObject.SetActive(true); //显示锁定头像 mCanAbsorb = true; //设置可以吸收 } } } } spriteLockHp.fillAmount = entity.Hp / entity.HpMax; //锁定头像的HP(左) spriteLockMp.fillAmount = entity.Mp / entity.MpMax; //锁定头像的MP(左) EventCenter.Broadcast <string>((Int32)GameEventEnum.GameEvent_ResetLockHead, head); spriteLock.spriteName = head; //锁定的头像(左) mLockRoot.localPosition = mLockPos; //根节点的本地位置 ShowLockEffect(true); //显示锁定特效 EventCenter.Broadcast <GameObject>((mCanAbsorb) ? (Int32)GameEventEnum.GameEvent_GuideLockTargetCanAbsorb : (Int32)GameEventEnum.GameEvent_GuideLockTargetCanNotAbsorb, spriteLockBg2.gameObject); } }
public GuideObstructTask(int task, GuideTaskType type, GameObject mParent) : base(task, type, mParent) { //读取数据 player = PlayerManager.Instance.LocalPlayer; obsTask = ConfigReader.GetObstructTaskInfo(task); if (obsTask == null) { Debug.LogError("GuideObstructTask 找不到任務 Id" + task); } }
private void UpdateLockHead(Ientity entity) { bool mCanAbsorb = false; if (entity == null) { CurrLockEntity = null; mLockRoot.localPosition = new Vector3(5000, 0, 0); ShowLockEffect(false); EventCenter.Broadcast <string>(EGameEvent.eGameEvent_ResetLockHead, null); } else { string head = ""; CurrLockEntity = entity; spriteLockBg2.gameObject.SetActive(false); if (entity.entityType == EntityType.Player) { HeroSelectConfigInfo info = ConfigReader.GetHeroSelectInfo(entity.NpcGUIDType); head = info.HeroSelectHead.ToString(); } else { NpcConfigInfo info = ConfigReader.GetNpcInfo(entity.NpcGUIDType); head = info.HeadPhoto.ToString(); if (entity.entityType == EntityType.Monster || entity.entityType == EntityType.Soldier || entity.entityType == EntityType.AltarSoldier && !PlayerManager.Instance.IsLocalSameType(entity)) { if (entity.XueTiao != null) { entity.XueTiao.IsXueTiaoCpVib(true); } Iselfplayer player = PlayerManager.Instance.LocalPlayer; if (player != null && player.AbsorbMonsterType[0] != entity.NpcGUIDType && player.AbsorbMonsterType[1] != entity.NpcGUIDType) { if (entity.NPCCateChild == ENPCCateChild.eNPCChild_SmallMonster || entity.NPCCateChild == ENPCCateChild.eNPCChild_HugeMonster || entity.entityType == EntityType.AltarSoldier && !PlayerManager.Instance.IsLocalSameType(entity)) { spriteLockBg2.gameObject.SetActive(true); mCanAbsorb = true; } } } } spriteLockHp.fillAmount = entity.Hp / entity.HpMax; spriteLockMp.fillAmount = entity.Mp / entity.MpMax; EventCenter.Broadcast <string>(EGameEvent.eGameEvent_ResetLockHead, head); spriteLock.spriteName = head; mLockRoot.localPosition = mLockPos; ShowLockEffect(true); EventCenter.Broadcast <GameObject>((mCanAbsorb) ? EGameEvent.eGameEvent_GuideLockTargetCanAbsorb : EGameEvent.eGameEvent_GuideLockTargetCanNotAbsorb, spriteLockBg2.gameObject); } }
public void ShowValideUseSkillBtn(ShortCutBarBtn btnType, bool visiable) { Iselfplayer player = PlayerManager.Instance.LocalPlayer; if (null == player) { return; } int index = (int)btnType; int skillId = 0; SkillManagerConfig info = null; switch (btnType) { case ShortCutBarBtn.BTN_SKILL_1: case ShortCutBarBtn.BTN_SKILL_2: case ShortCutBarBtn.BTN_SKILL_3: case ShortCutBarBtn.BTN_SKILL_4: break; case ShortCutBarBtn.BTN_SKILL_5: if (player != null && player.BaseSkillIdDic.ContainsKey(SkillType.SKILL_TYPEABSORB1)) { skillId = player.BaseSkillIdDic[SkillType.SKILL_TYPEABSORB1]; } info = ConfigReader.GetSkillManagerCfg(skillId); if (skillId == 0 || info == null) { visiable = false; } break; case ShortCutBarBtn.BTN_SKILL_6: if (player != null && player.BaseSkillIdDic.ContainsKey(SkillType.SKILL_TYPEABSORB2)) { skillId = player.BaseSkillIdDic[SkillType.SKILL_TYPEABSORB2]; } info = ConfigReader.GetSkillManagerCfg(skillId); if (skillId == 0 || info == null) { visiable = false; } break; default: return; } if (!visiable) { ShowCdEndEffect(btnType, false); } }
private void OnSoldierSelectFunc(int ie, bool presses) { if (presses || TrAltar == null) { return; } Iselfplayer pl = PlayerManager.Instance.LocalPlayer; int npcType = 0; cuttSolt = 0; if ((AltarSelectBtn)ie == AltarSelectBtn.SelectFirst) { if (pl.AbsorbMonsterType[0] == 0) { return; } npcType = (int)pl.AbsorbMonsterType[0]; cuttSolt = 1; } if ((AltarSelectBtn)ie == AltarSelectBtn.SelectSecond) { if (pl.AbsorbMonsterType[1] == 0) { return; } npcType = (int)pl.AbsorbMonsterType[1]; cuttSolt = 2; } if (npcType == 0) { return; } HolyGameLogic.Instance.EmsgToss_ReportAltarStrawSolder((UInt32)npcType, (int)TrAltar.GameObjGUID); //if ((AltarSelectBtn)ie == AltarSelectBtn.SelectSecond) //{ // pl.AbsorbMonsterType1 = 0; //} //else { // pl.AbsorbMonsterType2 = 0; //} TrAltar.EntityHoldNpcType = npcType; if (TrAltar.EntityHoldNpcType != 0 && TrAltar != null) { SoldierSelectBtn[0].RemoveListener(OnSoldierSelectFunc); SoldierSelectBtn[1].RemoveListener(OnSoldierSelectFunc); //Debug.LogError(npcType + " TrAltar = " + TrAltar + " AltarManager.Instance = " + AltarManager.Instance); AltarManager.Instance.ShowAltarHead(npcType, TrAltar); Destoys(); } //HolyTechUI.Instance.OnDestroyUI(this.transform.parent.gameObject); }
public override void EnterTask() { if (!ConfigReader.GuidePathInfoDict.TryGetValue(mTaskId, out mPathInfo)) { this.FinishTask(); return; } mPlayer = PlayerManager.Instance.LocalPlayer; ResourceItem objTargetArrowUnit = ResourcesManager.Instance.loadImmediate(arrowPath, ResourceType.PREFAB); objTargetArrow = GameObject.Instantiate(objTargetArrowUnit.Asset) as GameObject; objTargetArrow.transform.position = new Vector3(mPathInfo.mDesPos.x, mPathInfo.mDesPos.y + arrowHeight, mPathInfo.mDesPos.z); objTargetArrow.transform.localScale = targetScale; }
void CloseStick() { if (VirtualStickState == StickState.MoveState) { SendStop(); } Iselfplayer player = PlayerManager.Instance.LocalPlayer; if (player != null && player.FSM != null && (player.FSM.State == FsmState.FSM_STATE_ADMOVE || player.FSM.State == FsmState.FSM_STATE_LOCALMOVE)) { player.OnFSMStateChange(EntityFreeFSM.Instance); } SetVisiable(false); VirtualStickState = StickState.InActiveState; beforeDir = Vector3.zero; }
private void OnSoldierSelectFunc(GameObject go) { Iselfplayer pl = PlayerManager.Instance.LocalPlayer; int npcType = -1; if (go == SoldierSelectBtn[0] && pl.Level >= 7) { npcType = 1; CGLCtrl_GameLogic.Instance.EmsgToss_AskAbsorb(npcType); } if (go == SoldierSelectBtn[1]) { npcType = 0; CGLCtrl_GameLogic.Instance.EmsgToss_AskAbsorb(npcType); } DestroySole(); }
private void PlayerAdMove(Vector3 mvDir) { Iselfplayer player = PlayerManager.Instance.LocalPlayer; if (BlGame.Skill.BuffManager.Instance.isHaveStopBuff(player.GameObjGUID)) { return; } if (player.FSM == null) { return; } //remark state_forcemove by sidney 测试,暂时remark if (player.FSM.State == FsmState.FSM_STATE_DEAD || player.FSM.State == FsmState.FSM_STATE_RUN || player.FSM.State == FsmState.FSM_STATE_FORCEMOVE || player.FSM.State == FsmState.FSM_STATE_RELIVE) { return; } float mvSpeed = player.EntityFSMMoveSpeed; if (mvSpeed <= 0) { mvSpeed = 3.0f; } //因为 //应该是一直更新状态 //等线程,上传, //服务器同步 //然后再下发坐标Iplayer->OnEntityMoveSpeedChange(value:int)处理 player.EntityFSMChangedata(player.realObject.transform.position, mvDir, mvSpeed); //所以这里在客户端”处理一下“ if (JxBlGame.Instance == null) { //要是mvSpeed太小,会造成动画看起来停了 //所以这个方法只是处理动画速度,不做位移??? //player.OnEntityMoveSpeedChange(Convert.ToInt16(mvSpeed));//这个方法会让移动动画停止???操NIMB //player.OnExecuteLocalMove (); player.OnFSMStateChange(EntityLocalMoveFSM.Instance); } else { player.OnFSMStateChange(PlayerAdMoveFSM.Instance); } }
private List <int> ContainAsignedItems(int itemId) { Iselfplayer player = PlayerManager.Instance.LocalPlayer; List <int> indexList = new List <int>(); foreach (var item in player.UserGameItems) { int count = 0; if (item.Value == itemId && player.UserGameItemsCount.TryGetValue(item.Key, out count)) { if (count != 0) { indexList.Add(item.Key); } } } return(indexList); }
private void ShowAltarSelectPic() { Iselfplayer pl = PlayerManager.Instance.LocalPlayer; if (pl == null) { return; } VirtualStickUI.Instance.SetVirtualStickUsable(false); for (int i = 0; i < 2; i++) { if (pl.AbsorbMonsterType[i] != 0) { AltarHeadPhoto[1 + i].gameObject.SetActive(true); AltarHeadPhoto[1 + i].spriteName = ConfigReader.GetNpcInfo((int)pl.AbsorbMonsterType[i]).HeadPhoto.ToString(); } } AltarHeadPhoto[0].gameObject.SetActive(true); AltarHeadPhoto[0].spriteName = ConfigReader.GetNpcInfo(pl.SyncLockTarget.NpcGUIDType).HeadPhoto.ToString(); }
public List <int> GetHeroRecommendEquip() { if (PlayerManager.Instance.LocalAccount.ObjType == ObPlayerOrPlayer.PlayerObType) { return(null); } List <int> items = new List <int>(); Iselfplayer player = PlayerManager.Instance.LocalPlayer; HeroConfigInfo info = ConfigReader.GetHeroInfo(player.NpcGUIDType); for (int i = 0; i < 3; i++) { switch (i) { case 0: items.AddRange(info.HeroPreEquip); break; case 1: items.AddRange(info.HeroMidEquip); break; case 2: items.AddRange(info.HeroLatEquip); break; } int count = items.Count / 6; int tempCount = items.Count; if (items.Count % 6 != 0) { count += 1; } for (int j = 0; j < (count * 6 - tempCount); j++) { items.Add(0); } } return(items); }
private void OnSoldierSelectFunc(int ie, bool presses) { if (presses) { return; } Iselfplayer pl = PlayerManager.Instance.LocalPlayer; int npcType = -1; if ((AltarSelectBtn)ie == AltarSelectBtn.SelectFirst && pl.Level >= 7) { npcType = 1; CGLCtrl_GameLogic.Instance.EmsgToss_AskAbsorb(npcType); } if ((AltarSelectBtn)ie == AltarSelectBtn.SelectSecond) { npcType = 0; CGLCtrl_GameLogic.Instance.EmsgToss_AskAbsorb(npcType); } DestroySole(); //BlGameUI.Instance.OnDestroyUI(this.transform.parent.gameObject); }
public static void LogOutToLogin() { if (PlayerManager.Instance != null) { if (PlayerManager.Instance.AccountDic != null) { PlayerManager.Instance.AccountDic.Clear(); } Iselfplayer player = PlayerManager.Instance.LocalPlayer; if (player != null) { player.UserGameItemsCount.Clear(); player.UserGameItemsCoolDown.Clear(); player.UserGameItems.Clear(); Debug.LogError("player"); } MsgInfoManager.Instance.RemoveKillMsg(); AltarData.Instance.DelAllAltar(); FriendManager.Instance.DelAllList(); PlayerManager.Instance.DestoryAllEntity(); GameUserModel.Instance.Clear(); //GoodsModel.Instance.Clear(); MailModel.Instance.Clear(); SystemNoticeData.Instance.Clear(); MarketHeroListModel.Instance.Clear(); MarketRuneListModel.Instance.Clear(); RuneEquipModel.Instance.Clear(); PlayerManager.Instance.LocalAccount = PlayerManager.Instance.LocalPlayer = null; } NetworkManager.Instance.canReconnect = false; NetworkManager.Instance.Close(); #if UNITY_STANDALONE_WIN || UNITY_EDITOR || SKIP_SDK #else SdkConector.ShowToolBar(1); #endif }
private void ShowBtnCanUseEffect(ShortCutBarBtn type) { if (PlayerManager.Instance == null || PlayerManager.Instance.LocalPlayer == null) { return; } if (PlayerManager.Instance.LocalPlayer.SkillIdDic == null || PlayerManager.Instance.LocalPlayer.SkillIdDic.Count == 0) { return; } Iselfplayer player = PlayerManager.Instance.LocalPlayer; SkillType skillType = GetSkillType((int)type); int skillId = PlayerManager.Instance.LocalPlayer.SkillIdDic[skillType]; SkillManagerConfig info = ConfigReader.GetSkillManagerCfg(skillId); if (info == null) { return; } GameObject sprite = mCanPressEffect[type]; bool isInCd = IsSkillInCd(type); if (info.mpUse > player.Mp || info.cpUse > player.Cp || info.hpUse > player.Hp || isInCd) { if (sprite.activeInHierarchy) { sprite.SetActive(false); } } else { if (!sprite.activeInHierarchy) { sprite.SetActive(true); } } }
public static void LogOutToLogin() { if (PlayerManager.Instance != null)//清除当前账户的所有信息 { if (PlayerManager.Instance.AccountDic != null) { PlayerManager.Instance.AccountDic.Clear();//清除玩家管理器 } Iselfplayer player = PlayerManager.Instance.LocalPlayer; if (player != null)//清除所有玩家 { player.UserGameItemsCount.Clear(); player.UserGameItemsCoolDown.Clear(); player.UserGameItems.Clear(); } MsgInfoManager.Instance.RemoveKillMsg(); //清除技能信息 AltarData.Instance.DelAllAltar(); //清除箭塔 FriendManager.Instance.DelAllList(); //清空所有数据 (黑名单,聊天,朋友) PlayerManager.Instance.DestoryAllEntity(); //清除所有实体 GameUserModel.Instance.Clear(); //清除模型信息 MailModel.Instance.Clear(); //清除邮件信息 SystemNoticeData.Instance.Clear(); //清除系统消息 MarketHeroListModel.Instance.Clear(); //清除商品信息 MarketRuneListModel.Instance.Clear(); //清除符文信息 RuneEquipModel.Instance.Clear(); //清除符文模型 PlayerManager.Instance.LocalAccount = PlayerManager.Instance.LocalPlayer = null; //本地玩家信息清空 } NetworkManager.Instance.canReconnect = false; //设置是否连接网络 否 NetworkManager.Instance.Close(); //关闭网络连接 //#if UNITY_STANDALONE_WIN || UNITY_EDITOR || SKIP_SDK //#else // SdkConector.ShowToolBar(1); //#endif }
void LoadBattle() { //LoadScene.Instance.LoadAsignedSene ("Scenes/pvp_001") //ResourcesManager.HandleFinishLoadLevel += onFinishLoadLevel; DontDestroyOnLoad(GameObject.Find("GameUI")); DontDestroyOnLoad(this); DontDestroyOnLoad(GameObject.Find("JxBlGame")); ResourcesManager.Instance.Init(); ResourcesManager.HandleFinishLoadLevel del = onFinishLoadLevel; ResourcesManager.Instance.loadLevel("cenes/pvp_001", del); //HeroTimeLimitWindow window = WindowManager.Instance.GetWindow (EWindowType.EMT_HeroTimeLimitWindow) as HeroTimeLimitWindow; //string path = GameDefine.GameConstDefine.LoadMonsterModels; //Entity entity; //entity.r Ientity player = new Iselfplayer(1001, EntityCampType.CampTypeA); player.entityType = EntityType.Player; player.ObjTypeID = 10003; //<szNOStr>10003</szNOStr> new EntityManager(); new PlayerManager(); //依赖Audio? new GameStateManager(); //GameStateManager.Instance.EnterDefaultState(); //GameStateManager.Instance.ChangeGameStateTo(GameStateType.GS_Play); PlayState state = GameStateManager.Instance.GetCurState() as PlayState; Vector3 playerDefPosition = this.ConvertPosToVector3(new Vector2(21600, 7400)); //实际上创建场景的player实例 mPlayerObj = EntityManager.Instance.CreateEntityModel(player, 1001, new Vector3(0, 0, 0), playerDefPosition); DontDestroyOnLoad(mPlayerObj); //PlayerManager.Instance.LocalPlayer = new SkillWindow window = WindowManager.Instance.GetWindow(EWindowType.EMT_SkillWindow) as SkillWindow; window.Show(); //摇杆 //依赖于PlayerManager.Instance.LocalAccount //还依赖于PlayerManager.Instance.LocalPlayer.RealEntity PlayerManager.Instance.LocalAccount = (Iplayer)player; PlayerManager.Instance.LocalAccount.SetObjType(GameDefine.ObPlayerOrPlayer.PlayerType); //play state需要 GamePlayWindow panel = WindowManager.Instance.GetWindow(EWindowType.EWT_GamePlayWindow) as GamePlayWindow; panel.Show(); // GameObject uiRoot = GameObject.Find ("GameUI"); // ResourceUnit unit = ResourcesManager.Instance.loadImmediate ("Guis/UIMainWindow",ResourceType.PREFAB); // GameObject virtualPanel = GameObject.Instantiate (unit.Asset) as GameObject; // virtualPanel.transform.parent = uiRoot.transform; Ientity diren = new Iplayer(1002, EntityCampType.CampTypeB); diren.entityType = EntityType.Player; diren.ObjTypeID = 10004; Vector3 direnPosition = this.ConvertPosToVector3(new Vector2(21600, 7430)); GameObject direnObject = EntityManager.Instance.CreateEntityModel(diren, 1002, new Vector3(0, 0, 0), direnPosition); DontDestroyOnLoad(direnObject); System.Collections.Generic.List <string> sources = new System.Collections.Generic.List <string>(); //sources.Add("Media/Effect/Model/Materials/guangquan.tga"); sources.Add("Audio/sounddead/Nvyao5_Dead"); //mp3 sources.Add("effect/ui_effect/Remove_cooling_effect"); //prefab sources.Add("Audio/sounddead/Nvyao5_Attack"); //sources.Add ("effect/skill/release/sword_ex");//skill manager id : 140026 ResourceCache.Instance.preLoadResources(sources); ResourceCache.Instance.preLoadResources(10004); }
public void UpdateDestribe(SkillType skillType, Iselfplayer player) { int skillId = player.SkillIdDic[skillType]; UpdateDestribe(skillId, (Iplayer)player); }
void LoadBattle() { //LoadScene.Instance.LoadAsignedSene ("Scenes/pvp_001") //ResourcesManager.HandleFinishLoadLevel += onFinishLoadLevel; DontDestroyOnLoad(GameObject.Find("GameUI")); DontDestroyOnLoad(this); DontDestroyOnLoad(GameObject.Find("JxBlGame")); ResourcesManager.Instance.Init(); ResourcesManager.HandleFinishLoadLevel del = onFinishLoadLevel; ResourcesManager.Instance.loadLevel("cenes/pvp_001", del); //HeroTimeLimitWindow window = WindowManager.Instance.GetWindow (EWindowType.EMT_HeroTimeLimitWindow) as HeroTimeLimitWindow; //string path = GameDefine.GameConstDefine.LoadMonsterModels; //Entity entity; //entity.r Ientity player = new Iselfplayer(1001, EntityCampType.CampTypeA); player.entityType = EntityType.Player; player.ObjTypeID = 10003; //<szNOStr>10003</szNOStr> new EntityManager(); new PlayerManager(); //依赖Audio? new GameStateManager(); //GameStateManager.Instance.EnterDefaultState(); //GameStateManager.Instance.ChangeGameStateTo(GameStateType.GS_Play); PlayState state = GameStateManager.Instance.GetCurState() as PlayState; Vector3 playerDefPosition = this.ConvertPosToVector3(new Vector2(21600, 7400)); mPlayerObj = EntityManager.Instance.CreateEntityModel(player, 1001, new Vector3(0, 0, 0), playerDefPosition); DontDestroyOnLoad(mPlayerObj); //PlayerManager.Instance.LocalPlayer = new SkillWindow window = WindowManager.Instance.GetWindow(EWindowType.EMT_SkillWindow) as SkillWindow; window.Show(); //摇杆 //依赖于PlayerManager.Instance.LocalAccount //还依赖于PlayerManager.Instance.LocalPlayer.RealEntity PlayerManager.Instance.LocalAccount = (Iplayer)player; PlayerManager.Instance.LocalAccount.SetObjType(GameDefine.ObPlayerOrPlayer.PlayerType); //play state需要 GamePlayWindow panel = WindowManager.Instance.GetWindow(EWindowType.EWT_GamePlayWindow) as GamePlayWindow; panel.Show(); // GameObject uiRoot = GameObject.Find ("GameUI"); // ResourceUnit unit = ResourcesManager.Instance.loadImmediate ("Guis/UIMainWindow",ResourceType.PREFAB); // GameObject virtualPanel = GameObject.Instantiate (unit.Asset) as GameObject; // virtualPanel.transform.parent = uiRoot.transform; // child.transform.parent = // gameObject.transform. //gameObject.transform. }
void ShowItemCost(int index) { float cdTime = 0f; if (PlayerManager.Instance == null || PlayerManager.Instance.LocalPlayer == null) { return; } if (!mItemCdDic.ElementAt(index).Value.gameObject.activeInHierarchy) { return; } if (mItemCdDic.ElementAt(index).Value.cdSlider.gameObject.activeInHierarchy) { mItemCost.ElementAt(index).Value.SetActive(false); } else { int count = 0, itemId = -1; int start = 0; if (mPageIndex == PackPage.Page2) { start += 3; } start += index; PlayerManager.Instance.LocalPlayer.UserGameItemsCount.TryGetValue(start, out count); PlayerManager.Instance.LocalPlayer.UserGameItems.TryGetValue(start, out itemId); if (count == 0 || !ConfigReader.ItemXmlInfoDict.ContainsKey(itemId) || ConfigReader.ItemXmlInfoDict[itemId].un8UseTimes == 0) { if (mItemCost.ElementAt(index).Value.activeInHierarchy) { mItemCost.ElementAt(index).Value.SetActive(false); } return; } int skillId = ConfigReader.ItemXmlInfoDict[itemId].un32SkillID; SkillManagerConfig info = ConfigReader.GetSkillManagerCfg(skillId); bool showTag = false; Iselfplayer iPlayer = PlayerManager.Instance.LocalPlayer; if (iPlayer == null || cdTime > 0) { return; } if (iPlayer.Mp < info.mpUse) { showTag = true; } if (iPlayer.Hp < info.hpUse) { showTag = true; } if (iPlayer.Cp < info.cpUse) { showTag = true; } if (mItemCost.ElementAt(index).Value.activeInHierarchy != showTag) { mItemCost.ElementAt(index).Value.SetActive(showTag); } } }