Ejemplo n.º 1
0
        /// <summary>
        /// 所有怪物按照距离排序 去除野怪和建筑
        /// </summary>
        /// <param name="self"></param>
        /// <param name="radius"></param>
        /// <returns></returns>
        public static List <Ientity> GetEnemyItemListByRadiusWithoutMonsterBuilding(Ientity self, float radius)
        {
            var items = from item in EntityManager.AllEntitys.Values
                        where item.RealEntity != null
                        where IsEnemyCamp(self, item)
                        where item.FSM != null
                        where item.FSM.State != BlGame.FSM.FsmState.FSM_STATE_DEAD
                        where item.entityType != EntityType.Monster
                        where item.entityType != EntityType.Building
                        let distance = Vector3.Distance(item.realObject.transform.position, self.realObject.transform.position)
                                       where distance < radius
                                       orderby distance
                                       select item;

            return(items.ToList());
        }
Ejemplo n.º 2
0
 public static bool IsEnemyCamp(Ientity self, Ientity target)
 {
     if (target.EntityCamp == EntityCampType.CampTypeKind)
     {
         return(false);
     }
     if (target.EntityCamp == EntityCampType.CampTypeBad)
     {
         return(true);
     }
     if (self.EntityCamp != target.EntityCamp)
     {
         return(true);
     }
     return(false);
 }
Ejemplo n.º 3
0
        /// <summary>
        /// 爆炸特效
        /// </summary>
        /// <param name="entity"></param>
        public static void SetLoadJianTaBaoZha(Ientity entity, bool Replace = true)
        {
            if (entity.NPCCateChild != ENPCCateChild.eNPCChild_BUILD_Summon && Replace)
            {
                BuildReplaceObject(entity);
            }
            GameObject root = null;
            //Vector3 pos = entity.EntityFSMPosition;
            Vector3 pos = entity.realObject.transform.position;

            //if (entity.NpcGUIDType != Ientity.JIDI_A && entity.NpcGUIDType != Ientity.JIDI_B)
            if (!EntityManager.GetHomeBaseList().Contains(entity))
            {
                string jianTaBaoZha = ConfigReader.GetNpcInfo(entity.NpcGUIDType).NpcJianTaDeath;
                if (jianTaBaoZha == "0" || jianTaBaoZha == null || entity.deadSpot == false)
                {
                    return;
                }

                //GameObject CreateEffect = Resources.Load(GameConstDefine.LoadGameBuildingEffectPath + jianTaBaoZha) as GameObject;
                //ResourceUnit CreateEffectUnit = ResourcesManager.Instance.loadImmediate(GameConstDefine.LoadGameBuildingEffectPath + jianTaBaoZha, ResourceType.PREFAB);
                //GameObject CreateEffect = CreateEffectUnit.Asset as GameObject;


                NormalEffect normalEffect = EffectManager.Instance.CreateNormalEffect(GameConstDefine.LoadGameBuildingEffectPath + jianTaBaoZha, null);
                if (normalEffect == null)
                {
                    return;
                }
                //root = GameObject.Instantiate(CreateEffect) as GameObject;
                //if (root != null)
                //    root.transform.position = new Vector3(pos.x, pos.y + 6, pos.z);
                normalEffect.obj.transform.position = new Vector3(pos.x, pos.y + 6, pos.z);
            }
            else
            {
                if (entity.IsSameCamp(EntityCampType.CampTypeA))
                {
                    pos.y += 6f;
                    LoadBaseDate.Instance().BaseA.gameObject.SetActive(true);
                    LoadBaseDate.Instance().BaseA.transform.position = new Vector3(pos.x, pos.y, pos.z);
                    return;
                }
                LoadBaseDate.Instance().BaseB.gameObject.SetActive(true);
                LoadBaseDate.Instance().BaseB.transform.position = new Vector3(pos.x, pos.y, pos.z);
            }
        }
Ejemplo n.º 4
0
        private void UpdateHomeHp()
        {
            //更新A阵营
            Ientity entity = EntityManager.GetHomeBase(EntityCampType.CampTypeA);

            if (entity != null)
            {
                spriteHomeBaseA.fillAmount = entity.Hp / entity.HpMax;
            }

            //更新B阵营
            entity = EntityManager.GetHomeBase(EntityCampType.CampTypeB);
            if (entity != null)
            {
                spriteHomeBaseB.fillAmount = entity.Hp / entity.HpMax;
            }
        }
Ejemplo n.º 5
0
        public void SetShowLabel(UInt64 headIcon, string name, int level, int kill, int times, int campId)
        {
            tran.gameObject.SetActive(true);
            if (!EntityManager.AllEntitys.ContainsKey(headIcon))
            {
                return;
            }
            Ientity sEntity           = EntityManager.AllEntitys[headIcon];
            int     id                = (int)sEntity.ObjTypeID;
            HeroSelectConfigInfo info = ConfigReader.GetHeroSelectInfo(id);

            HeadIcon.spriteName     = info.HeroSelectHead.ToString();
            HeadNameLabel.text      = name;
            HeroLevelLabel.text     = level.ToString();
            HeroKillsLabel.text     = kill.ToString();
            HeroDeadTimesLabel.text = times.ToString();
        }
Ejemplo n.º 6
0
        /// <summary>
        /// 根据距离排序所有敌对阵营的小兵
        /// </summary>
        /// <param name="self"></param>
        /// <param name="radius"></param>
        /// <returns></returns>
        public static List <Ientity> GetSoldierEnemyItemListByRadius(Ientity self, float radius)
        {
            var items = from item in EntityManager.AllEntitys.Values                 //创建查询 数据源:AllEntitys
                        where item.RealEntity != null                                //实体不为空
                        where IsEnemyCamp(self, item)                                //是敌方阵营
                        where item.FSM != null                                       //实体状态机不为空
                        where item.FSM.State != HolyTech.FSM.FsmState.FSM_STATE_DEAD //实体不是死亡状态
                        where item.entityType != EntityType.Building                 //实体类型不是建筑
                        where item.entityType != EntityType.Monster                  //实体类型不是野怪
                        where item.entityType != EntityType.Player                   //实体类型不是玩家
                        let distance = Vector3.Distance(item.realObject.transform.position, self.realObject.transform.position)
                                       where distance < radius                       //距离在范围内
                                       orderby distance                              //以距离排序(从小到大)
                                       select item;                                  //选择符合条件的单元

            return(items.ToList());
        }
Ejemplo n.º 7
0
        private void InitGameMap()
        {
            //清除已有对象
            Clear();

            //地图初始化
            MapInfo map = MapLoadConfig.Instance.GetMapInfo(GameUserModel.Instance.GameMapID);

            if (!mInited && map != null)
            {
                Ientity player = PlayerManager.Instance.LocalPlayer;

                if (map.mCameraType == 1)
                {
                    if (player.EntityCamp == EntityCampType.CampTypeA)
                    {
                        mMapPanel.Rotate(new Vector3(0, 0, 45));
                    }
                    else
                    {
                        mMapPanel.Rotate(new Vector3(0, 0, 225));
                    }
                    mMapPanel.localPosition = new Vector3(-120, -120, 0);
                }
                else
                {
                    if (player.EntityCamp == EntityCampType.CampTypeA)
                    {
                        mMapPanel.Rotate(new Vector3(0, 0, 0));
                    }
                    else
                    {
                        mMapPanel.Rotate(new Vector3(0, 0, 180));
                    }
                    mMapPanel.localPosition = new Vector3(-130, -66, 0);
                }
            }

            mInited = true;

            //加入已经存在的对象,比如静态NPC
            foreach (Ientity entity in EntityManager.AllEntitys.Values)
            {
                OnAddMapEvent(entity);
            }
        }
Ejemplo n.º 8
0
        //不包含自己阵营
        public static IEnumerable <Ientity> GetEnemyItemListByRadius(Ientity self, float radius)
        {
            var items = from item in EntityManager.AllEntitys.Values
                        where item.RealEntity != null
                        where item.RealEntity.enabled == true
                        where item.entityType != EntityType.Monster
                        where IsEnemyCamp(self, item)
                        where item.FSM != null
                        where item.FSM.State != HolyTech.FSM.FsmState.FSM_STATE_DEAD
                        where item.mCanBeLocked
                        let distance = Vector3.Distance(item.realObject.transform.position, self.realObject.transform.position)
                                       where distance < radius
                                       orderby distance
                                       select item;

            return(items);
        }
Ejemplo n.º 9
0
        //

        public Buff AddBuff(uint instID, uint typeID, float remainTime, Ientity entity)
        {
            if (IsHaveBuff(instID))
            {
                return(buffDict[instID]);
            }
            if (entity == null)
            {
                return(null);
            }

            if (isHaveStopBuff(entity.GameObjGUID) == false)
            {
                BuffConfigInfo bi = ConfigReader.GetBuffInfo(typeID);
                if (null != bi)
                {
                    if (bi.effectID == (int)eBuffEffect.eBuffEffectXuanYun || bi.effectID == (int)eBuffEffect.eBuffEffectShuFu)
                    {
                        entity.OnEntityGetAstrictBuff();
                    }
                }
            }

            Buff b = new Buff();

            b.buffID     = instID;
            b.buffTypeID = typeID;
            b.buffTime   = remainTime;
            b.entity     = entity;

            //buffDict[instID] = b;
            buffDict.Add(instID, b);

            if (isSelfHaveBuffType(chenmoID) == true)
            {
                EventCenter.Broadcast <bool>(EGameEvent.eGameEvent_LocalPlayerSilence, true);
            }
            //refresh ui
            if (UIBuffUnityInterface.Instance != null)
            {
                UIBuffUnityInterface.Instance.RefreshUIItem();
            }


            return(b);
        }
Ejemplo n.º 10
0
        private string GetNpcElementPath(Ientity entity, bool blueTeam)
        {
            string path = null;

            if (entity.entityType == EntityType.Building || entity.entityType == EntityType.Monster)
            {
                if (entity.NPCCateChild == ENPCCateChild.eNPCChild_SmallMonster)
                {
                    path = GameDefine.GameConstDefine.NpcMinimapCreepsIconSmall;
                }
                else if (entity.NPCCateChild == ENPCCateChild.eNPCChild_HugeMonster)
                {
                    path = GameDefine.GameConstDefine.NpcMinimapCreepsIconHuge;
                }
                else if (entity.NPCCateChild == ENPCCateChild.eNPCChild_BUILD_Altar)
                {
                    path = GameDefine.GameConstDefine.NpcMinimapBarracksIcon;
                }
                else if (entity.NPCCateChild == ENPCCateChild.eNPCChild_BUILD_Base)
                {
                    path = GameDefine.GameConstDefine.NpcMinimapBaseIcon;
                }
                else if (entity.NPCCateChild == ENPCCateChild.eNPCChild_BUILD_Shop)
                {
                    path = GameDefine.GameConstDefine.NpcMinimapShopIcon;
                }
                else if (entity.NPCCateChild == ENPCCateChild.eNPCChild_BUILD_Tower)
                {
                    path = GameDefine.GameConstDefine.NpcMinimapTowerIcon;
                }
            }
            else
            {
                if (blueTeam)
                {
                    path = GameDefine.GameConstDefine.SoldierMapGameObject_Green;
                }
                else
                {
                    path = GameDefine.GameConstDefine.SoldierMapGameObject_Red;
                }
            }

            return(path);
        }
Ejemplo n.º 11
0
        private void OnSkillBtnFunc(int ie, bool isDown)//按技能
        {
            if (mIsShowDes)
            {
                mIsShowDes = false;
                return;
            }
            mIsShowDes = false;

            GamePlayCtrl.Instance.showaudiotimeold = System.DateTime.Now;
            if (PlayerManager.Instance.LocalPlayer.FSM == null ||
                PlayerManager.Instance.LocalPlayer.FSM.State == BlGame.FSM.FsmState.FSM_STATE_DEAD ||
                BlGame.Skill.BuffManager.Instance.isSelfHaveBuffType(1017))
            {
                return;
            }


            if (JxBlGame.Instance == null)
            {
                Ientity entity = PlayerManager.Instance.LocalPlayer;
                //110902
                //1201403蜘蛛网3级
                //pos.y = entity.realObject.transform.position.y;
                int     skillid = 1201403;
                Vector3 pos     = PlayerManager.Instance.LocalPlayer.objTransform.position;
                Vector3 dir     = new Vector3(0, 0, 0);
                Ientity target  = null;

                UInt64 owner = 0;                //buzhongyao
                //uint effectid = 140026;//弧月斩 2 attackeffect不能等于0
                uint   effectid = entity.Skill1;
                UInt32 uniqueid = 1001;
                //entity.RealEntity
                //BlGame.Effect.EffectManager.Instance.CreateAreaEffect(owner, effectid, uniqueid, dir, pos);//for 狐月斩
                BlGame.Effect.EffectManager.Instance.CreateSkillMoveEffect(entity, effectid, pos, pos, dir);

                //entity.EntityFSMChangeDataOnPrepareSkill(pos, dir, skillid, target);
                //entity.OnFSMStateChange(EntityLeadingFSM.Instance);
            }
            else
            {
                SendSkill(ie);
            }
        }
Ejemplo n.º 12
0
        private void AddMapWarning(UInt64 guid)
        {
            if (!EntityManager.AllEntitys.ContainsKey(guid))
            {
                return;
            }
            Ientity entity = EntityManager.AllEntitys[guid];

            if (entity == null || entity.realObject == null || !entity.realObject.activeInHierarchy)
            {
                return;
            }
            bool isAllow = false;

            if (entity.entityType != EntityType.Player && entity.entityType != EntityType.Soldier && entity.entityType != EntityType.AltarSoldier)
            {
                isAllow = false;
            }
            if (SceneGuideTaskManager.Instance().IsNewsGuide() != SceneGuideTaskManager.SceneGuideType.NoGuide && (entity.NpcGUIDType == 21017 ||
                                                                                                                   entity.NpcGUIDType == 21025 || entity.NpcGUIDType == 21024))
            {
                isAllow = true;
            }
            if (!isAllow)
            {
                return;
            }
            if (entity.FSM != null && entity.FSM.State == BlGame.FSM.FsmState.FSM_STATE_DEAD)
            {
                return;
            }
            UIMiniMapInterfaceWarning element = GetMapWarning(guid);
            Vector3 pos = entity.realObject.transform.position;

            if (element == null)
            {
                element = CreateMapElementWarning(guid, pos.x, pos.y, pos.z);
                mMapWarningDic.Add(guid, element);
            }
            else
            {
                element.UpdatePosDirect(pos.x, pos.y, pos.z);
            }
        }
Ejemplo n.º 13
0
 public void CreateCrticalStrike(int count, Ientity tran)
 {
     if (count == 0)
     {
         return;
     }
     foreach (var item in CrticalStrikeList)
     {
         if (item.isAni == false)
         {
             item.Init(tran);
             item.gameObject.transform.parent     = transform;
             item.gameObject.transform.localScale = Vector3.one;
             item.UpdatePosition(tran.realObject.transform);
             item.SetShowDighit(Mathf.Abs(count));
             break;
         }
     }
 }
Ejemplo n.º 14
0
        /// <summary>
        /// 建筑销毁、替换组件
        /// </summary>
        /// <param name="rp"></param>
        /// 要替换的GameObject
        /// <param name="dt"></param>
        /// 目标GameObject
        public static void BuildReplaceObject(Ientity entity)
        {
            if (!ConfigReader.MapObjXmlInfoDict.ContainsKey(entity.MapObgId))
            {
                return;
            }
            string rp = ConfigReader.MapObjXmlInfoDict[entity.MapObgId].ReplaceID;

            if (rp == "0" || rp == null)
            {
                return;
            }

            GameObject root = entity.realObject.transform.Find(rp).gameObject;

            root.SetActive(true);
            root.transform.parent   = null;
            root.transform.rotation = entity.realObject.transform.rotation;
        }
Ejemplo n.º 15
0
    public void ShowAltarHead(int type, Ientity entity)
    {
        if (entity == null || entity.realObject == null || entity.RealEntity == null)
        {
            return;
        }
        if (!entity.IsSameCamp(PlayerManager.Instance.LocalPlayer.EntityCamp))
        {
            return;
        }
        AltarInHead head = GetAsignedAltarHead(entity);

        if (head == null)
        {
            return;
        }
        head.CreateHead(type);
        //UIAltarInHead.Instance.SetCurrHeadIcon (type,entity.realObject.transform);
    }
Ejemplo n.º 16
0
    void UpdatePosition(Ientity target, Transform obj)



    {
        if (Camera.main == null || GameMethod.GetUiCamera == null)
        {
            return;
        }
        float height = GetTipHeight(target);
        // 血条对应在3d场景的位置
        Vector3 pos_3d = target.realObject.transform.position + new Vector3(0f, height, 0f);
        // 血条对应在屏幕的位置
        Vector2 pos_screen = Camera.main.WorldToScreenPoint(pos_3d);
        // 血条对应在ui中的位置
        Vector3 pos_ui = GameMethod.GetUiCamera.ScreenToWorldPoint(pos_screen);

        obj.position = Vector3.Slerp(transform.position, pos_ui, Time.time);
    }
Ejemplo n.º 17
0
 public void AddBuildingTips(Ientity entity)
 {
     if (SceneGuideTaskManager.Instance().IsNewsGuide() == SceneGuideTaskManager.SceneGuideType.NoGuide)
     {
         return;
     }
     if (!npcIdArray.Contains(entity.NpcGUIDType))
     {
         return;
     }
     if (buildingDic.ContainsKey(entity.NpcGUIDType))
     {
         buildingDic[entity.NpcGUIDType] = entity;
     }
     else
     {
         buildingDic.Add(entity.NpcGUIDType, entity);
     }
 }
Ejemplo n.º 18
0
    public BloodBarUI LoadXueTiaoPrefab(Ientity entity, string path)
    {
        //ResourceItem pathLoadUnit = ResourcesManager.Instance.loadImmediate(path, ResourceType.PREFAB);
        //GameObject pathLoad = pathLoadUnit.Asset as GameObject;
        GameObject obj = ObjectPool.Instance.GetGO(path);

//         if (pathLoad == null)
//             Debug.LogError("error Not found  BloodBarUI =  null");
//         GameObject obj = GameObject.Instantiate(pathLoad) as GameObject;
        if (obj == null)
        {
            Debug.LogError("obj = null");
        }
        BloodBarUI xueTiao = obj.GetComponent <BloodBarUI>();

        xueTiao.mResName = path;

        return(xueTiao);
    }
Ejemplo n.º 19
0
        private void OnWarningEvent(UInt64 ownerId, uint skillID, UInt64 targetID)
        {
            SkillAccountConfig skillAccConfig = ConfigReader.GetSkillAccountCfg(skillID);

            if (skillAccConfig == null || !skillAccConfig.isDmgEffect)
            {
                return;
            }
            if (!EntityManager.AllEntitys.ContainsKey(targetID))
            {
                return;
            }
            Ientity entity = EntityManager.AllEntitys[targetID];

            if (PlayerManager.Instance.LocalPlayer == null)
            {
                return;
            }
            if (!entity.IsSameCamp(PlayerManager.Instance.LocalPlayer.EntityCamp))
            {
                return;
            }
            if (entity == null || entity.realObject == null || !entity.realObject.activeInHierarchy)
            {
                return;
            }
            if (entity.entityType != EntityType.Building && entity.entityType != EntityType.Player)
            {
                if (SceneGuideTaskManager.Instance().IsNewsGuide() == SceneGuideTaskManager.SceneGuideType.NoGuide)
                {
                    return;
                }
                else
                {
                    if (entity.NpcGUIDType != 21017)//新手引导己方精灵女
                    {
                        return;
                    }
                }
            }
            AddMapWarning(targetID);
            AddBuildingWarningVoice(targetID);
        }
Ejemplo n.º 20
0
        //3.创建基于时间的特效
        public BeAttackEffect CreateTimeBasedEffect(string res, float time, Ientity entity)
        {
            if (res == "0")
            {
                return(null);
            }

            BeAttackEffect effect = new BeAttackEffect();

            //加载特效信息
            effect.skillID     = 0;         //技能id=0
            effect.cehuaTime   = time;
            effect.enTargetKey = entity.GameObjGUID;
            effect.resPath     = res;
            //创建
            effect.Create();

            AddEffect(effect.projectID, effect);
            return(effect);
        }
Ejemplo n.º 21
0
    void CraftingEnded()
    {
        overallData.gameData.isCrafting = false;
        Ientity entity = CLD.GetEntityByRecipeID(overallData.gameData.craftID);

        if (entity.GetType() == typeof(catData))
        {
            Debug.Log("Added Cat:" + ((catData)entity).name + "  ID:" + ((catData)entity).id);
            CatControl(((catData)entity).id, 1, CatControlType.count);
            EventNotifier.Invoke("Crafted New Cat: " + ((catData)entity).name);
            OnCatDataChaged.Invoke();
        }
        else
        {
            ItemControl(((itemData)entity).id, 1);
            EventNotifier.Invoke("Crafted New Item: " + ((itemData)entity).name);
            OnItemDataChanged.Invoke();
        }
        OnCraftingEnded.Invoke();
    }
Ejemplo n.º 22
0
    public void AttribbuteUpdate(Ientity entity)
    {
        Hp    = entity.Hp;
        HpMax = entity.HpMax;
        Mp    = entity.Mp;
        MpMax = entity.MpMax;
        Speed = entity.EntityFSMMoveSpeed;

        PhyAtk = entity.PhyAtk;
        MagAtk = entity.MagAtk;
        PhyDef = entity.PhyDef;
        MagDef = entity.MagDef;

        AtkSpeed = entity.AtkSpeed;
        AtkDis   = entity.AtkDis;

        HpRecover  = entity.HpRecover;
        MpRecover  = entity.MpRecover;
        RebornTime = entity.RebornTime;
    }
Ejemplo n.º 23
0
    //改变地图状态 其实就是将图片禁用
    void ChangeMapState()
    {
        UISprite sprite = headBg.transform.Find("Sprite").GetComponent <UISprite>();

        if (!EntityManager.AllEntitys.ContainsKey(mapTarget))
        {
            sprite.gameObject.SetActive(false);
            return;
        }

        Ientity entity = EntityManager.AllEntitys[mapTarget];

        //实体为空 或实体对象空  或 实体对象未激活
        if (entity == null || entity.realObject == null || !entity.realObject.activeInHierarchy)
        {
            sprite.gameObject.SetActive(false);
            return;
        }
        //全敌对类型的地图元素禁用
        if (entity.entityType != EntityType.Player && entity.entityType != EntityType.Soldier && entity.entityType != EntityType.AltarSoldier)
        {
            sprite.gameObject.SetActive(false);
            return;
        }

        //实体为死亡状态
        if (entity.FSM != null && entity.FSM.State == HolyTech.FSM.FsmState.FSM_STATE_DEAD)
        {
            sprite.gameObject.SetActive(false);
            return;
        }

        Vector3 pos = entity.realObject.transform.position; //获取实体位置

        UpdatePosDirect(pos.x, pos.y, pos.z);               //将对象设置到目标点


        spriteSmallIcon.spriteName = smallIconName;
        spriteSmallIcon.SetDimensions((int)orignalSize.x, (int)orignalSize.y);//设置规模大小
        headBg.gameObject.SetActive(false);
    }
Ejemplo n.º 24
0
        private void OnAddMapEvent(Ientity entity)
        {
            if (entity == null || entity.realObject == null || !entity.realObject.activeInHierarchy)
            {
                return;
            }

            if (entity.entityType != EntityType.Player && entity.entityType != EntityType.Soldier && entity.entityType != EntityType.AltarSoldier && entity.entityType != EntityType.Building && entity.entityType != EntityType.Monster)
            {
                return;
            }

            if (entity.FSM != null && entity.FSM.State == BlGame.FSM.FsmState.FSM_STATE_DEAD)
            {
                return;
            }

            Vector3 pos = entity.realObject.transform.position;

            AddMapElement(entity.GameObjGUID, entity.EntityCamp, pos.x, pos.y, pos.z);
        }
Ejemplo n.º 25
0
        //6.创建普通引导特效
        public NormalEffect CreateLeadingEffect(UInt64 owner, UInt32 skillModelID, UInt32 projectid)
        {
            SkillLeadingonfig skillconfig = ConfigReader.GetSkillLeadingConfig(skillModelID);

            //判断路径是否有效
            if (skillconfig == null || skillconfig.effect == "0")
            {
                return(null);
            }

            string       resourcePath = GameConstDefine.LoadGameSkillEffectPath + "release/" + skillconfig.effect;
            NormalEffect effect       = new NormalEffect();

            //加载特效信息
            effect.projectID = projectid;
            effect.NEType    = NormalEffect.NormalEffectType.eNE_Leading;
            effect.resPath   = resourcePath;

            Ientity entity = null;

            EntityManager.AllEntitys.TryGetValue(owner, out entity);

            //创建
            if (entity != null)
            {
                effect.Create();
                if (effect.obj == null)
                {
                    return(null);
                }
                if (null != entity.RealEntity.objPoint)
                {
                    effect.obj.transform.parent        = entity.RealEntity.objPoint.transform;
                    effect.obj.transform.localPosition = new Vector3(0.0f, 0.0f, 0.0f);
                }
            }

            AddEffect(effect.projectID, effect);
            return(effect);
        }
Ejemplo n.º 26
0
        //播放技能释放声音
        public static void playSkillReleaseSound(Ientity entity, int skillID)
        {
            if (entity == null)
            {
                return;
            }
            SkillManagerConfig skillinfo = ConfigReader.GetSkillManagerCfg(skillID);

            if (skillinfo == null)
            {
                return;
            }
            string       soundPath = GameConstDefine.LoadGameSoundPath + skillinfo.rSound;
            ResourceUnit objUnit   = ResourcesManager.Instance.loadImmediate(soundPath, ResourceType.ASSET);
            AudioClip    clip      = objUnit.Asset as AudioClip;

            if (clip != null)
            {
                AudioSource Audio = AudioManager.Instance.PlayEffectAudio(clip);
                SceneSoundManager.Instance.addSound(Audio, entity.RealEntity.gameObject);
            }
        }
        private void CheckAddHeroBornVoice()
        {
            if (heroVoicDic != null && heroVoicDic.Count == 3)
            {
                return;
            }
            IEnumerable <Ientity> Items    = GameMethod.GetEnemyItemListByRadius(PlayerManager.Instance.LocalPlayer, GameConstDefine.PlayerLockTargetDis);
            List <Ientity>        ItemList = Items.ToList();

            if (ItemList == null || ItemList.Count == 0)
            {
                return;
            }
            for (int i = ItemList.Count - 1; i >= 0; i--)
            {
                Ientity entity = ItemList[i];
                if (SceneGuideTaskManager.Instance().IsFakeHero(entity.NpcGUIDType))
                {
                    AddHeroVoice(entity.NpcGUIDType);
                }
            }
        }
Ejemplo n.º 28
0
        //按功能键
        private void OnCutBarBtnFunc(int ie, bool isDown)
        {
            if (isDown)
            {
                return;
            }
            switch ((ShortCutBarBtn)ie)
            {
            case ShortCutBarBtn.BTN_AUTOFIGHT:
                if (JxBlGame.Instance == null)
                {
                    GameObject target = GameObject.Find("Dongfashi_5(Clone)");
                    Ientity    entity = PlayerManager.Instance.LocalPlayer;
                    Vector3    pos    = target.transform.position;
                    //Quaternion dir = entity.RealEntity.transform.rotation - target.transform.rotation;
                    Vector3 dir = entity.EntityFSMDirection;
                    //int skillid = 120002;//鬼武士攻击 skillcfg编号
                    int skillid = 1100301;                            //鬼武士攻击 skillcfg_manager编号
                    entity.EntityFSMChangeDataOnPrepareSkill(pos, dir, skillid, null);
                    entity.OnFSMStateChange(EntityReleaseSkillFSM.Instance);
                    //entity.RealEntity.PlayerAttackAnimation();

                    //计算攻击距离
                    //输出特效

                    string absortActPath = "effect/skill/hit/Hitcutlight";
                    BlGame.Effect.EffectManager.Instance.CreateNormalEffect(absortActPath, target);
                }
                else
                {
                    CGLCtrl_GameLogic.Instance.GameAutoFight();
                }
                break;

            case ShortCutBarBtn.BTN_CHANGELOCK:
                OnLockEnemySoldier();
                break;
            }
        }
Ejemplo n.º 29
0
    void SetLevelDeadKill(BattleInfo item, int i)
    {
        BattleInfoList [i].PlayerLevelLabel.text = item.PlayerLevel.ToString();
        BattleInfoList [i].PlayerNameLabel.text  = item.PlayerName;

        if (!EntityManager.AllEntitys.ContainsKey(item.PlayerIcon))
        {
            return;
        }
        Ientity sEntity = EntityManager.AllEntitys[item.PlayerIcon];

        int id = (int)sEntity.ObjTypeID;

        BattleInfoList [i].PlayerDeathLabel.text = item.PlayerDeath.ToString();
        HeroSelectConfigInfo info = ConfigReader.GetHeroSelectInfo(id);

        BattleInfoList [i].PlayerKillsLabel.text = item.PlayerKills.ToString();
        if (info != null)
        {
            BattleInfoList [i].PlayerIcon.spriteName = info.HeroSelectHead.ToString();
        }
    }
Ejemplo n.º 30
0
        public void CreateCircleRes(Ientity entity)
        {
            target = entity;
            string       path    = GameConstDefine.LoadGameOtherEffectPath;
            ResourceItem objUnit = ResourcesManager.Instance.loadImmediate(path + "guangquan_jianta", ResourceType.PREFAB);
            GameObject   obj     = GameObject.Instantiate(objUnit.Asset) as GameObject;

            obj.transform.parent        = entity.realObject.transform;
            obj.transform.position      = entity.realObject.transform.position + new Vector3(0.0f, 0.2f, 0.0f);
            obj.transform.localRotation = Quaternion.Euler(new Vector3(0.0f, 0.0f, 0.0f));
            int   skillID = ConfigReader.NpcXmlInfoDict[entity.NpcGUIDType].NpcSkillType1;
            float range   = ConfigReader.GetSkillManagerCfg(skillID).range;
            float rate    = 1f / 16f;

            obj.transform.localScale = new Vector3(range * rate / entity.RealEntity.transform.localScale.x, 1.0f, range * rate / entity.RealEntity.transform.localScale.z);
            startTime = DateTime.Now;
            objEffect = obj;
            ResourceItem clipUnit = ResourcesManager.Instance.loadImmediate(AudioPath, ResourceType.PREFAB);
            AudioClip    clip     = clipUnit.Asset as AudioClip;

            AudioManager.Instance.PlayEffectAudio(clip);
            isInWarning = true;
        }