Esempio n. 1
0
    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;
        }
    }
Esempio n. 2
0
 void NotifyGameOver() {
     timeLimit = 0f;
     SceneGuideTaskManager.Instance().SetHasFinishedAllGuide(true);
     CGLCtrl_GameLogic.Instance.EmsgToss_FinishAllGuideToLobby();
     if (UINewsGuide.Instance != null) {
         LoadUiResource.DestroyLoad(SceneGuideTaskManager.guideUiPath);
     }
 }
Esempio n. 3
0
    private string GetXueTiaoPrefabPath(Ientity entity)
    {
        string XuetiaoColor = "Green";

        if (PlayerManager.Instance.LocalPlayer == null || PlayerManager.Instance.LocalPlayer.realObject == null)
        {
            int campEntity = (int)entity.EntityCamp % 2;
            int playerCamp = (int)PlayerManager.Instance.LocalAccount.GameUserSeat % 2;
            if (playerCamp != campEntity)
            {
                XuetiaoColor = "Red";
            }
        }
        else if (entity.EntityCamp == EntityCampType.CampTypeBad || (PlayerManager.Instance.LocalPlayer != null && entity.EntityCamp != PlayerManager.Instance.LocalPlayer.EntityCamp))
        {
            XuetiaoColor = "Red";
        }

        if (PlayerManager.Instance.LocalAccount.ObjType == GameDefine.ObPlayerOrPlayer.PlayerObType && entity.EntityCamp != PlayerManager.Instance.LocalAccount.EntityCamp)
        {
            XuetiaoColor = "Red";
        }
        string path = "";

        switch (entity.entityType)
        {
        case EntityType.Building:
            path = String.Format(pathBuildingXuetiao, XuetiaoColor);
            break;

        case EntityType.Player:
            path = String.Format(pathPlayerXuetiao, XuetiaoColor);
            break;

        case EntityType.Soldier:
        case EntityType.AltarSoldier:
            path = String.Format(pathSoldierXuetiao, XuetiaoColor);
            //Debug.LogError("path = " + path);
            break;

        case EntityType.Monster:
            path = pathMonster;
            break;
        }
        if (entity.NpcGUIDType == 21017 || entity.NpcGUIDType == 21025 || entity.NpcGUIDType == 21024)
        { //新手引导假的英雄
            path = String.Format(pathPlayerXuetiao, XuetiaoColor);
            SceneGuideTaskManager.Instance().AddFakeHero(entity);
        }
        else if (entity.NPCCateChild == ENPCCateChild.eNPCChild_BUILD_Summon)
        {
            path = String.Format(pathSummonedXuetiao, XuetiaoColor);
        }
        return(GameDefine.GameConstDefine.GuisPlay + path);
    }
Esempio n. 4
0
        public void UpdateRoomBaseInfo(UInt64 roomID, UInt32 mapID)
        {
            GameUserModel.Instance.GameRoomID = roomID;
            GameUserModel.Instance.GameMapID  = mapID;

            if (SceneGuideTaskManager.Instance().IsNewsGuide((int)mapID) == SceneGuideTaskManager.SceneGuideType.NoGuide)
            {
                //断线重连等待过程中游戏结束退回房间特殊处理,关闭重连窗口和等待窗口.
                EventCenter.Broadcast(EGameEvent.eGameEvent_ReConnectSuccess);
                EventCenter.Broadcast(EGameEvent.eGameEvent_EndWaiting);

                EventCenter.SendEvent(new CEvent(EGameEvent.eGameEvent_IntoRoom));
            }
        }
Esempio n. 5
0
    public static void LoadGuideOver()
    {       
        //GameObject obj = GameObject.Instantiate(Resources.Load(GameConstDefine.GuideOverUi)) as GameObject;

        ResourceUnit objUnit = ResourcesManager.Instance.loadImmediate(GameConstDefine.GuideOverUi, ResourceType.PREFAB);
        GameObject obj = GameObject.Instantiate(objUnit.Asset) as GameObject;
           
        obj.transform.parent = UINewsGuide.Instance.transform;
        obj.transform.localPosition = Vector3.zero;
        obj.transform.localScale = Vector3.one;
        objUI = obj.transform.FindChild("Position").gameObject;
        objUI.SetActive(false);

        if (SceneGuideTaskManager.Instance().sceneGuideTask != null && SceneGuideTaskManager.Instance().sceneGuideTask.currentTask != null)
        {
            SceneGuideTaskManager.Instance().sceneGuideTask.currentTask.CleanAllTask();
        }
    }
Esempio n. 6
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);
            }
        }
Esempio n. 7
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);
        }
Esempio n. 8
0
    protected override float GetXueTiaoHeight()
    {
        HeroConfigInfo info = null;

        if ((SceneGuideTaskManager.Instance().IsNewsGuide() != SceneGuideTaskManager.SceneGuideType.NoGuide) &&
            (xueTiaoOwner.entityType == EntityType.Soldier ||
             xueTiaoOwner.entityType == EntityType.AltarSoldier))
        {
            NpcConfigInfo nInfo = ConfigReader.GetNpcInfo(xueTiaoOwner.NpcGUIDType);
            ShowGuideXueTiaoInfo();
            return(nInfo.NpcXueTiaoHeight);
        }
        else
        {
            info = ConfigReader.GetHeroInfo(xueTiaoOwner.NpcGUIDType);
        }

        return(info.HeroXueTiaoHeight);
    }
Esempio n. 9
0
 void ShowGuideXueTiaoInfo()
 {
     if ((SceneGuideTaskManager.Instance().IsNewsGuide() != SceneGuideTaskManager.SceneGuideType.NoGuide) &&
         (xueTiaoOwner.entityType == EntityType.Soldier ||
          xueTiaoOwner.entityType == EntityType.AltarSoldier))
     {
         if (xueTiaoOwner.NpcGUIDType == 21017)
         {
             labelName.text = "伊芙蕾";
         }
         else if (xueTiaoOwner.NpcGUIDType == 21025)
         {
             labelName.text = "半人马酋长";
         }
         else if (xueTiaoOwner.NpcGUIDType == 21024)
         {
             labelName.text = "冷面黑寡妇";
         }
         labelLevel.text     = "4";
         mpSprite.fillAmount = 1f;
     }
 }
Esempio n. 10
0
        //窗口控件初始化
        protected override void InitWidget()
        {
            //技能按钮初始化
            Transform Adjust = mRoot.Find("Adjust");

            mBtnArray = new ButtonOnPress[Adjust.childCount];
            for (int i = 0; i < mBtnArray.Length; i++)
            {
                ButtonOnPress btn = mRoot.Find("Adjust/Button_" + i).GetComponent <ButtonOnPress>();
                mBtnArray[i] = btn;

                //事件注册
                switch ((ShortCutBarBtn)i)
                {
                case ShortCutBarBtn.BTN_SKILL_1:
                    btn.AddListener(i, OnSkillBtnFunc);
                    btn.AddListener(i, OnSkillPress, ButtonOnPress.EventType.PressType);
                    UIGuideCtrl.Instance.AddUiGuideEventBtn(btn.gameObject);
                    break;

                case ShortCutBarBtn.BTN_SKILL_2:
                case ShortCutBarBtn.BTN_SKILL_3:
                case ShortCutBarBtn.BTN_SKILL_4:
                case ShortCutBarBtn.BTN_SKILL_5:
                case ShortCutBarBtn.BTN_SKILL_6:
                    btn.AddListener(i, OnSkillBtnFunc);
                    btn.AddListener(i, OnSkillPress, ButtonOnPress.EventType.PressType);
                    break;

                case ShortCutBarBtn.BTN_AUTOFIGHT:
                case ShortCutBarBtn.BTN_CHANGELOCK:
                    btn.AddListener(i, OnCutBarBtnFunc, ButtonOnPress.EventType.ClickType);
                    UIGuideCtrl.Instance.AddUiGuideEventBtn(btn.gameObject);
                    break;
                }

                //状态控制组件初始化
                if (i < SkillCount)
                {
                    GameObject obj = btn.transform.Find("Light").gameObject;
                    mCanPressEffect.Add((ShortCutBarBtn)i, obj);

                    UISprite sprite = mRoot.Find("Adjust/Button_" + i + "/CutBar_" + i).GetComponent <UISprite>();
                    mBtnSprite.Add((ShortCutBarBtn)i, sprite);

                    ButtonSelectPic selectPic = btn.GetComponent <ButtonSelectPic>();
                    selectPic.state = ButtonSelectPic.SelectState.DisableState;
                    mBtnSelectPic.Add((ShortCutBarBtn)i, selectPic);
                }
            }

            //暴气技能初始化
            ResourceUnit effectUnit = ResourcesManager.Instance.loadImmediate(GameDefine.GameConstDefine.FurySkillBtnEffect, ResourceType.PREFAB);

            //技能1暴气
            mEffect3 = GameObject.Instantiate(effectUnit.Asset) as GameObject;
            mEffect3.transform.parent        = mBtnArray[(int)ShortCutBarBtn.BTN_SKILL_3].transform;
            mEffect3.transform.localPosition = new Vector3(0f, 0f, -10f);

            //技能2暴气
            mEffect4 = GameObject.Instantiate(effectUnit.Asset) as GameObject;
            mEffect4.transform.parent        = mBtnArray[(int)ShortCutBarBtn.BTN_SKILL_4].transform;
            mEffect4.transform.localPosition = new Vector3(0f, 0f, -10f);

            ChangeFuryState(EFuryState.eFuryNullState);

            //初始化技能按钮
            ShowValideUseSkillBtn(ShortCutBarBtn.BTN_SKILL_1, true);
            ShowValideUseSkillBtn(ShortCutBarBtn.BTN_SKILL_2, true);
            ShowValideUseSkillBtn(ShortCutBarBtn.BTN_SKILL_3, true);
            ShowValideUseSkillBtn(ShortCutBarBtn.BTN_SKILL_4, true);

            if (SceneGuideTaskManager.Instance().IsNewsGuide() == SceneGuideTaskManager.SceneGuideType.NoGuide)
            {
                mBtnSelectPic[ShortCutBarBtn.BTN_SKILL_5].gameObject.SetActive(false);
                mBtnSelectPic[ShortCutBarBtn.BTN_SKILL_6].gameObject.SetActive(false);
                ShowValideUseSkillBtn(ShortCutBarBtn.BTN_SKILL_5, false);
                ShowValideUseSkillBtn(ShortCutBarBtn.BTN_SKILL_6, false);
            }

            //CD初始化
            for (int i = 0; i < SkillCount; i++)
            {
                CdCountDown cd = mBtnArray[i].GetComponent <CdCountDown>();
                mCdDownDic.Add((ShortCutBarBtn)i, cd);
            }
            ResetSkill();

            mIsShowDes = false;

            mTimePressStart = 0f;
            mCurSkillPress  = -1;
        }