Esempio n. 1
0
        void Start()
        {
            if (GameDataManager.Instance.DataIsNull(DataType.InitializeEctype))
            {
                return;
            }

            SMSGEctypeInitialize_SC sMSGEctypeInitialize_SC = (SMSGEctypeInitialize_SC)GameDataManager.Instance.PeekData(DataType.InitializeEctype);
            var ectypeData = EctypeConfigManager.Instance.EctypeContainerConfigList[sMSGEctypeInitialize_SC.dwEctypeContainerId];

            if (ectypeData.lEctypeType == 9)
            {
                //初始化讨伐副本
                UI.CreatObjectToNGUI.InstantiateObj(Eff_CrusadeBattleStart, transform);
                Timing.SetActive(true);

                StartCoroutine("LateTiming");
                RegisterEventHandler();

                //储存所有玩家信息
                PlayerManager.Instance.PlayerList.ApplyAllItem(p => {
                    IEntityDataStruct ds = p.EntityDataStruct;
                    m_DataStruceList.Add(ds);
                });
            }
        }
Esempio n. 2
0
        void Init(object obj)
        {
            GameDataManager.Instance.dataEvent.RemoveEventHandel(DataType.InitializeEctype, Init);
            SMSGEctypeInitialize_SC sMSGEctypeInitialize_SC = (SMSGEctypeInitialize_SC)GameDataManager.Instance.PeekData(DataType.InitializeEctype);

            m_curEctypeCombo = EctypeConfigManager.Instance.EctypeContainerConfigList[sMSGEctypeInitialize_SC.dwEctypeContainerId].ComboValue;
        }
Esempio n. 3
0
        public void ShowBackToTownBox(object obj)
        {
            SoundManager.Instance.PlaySoundEffect("Sound_Button_Default");

            /* 新UI修改后去掉判断
             * if (BattleSettingPanel == null)
             * {
             *  BattleSettingPanel = CreatObjectToNGUI.InstantiateObj(BattleSettingPrefab,Center).GetComponent<BattleSettingPanel>();
             * }
             * BattleSettingPanel.ShowPanel();
             */
            if (BattleSettlementManager.Instance().IsGameSettlement || GameDataManager.Instance.DataIsNull(DataType.InitializeEctype))
            {
                return;
            }
            SMSGEctypeInitialize_SC sMSGEctypeInitialize_SC = (SMSGEctypeInitialize_SC)GameDataManager.Instance.PeekData(DataType.InitializeEctype);
            EctypeContainerData     ectypeData = EctypeConfigManager.Instance.EctypeContainerConfigList[sMSGEctypeInitialize_SC.dwEctypeContainerId];

            if (ectypeData.MapType == 5)
            {
                MessageBox.Instance.Show(3, "", LanguageTextManager.GetString("IDS_H1_490"), LanguageTextManager.GetString("IDS_H2_14"), LanguageTextManager.GetString("IDS_H2_9"), null, BackToTown);
            }
            else
            {
                MessageBox.Instance.Show(3, "", LanguageTextManager.GetString("IDS_H1_71"), LanguageTextManager.GetString("IDS_H2_14"), LanguageTextManager.GetString("IDS_H2_9"), null, BackToTown);
            }
        }
Esempio n. 4
0
    void Init(object obj)
    {
        GameDataManager.Instance.dataEvent.RemoveEventHandel(DataType.InitializeEctype, Init);
        SMSGEctypeInitialize_SC sMSGEctypeInitialize_SC = (SMSGEctypeInitialize_SC)GameDataManager.Instance.PeekData(DataType.InitializeEctype);

        CurSelectEctype(sMSGEctypeInitialize_SC.dwEctypeContainerId);
    }
Esempio n. 5
0
        void TweenShowTitle02(object obj)
        {
            SMSGEctypeInitialize_SC sMSGEctypeInitialize_SC = (SMSGEctypeInitialize_SC)GameDataManager.Instance.PeekData(DataType.InitializeEctype);
            var EctypeData = EctypeConfigManager.Instance.EctypeContainerConfigList[sMSGEctypeInitialize_SC.dwEctypeContainerId];

            EctypeNameLabel.SetText(LanguageTextManager.GetString(EctypeData.lEctypeName));
            TweenAlpha.Begin(EctypeNameLabel.gameObject, 0.3f, 0, 1, TweenShowTitle03);
        }
Esempio n. 6
0
        void Init(object obj)
        {
            GameDataManager.Instance.dataEvent.RemoveEventHandel(DataType.InitializeEctype, Init);
            SMSGEctypeInitialize_SC sMSGEctypeInitialize_SC = (SMSGEctypeInitialize_SC)GameDataManager.Instance.PeekData(DataType.InitializeEctype);

            EctypeData = EctypeConfigManager.Instance.EctypeContainerConfigList[sMSGEctypeInitialize_SC.dwEctypeContainerId];
            EctypeNameLabel.SetText(LanguageTextManager.GetString(EctypeData.lEctypeName));
            SuggestionPesionLabel.SetButtonText(string.Format(LanguageTextManager.GetString("IDS_H1_501"), EctypeData.PlayerNum));
        }
Esempio n. 7
0
        void Init(object obj)
        {
            GameDataManager.Instance.dataEvent.RemoveEventHandel(DataType.InitializeEctype, Init);
            var peekData = GameDataManager.Instance.PeekData(DataType.InitializeEctype);
            SMSGEctypeInitialize_SC ectypeSmg = (SMSGEctypeInitialize_SC)peekData;

            if (ectypeSmg.dwEctypeContainerId == CommonDefineManager.Instance.CommonDefine.TUTORIAL_ECTYPE_ID)
            {
                SysSettingButton.gameObject.SetActive(false);
            }
            GuideBtnManager.Instance.RegGuideButton(this.SysSettingButton.gameObject, MainUI.UIType.Empty, SubType.EctypeSysSetting, out m_guideBtnID);
        }
Esempio n. 8
0
    CommandCallbackType InitializeEctypeHandle(byte[] dataBuffer, int socketID)
    {
        SMSGEctypeInitialize_SC sMSGEctypeInitialize_SC = SMSGEctypeInitialize_SC.ParsePackage(dataBuffer);

        GameDataManager.Instance.ResetData(DataType.InitializeEctype, sMSGEctypeInitialize_SC);
        EctypeManager.Instance.Set(sMSGEctypeInitialize_SC);
        EctypeContainerData ectypeData = EctypeConfigManager.Instance.EctypeContainerConfigList[sMSGEctypeInitialize_SC.dwEctypeContainerId];

        GameManager.Instance.ectypeType = (EEcytpeBattleType)ectypeData.lEctypeType;
        TraceUtil.Log("收到副本初始信息");
        return(CommandCallbackType.Continue);
    }
Esempio n. 9
0
        void Init(object obj)
        {
            GameDataManager.Instance.dataEvent.RemoveEventHandel(DataType.InitializeEctype, Init);
            SMSGEctypeInitialize_SC sMSGEctypeInitialize_SC = (SMSGEctypeInitialize_SC)GameDataManager.Instance.PeekData(DataType.InitializeEctype);

            int[] skillEnable = EctypeConfigManager.Instance.EctypeContainerConfigList[sMSGEctypeInitialize_SC.dwEctypeContainerId].PowerSkillHide;
            m_spcialSkill = new SpecialSkill[skillEnable.Length];
            for (int i = 0; i < m_spcialSkill.Length; i++)
            {
                m_spcialSkill[i].SkillEnable = skillEnable[i];
            }
            SetSpecialSkillData();
            StartCoroutine("InitLater");
            UpdateSpecialStatus(null);
        }
Esempio n. 10
0
    void Init(object obj)
    {
        GameDataManager.Instance.dataEvent.RemoveEventHandel(DataType.InitializeEctype, Init);
        SMSGEctypeInitialize_SC sMSGEctypeInitialize_SC = (SMSGEctypeInitialize_SC)GameDataManager.Instance.PeekData(DataType.InitializeEctype);

        m_ectypeData    = EctypeConfigManager.Instance.EctypeContainerConfigList[sMSGEctypeInitialize_SC.dwEctypeContainerId];
        ISDefenceEctype = m_ectypeData.lEctypeType == 8;         //防守副本
        if (ISDefenceEctype)
        {
            LoadSceneData loadSceneData = GameDataManager.Instance.PeekData(DataType.LoadingSceneData) as LoadSceneData;
            var           LoadSceneInfo = (SMsgActionNewWorld_SC)loadSceneData.LoadSceneInfo;
            if (m_ectypeData.vectMapID.Split('+')[0] == LoadSceneInfo.dwMapId.ToString())
            {
                StartCoroutine(ShowDefenceEctypeIcon("Sound_UIEff_DefenceUpTips", 1, 3));
            }
        }
    }
Esempio n. 11
0
        void Init(object obj)
        {
            GameDataManager.Instance.dataEvent.RemoveEventHandel(DataType.InitializeEctype, Init);
            SMSGEctypeInitialize_SC sMSGEctypeInitialize_SC = (SMSGEctypeInitialize_SC)GameDataManager.Instance.PeekData(DataType.InitializeEctype);
            EctypeContainerData     ectypeData = EctypeConfigManager.Instance.EctypeContainerConfigList[sMSGEctypeInitialize_SC.dwEctypeContainerId];

            if (ectypeData.MapType == 5)
            {
                gameObject.SetActive(false);
            }
            else
            {
                GameObject creatBtn = CreatObjectToNGUI.InstantiateObj(ButtonPrefab, BattleUIManager.Instance.BottomRight);
                creatBtn.transform.localPosition = GameManager.Instance.UseJoyStick ? joyStickCreateBtnPos : vCreateBtnPos;
                medicine = creatBtn.GetComponent <HealthAndMagicButton>();
            }
        }
Esempio n. 12
0
    void InitReadEctypeType(object obj)
    {
        GameDataManager.Instance.dataEvent.RemoveEventHandel(DataType.InitializeEctype, InitReadEctypeType);
        SMSGEctypeInitialize_SC sMSGEctypeInitialize_SC = (SMSGEctypeInitialize_SC)GameDataManager.Instance.PeekData(DataType.InitializeEctype);
        EctypeContainerData     m_ectypeData            = EctypeConfigManager.Instance.EctypeContainerConfigList[sMSGEctypeInitialize_SC.dwEctypeContainerId];

        isOpenEndLess = m_ectypeData.lEctypeType == 10;         //防守副本
        if (m_ectypeData.lEctypeType == 10)
        {
            isOpenEndLess = true;
            Init();
        }
        else
        {
            isOpenEndLess = false;
        }
    }
Esempio n. 13
0
        void SetButtonStatus(UI.MainUI.ItemFielInfo ItemFileInfo, BattleButton Button)
        {
            if (Button == null)
            {
                return;
            }
            Button.RecoveSprite.fillAmount = 0;
//            if (ItemFileInfo == null)
//            {
//                Button.SetCallBackFuntion(null,null);
//                Button.SetButtonIcon(null);
//                Button.SetButtonText("");
//                Button.gameObject.SetActive(false);
//            }else
//            {
//                if (Button.gameObject.active == false)
//                {
//                    Button.gameObject.SetActive(true);
//                }
//                Button.SetCallBackFuntion(OnButtonClick, ItemFileInfo);
//                Button.SetButtonIcon(GameManager.Instance.UseJoyStick ? ItemFileInfo.LocalItemData.lDisplayIdRound : ItemFileInfo.LocalItemData._picPrefab);
//                //int ItemNumber = UI.MainUI.ContainerInfomanager.Instance.GetItemNumber(ItemFileInfo.LocalItemData._goodID);
//                int ItemNumber = ItemFileInfo.sSyncContainerGoods_SC.byNum;
//                if (ItemNumber > 99) { ItemNumber = 99; }
//                Button.SetButtonText(ItemNumber.ToString());
//            }

            //new
            if (Button.gameObject.active == false)
            {
                Button.gameObject.SetActive(true);
            }
            Button.SetCallBackFuntion(OnButtonClick, ItemFileInfo);

            UpdateUseMedicamentHandle(null);
            int vipLevel = PlayerManager.Instance.FindHeroDataModel().GetCommonValue().PLAYER_FIELD_VISIBLE_VIP;
            SMSGEctypeInitialize_SC sMSGEctypeInitialize_SC = (SMSGEctypeInitialize_SC)GameDataManager.Instance.PeekData(DataType.InitializeEctype);
            EctypeContainerData     ectypeData = EctypeConfigManager.Instance.EctypeContainerConfigList[sMSGEctypeInitialize_SC.dwEctypeContainerId];
            int goodsID  = ectypeData.MedicamentIDs.SingleOrDefault(p => p.VipLevel == vipLevel).GoodsID;
            var itemData = ItemDataManager.Instance.GetItemData(goodsID);

            Button.SetButtonIcon(GameManager.Instance.UseJoyStick ? itemData.lDisplayIdRound : itemData._picPrefab);
//			int ItemNumber = ectypeData.FreeMedicaments.SingleOrDefault(p=>p.VipLevel == vipLevel).Num - sMSGEctypeInitialize_SC.dwMedicamentTimes;
//			Button.SetButtonText(ItemNumber.ToString());
        }
Esempio n. 14
0
    private void ResetSirenSkill()
    {
        var peekData = GameDataManager.Instance.PeekData(DataType.InitializeEctype);

        if (peekData == null)
        {
            TraceUtil.Log(SystemModel.Common, TraceLevel.Error, "DataType.InitializeEctype is null");
            return;
        }
        SMSGEctypeInitialize_SC ectypeSmg  = (SMSGEctypeInitialize_SC)peekData;
        EctypeContainerData     ectypeData = null;

        if (EctypeConfigManager.Instance.EctypeContainerConfigList.ContainsKey((int)ectypeSmg.dwEctypeContainerId))
        {
            ectypeData = EctypeConfigManager.Instance.EctypeContainerConfigList[(int)ectypeSmg.dwEctypeContainerId];
        }
        m_CurEctypeSirenSkillTime = ectypeData.SirenSkillVaule;
    }
Esempio n. 15
0
        public void Show(SMSGEctypeSettleAccounts sMSGEctypeSettleAccounts, BattleSettlementPanel_V3 myParent)
        {
            SMSGEctypeInitialize_SC sMSGEctypeInitialize_SC = (SMSGEctypeInitialize_SC)GameDataManager.Instance.PeekData(DataType.InitializeEctype);

            MyEctypeData    = EctypeConfigManager.Instance.EctypeContainerConfigList[sMSGEctypeInitialize_SC.dwEctypeContainerId];
            UpPanel.alpha   = 0;
            DownPanel.alpha = 0;
            this.sMSGEctypeSettleAccounts = sMSGEctypeSettleAccounts;
            this.MyParent = myParent;
            var playerData = PlayerManager.Instance.FindHeroDataModel();
            int vocation   = playerData.PlayerValues.PlayerCommonValue.PLAYER_FIELD_VISIBLE_VOCATION;

            //RoleIcon.ChangeSprite(vocation);
            ProfesionIcon.ChangeSprite(vocation);
            NameLabel.SetText(playerData.Name);
            TweenMovePanel();
            UpdateHeroIcon();
        }
Esempio n. 16
0
        void InitTreasureChests()
        {
            SMSGEctypeInitialize_SC sMSGEctypeInitialize_SC = (SMSGEctypeInitialize_SC)GameDataManager.Instance.PeekData(DataType.InitializeEctype);
            var ectypeData = EctypeConfigManager.Instance.EctypeContainerConfigList[sMSGEctypeInitialize_SC.dwEctypeContainerId];

            CostIcon.ChangeSprite(ectypeData.ByCostType + 1);
            if (rewardData != null && rewardData.IsHero)
            {
                CostLabel.SetButtonText(ectypeData.ByCost.ToString());
            }
            else
            {
                CostLabel.gameObject.SetActive(false);
            }
            CostMoneyType = ectypeData.ByCostType;
            CostMoney     = ectypeData.ByCost;
            TreasureChestCloseStatusOBj.SetActive(true);
            TreasureChestOpenStatusOBj.SetActive(false);
        }
Esempio n. 17
0
    public void UpdateProp(int actorID, int index, int value)
    {
        if (actorID == PlayerManager.Instance.FindHeroDataModel().ActorID)
        {
            m_curEctypeProps = m_curEctypeProps.SetValue(index, value);
            switch ((SMSGEctypeInitialize_SC.EctypeMemberFields)index)
            {
            case SMSGEctypeInitialize_SC.EctypeMemberFields.ECTYPE_MEMBER_FIELD_YAONVSKILLTIMES:
                UIEventManager.Instance.TriggerUIEvent(UIEventType.EctypeSirenSkillPropUpdate, null);
                break;

            case SMSGEctypeInitialize_SC.EctypeMemberFields.ECTYPE_MEMBER_FIELD_MEDICAMENTTIMES:
                UIEventManager.Instance.TriggerUIEvent(UIEventType.EctypeMedicamentPropUpdate, null);
                break;

            case SMSGEctypeInitialize_SC.EctypeMemberFields.ECTYPE_MEMBER_FIELD_RELIVETIMES:
                UIEventManager.Instance.TriggerUIEvent(UIEventType.EctypeRelivePropUpdate, null);
                break;
            }
        }
        else
        {
            if (!m_teammateEctypeInitializeDict.ContainsKey(actorID))
            {
                m_teammateEctypeInitializeDict.Add(actorID, new TeammateEctypeInitialize()
                {
                    teammateActorID = actorID,
                    reliveTimes     = value,
                });
            }
            else
            {
                m_teammateEctypeInitializeDict[actorID] = new TeammateEctypeInitialize()
                {
                    teammateActorID = actorID,
                    reliveTimes     = value,
                };
            }
        }
    }
Esempio n. 18
0
        void EctypeFinishHandle(INotifyArgs arg)
        {
            var sMsgActionDie_SC = (SMSGECTYPE_FINISH_SC)arg;
            SMSGEctypeInitialize_SC sMSGEctypeInitialize_SC = (SMSGEctypeInitialize_SC)GameDataManager.Instance.PeekData(DataType.InitializeEctype);

            m_ectypeData = EctypeConfigManager.Instance.EctypeContainerConfigList[sMSGEctypeInitialize_SC.dwEctypeContainerId];
            if (m_ectypeData.lEctypeType == 9)
            {
                //成功
                if (sMsgActionDie_SC.bySucess == 1)
                {
                    Debug.Log("CrusadeSettlementManager StartTimeScale");
                    TraceUtil.Log(SystemModel.Lee, "开始慢镜头:" + Time.time);
                    //StartCoroutine("StartTimeScale");
                    StartCoroutine(StartTimeScale(0));
                }
                else
                {
                    ShowFailEff();
                }
            }
        }
Esempio n. 19
0
        void EctypeFinishHandle(INotifyArgs arg)
        {
            var sMsgActionDie_SC = (SMSGECTYPE_FINISH_SC)arg;
            SMSGEctypeInitialize_SC sMSGEctypeInitialize_SC = (SMSGEctypeInitialize_SC)GameDataManager.Instance.PeekData(DataType.InitializeEctype);

            m_ectypeData = EctypeConfigManager.Instance.EctypeContainerConfigList[sMSGEctypeInitialize_SC.dwEctypeContainerId];
            if (m_ectypeData.lEctypeType == 0)
            {
                //成功
                if (sMsgActionDie_SC.bySucess == 1)
                {
                    //Debug.LogWarning("开始慢镜头:" + Time.time);
                    StartCoroutine(StartTimeScale(0));
                }
                else
                {
                    ShowFaildEff();
                }
            }

            //自动拾取
            StartCoroutine(AllPickUpDelay(m_ectypeData.PickupDelay - 3f));
        }
Esempio n. 20
0
        void Init(object obj)
        {
            GameDataManager.Instance.dataEvent.RemoveEventHandel(DataType.InitializeEctype, Init);
            SMSGEctypeInitialize_SC sMSGEctypeInitialize_SC = (SMSGEctypeInitialize_SC)GameDataManager.Instance.PeekData(DataType.InitializeEctype);
            EctypeContainerData     ectypeData = EctypeConfigManager.Instance.EctypeContainerConfigList[sMSGEctypeInitialize_SC.dwEctypeContainerId];

            ISTrialsEctype = ectypeData.MapType == 5;
            if (ectypeData.MapType != 5)
            {
                ProgressLabel.gameObject.SetActive(false);
                return;
            }
            ProgressLabel.gameObject.SetActive(true);
            ProgressLabel.SetButtonText("1");
            LoadSceneData loadSceneData = GameDataManager.Instance.PeekData(DataType.LoadingSceneData) as LoadSceneData;
            var           LoadSceneInfo = (SMsgActionNewWorld_SC)loadSceneData.LoadSceneInfo;

            //var TrialsSceneList = EctypeConfigManager.Instance.EctypeContainerConfigFile.ectypeContainerDataList.Where(P => P.MapType == 5).ToArray();
            if (ectypeData.vectMapID.Split('+')[0] == LoadSceneInfo.dwMapId.ToString())
            {
                //IsFrstTrialsEctype = true;
                StartCoroutine(ShowTrialsEctypeIcon(2));
            }
        }
Esempio n. 21
0
        public void Init(TreasureChestsType chestsType, SingleRewardPanel_V4 myParent, bool isHero)
        {
            SMSGEctypeInitialize_SC sMSGEctypeInitialize_SC = (SMSGEctypeInitialize_SC)GameDataManager.Instance.PeekData(DataType.InitializeEctype);

            EctypeData   = EctypeConfigManager.Instance.EctypeContainerConfigList [sMSGEctypeInitialize_SC.dwEctypeContainerId];
            IsHero       = isHero;
            MyParent     = myParent;
            MyChestsType = chestsType;
            string costFormat = LanguageTextManager.GetString("IDS_I4_21");
            string costText   = string.Format(costFormat, EctypeData.ByCost.ToString());
            bool   canPay     = false;

            switch (EctypeData.ByCostType)
            {
            case 0:    //元宝
                int PayGoldMoney = PlayerManager.Instance.FindHeroDataModel().PlayerValues.PLAYER_FIELD_BINDPAY;
                canPay = PayGoldMoney >= EctypeData.ByCost;
                break;

            case 1:    //铜币
                int PayCopperMoney = PlayerManager.Instance.FindHeroDataModel().PlayerValues.PLAYER_FIELD_HOLDMONEY;
                canPay = PayCopperMoney >= EctypeData.ByCost;
                break;
            }


            switch (chestsType)
            {
            case TreasureChestsType.Normal:
                CreatTreasureChestEffectPoint.ClearChild();
                //CreatTreasureChestEffectPoint.InstantiateNGUIObj(NormalBoxEffect);
                CostLabel.gameObject.SetActive(false);
                break;

            case TreasureChestsType.CostMoney:
                CostLabel.gameObject.SetActive(isHero);
                CostLabel.spriteSwith.ChangeSprite(2 - EctypeData.ByCostType);
                //CreatTreasureChestEffectPoint.InstantiateNGUIObj(NormalBoxEffect);
                CostLabel.SetButtonText(costText);
                if (canPay)
                {
                    CostLabel.SetTextColor(Color.white);
                }
                else
                {
                    CostLabel.SetTextColor(Color.red);
                }

                break;

            case TreasureChestsType.VIP:
                CreatTreasureChestEffectPoint.ClearChild();
                if (isHero && PlayerDataManager.Instance.GetPlayerVIPLevel() < 5)
                {
                    VIPBoxEffect.SetActive(true);
                }
                else
                {
                    VIPBoxEffect.SetActive(false);
                }
//					if(isHero && PlayerDataManager.Instance.GetMainEctypeRewardTimes() < 5)
//                    {
//                        //vipLabel.SetText(string.Format(LanguageTextManager.GetString("IDS_I21_2"), PlayerDataManager.Instance.GetMainEctypeVIPRewardMinLevel()));
//                    }
//					else
//					{
//						VIPBoxEffect.SetActive(false);
//						//CreatTreasureChestEffectPoint.InstantiateNGUIObj(NormalBoxEffect);
//					}
                CostLabel.gameObject.SetActive(isHero);
                CostLabel.spriteSwith.ChangeSprite(2 - EctypeData.ByCostType);
                CostLabel.SetButtonText(costText);
                if (canPay)
                {
                    CostLabel.SetTextColor(Color.white);
                }
                else
                {
                    CostLabel.SetTextColor(Color.red);
                }
                break;
            }
        }
Esempio n. 22
0
    private void CreateMonster(IEntityDataStruct entityDataStruct)
    {
        EntityModel monsterDataModel = MonsterManager.Instance.GetEntityMode(entityDataStruct.SMsg_Header.uidEntity);

        if (monsterDataModel == null)
        {
            Debug.LogError("monster uid : " + entityDataStruct.SMsg_Header.uidEntity.ToString() + " cant find");
        }
        var sMsgPropCreateEntity_SC_Monster = (SMsgPropCreateEntity_SC_Monster)monsterDataModel.EntityDataStruct;

        int monsterId = sMsgPropCreateEntity_SC_Monster.BaseObjectValues.OBJECT_FIELD_ENTRY_ID;
        //TraceUtil.Log("==>创建怪物ID: " + monsterId);
        var monsterData = BattleConfigManager.Instance.GetMonsterData(monsterId);

        if (monsterData == null)
        {
            Debug.LogWarning("找不到怪物配置");
            return;
        }
        var pos = Vector3.zero;

        pos = pos.GetFromServer(sMsgPropCreateEntity_SC_Monster.MonsterX, sMsgPropCreateEntity_SC_Monster.MonsterY);
        GameObject monsterPrefab = MapResManager.Instance.GetMapMonsterPrefab(monsterId);
        float      angle         = sMsgPropCreateEntity_SC_Monster.MonsterUnitValues.UNIT_FIELD_DIR / 1000f + 90;
        var        monster       = (GameObject)GameObject.Instantiate(monsterPrefab, pos, Quaternion.Euler(0, angle, 0));

        #region edit by lee

        var monsterBehaviour = monster.GetComponent <MonsterBehaviour>();

        if (monsterBehaviour == null)
        {
            Debug.LogWarning("怪物" + monsterId.ToString() + "未挂载脚本");
            monsterBehaviour = monster.AddComponent <MonsterBehaviour>();
        }

        //cache hurt point
        monsterBehaviour.CacheHurtPoint();
        //怪物生成特效
        if (monsterData._bornEffects != "0")
        {
            GameObject bornEffectPrefab = MapResManager.Instance.GetMapEffectPrefab(monsterData._bornEffects);
            if (bornEffectPrefab != null)
            {
                GameObject bornEffect = GameObjectPool.Instance.AcquireLocal(bornEffectPrefab, Vector3.zero, bornEffectPrefab.transform.rotation);
                bornEffect.AddComponent <DestroySelf>();
                bornEffect.transform.position = monster.transform.position;
            }
        }
        //怪物对白
        if (false == BattleManager.Instance.IsHeroFirstDead)
        {
//            if (monsterData._dialogPortrait != "0")
//            {
//                var resData = MapResManager.Instance.GetMapEffectPrefab(monsterData._dialogPortrait);
//                if (resData != null)
//                {
//                    GameObject IconPrefab = CreatObjectToNGUI.InstantiateObj(MonsterDialogPrefab, BattleUIManager.Instance.GetScreenTransform(ScreenPositionType.Center));
//                    IconPrefab.transform.localPosition = new Vector3(-240, 160, 10);//避免和任务指引面板重叠
//                    SirenDialogEctypeBehaviour sirenDialogEctypeBehaviour = IconPrefab.GetComponent<SirenDialogEctypeBehaviour>();
//
//                    sirenDialogEctypeBehaviour.Init(resData, LanguageTextManager.GetString(monsterData._bornDialogue), LanguageTextManager.GetString(monsterData._dialogMonsterName));
//                    if (monsterData._bornSound != "0")
//                    {
//                        SoundManager.Instance.PlaySoundEffect(monsterData._bornSound);
//                    }
//                    IconPrefab.AddComponent<DestroySelf>();
//                }
//            }
            if (monsterData._BornDialogueFulls[0].Portrait != "0")
            {
                GameObject IconPrefab = CreatObjectToNGUI.InstantiateObj(MonsterDialogPrefab, BattleUIManager.Instance.GetScreenTransform(ScreenPositionType.Center));
                SirenDialogEctypeBehaviour sirenDialogEctypeBehaviour = IconPrefab.GetComponent <SirenDialogEctypeBehaviour>();
                sirenDialogEctypeBehaviour.Init(MonsterDialogPrefab, monsterData._BornDialogueFulls);
                if (monsterData._bornSound != "0")
                {
                    SoundManager.Instance.PlaySoundEffect(monsterData._bornSound);
                }
            }
        }

        //特殊镜头
        if (monsterData._cameraFix_pos != Vector3.zero)
        {
            //BattleManager.Instance.FollowCamera.SetFixed(monsterData._cameraFix_pos, monsterData._cameraFix_time);
            BattleManager.Instance.FollowCamera.BeginMoveToPosAndGoBack(monsterData._cameraFix_pos, monsterData._cameraFix_time, monsterData._cameraStay_time, monsterData._cameraBack_time, monsterData._blockPlayerToIdle);
        }

        #endregion


        //TypeID type;
        //EntityModel monsterDataModel = monsterBehaviour.EntityModel = EntityController.Instance.GetEntityModel( entityDataStruct.SMsg_Header.uidEntity, out type);
        //monsterBehaviour.EntityModel.GO = monsterBehaviour.gameObject;
        //monsterBehaviour.EntityModel.Behaviour = monsterBehaviour;


        monsterDataModel.GO        = monster;
        monsterDataModel.Behaviour = monsterBehaviour;
        //monsterDataModel.EntityDataStruct = sMsgPropCreateEntity_SC_Monster;

        monsterBehaviour.EntityModel = monsterDataModel;
        monsterBehaviour.SetMonsterConfigData(monsterData);

        monsterBehaviour.InitFSM();
        //MonsterManager.Instance.Init();

        //出生是否隐藏
        if (sMsgPropCreateEntity_SC_Monster.MonsterValues.MONSTER_FIELD_ISSHOW == 0)
        {
            SetCildLayer(monsterDataModel.GO.transform, 21);           //21=hide
        }

        //血条
        Transform bloodBarMP;
        monster.transform.RecursiveFindObject("BloodBarMP", out bloodBarMP);
        if (null != bloodBarMP)
        {
            GameObject bloodBarPrefab = null;
            switch (sMsgPropCreateEntity_SC_Monster.MonsterValues.MONSTER_FIELD_TYPE)
            {
            case 0:
                bloodBarPrefab = MonsterFactory.Instance.BloobBarPrefab_normal;
                break;

            case 1:
                bloodBarPrefab = MonsterFactory.Instance.BloobBarPrefab;
                break;

            case 2:
                bloodBarPrefab = MonsterFactory.Instance.BloobBarPrefab_boss;
                break;

            case 3:
                bloodBarPrefab = MonsterFactory.Instance.BloobBarPrefab_normal;
                break;

            default:
                break;
            }
            if (bloodBarPrefab != null)
            {
                BloodBarManager.Instance.AttachBarToTarget(sMsgPropCreateEntity_SC_Monster.SMsg_Header.uidEntity, bloodBarMP, bloodBarPrefab);
            }
        }
        //发UI事件,参数 EntityModel
        UIEventManager.Instance.TriggerUIEvent(UIEventType.CreatMoster, monsterData);

        //如果是boss,激活boss状态栏
        if (MonsterManager.Instance.IsMonsterBossType(monsterId))
        {
            if (DefencePanel.Instance.ISDefenceEctype)
            {
                DefencePanel.Instance.DefenceBossCreate(monsterDataModel);
            }
            else
            {
                if (!MonsterManager.Instance.IsBossStatusPanelInit())
                {
                    GameObject bossStatusPanel = (GameObject)Instantiate(BossStatusPanelPrefab);
                    //bossStatusPanel.transform.parent = PopupObjManager.Instance.UICamera.transform;
                    bossStatusPanel.transform.parent        = UI.Battle.BattleUIManager.Instance.GetScreenTransform(UI.Battle.ScreenPositionType.TopRight);
                    bossStatusPanel.transform.localPosition = Vector3.zero;
                    bossStatusPanel.transform.localScale    = Vector3.one;
                    //赋值
                    BossStatusPanel_V3 bossStatusPanelScript = bossStatusPanel.GetComponent <BossStatusPanel_V3>();
                    MonsterManager.Instance.SetBossStatusPanel(bossStatusPanelScript);

                    bossStatusPanelScript.SetBloodNum(monsterDataModel);
                }
                else
                {
                    //第二个boss
                    GameObject secondBossStatusPanel = (GameObject)Instantiate(BattleResManager.Instance.SecondBossStatusPanelPrefab);
                    secondBossStatusPanel.transform.parent        = UI.Battle.BattleUIManager.Instance.GetScreenTransform(UI.Battle.ScreenPositionType.TopRight);
                    secondBossStatusPanel.transform.localPosition = Vector3.zero;
                    secondBossStatusPanel.transform.localScale    = Vector3.one;
                    BossStatusPanel_V3 secondBossPanelScript = secondBossStatusPanel.GetComponent <BossStatusPanel_V3>();
                    secondBossPanelScript.SetBloodNum(monsterDataModel);
                    MonsterManager.Instance.IsDoubleBoss = true;
                    //BossStatusPanel_V3 bossStatusPanelScript = MonsterManager.Instance.GetBossStatusPanel();
                    //bossStatusPanelScript.SetDataModel(monsterDataModel);
                }
                //bossStatusPanelScript.SetBloodNum();
            }
            //如果是普通副本,boss出场,播特效//
            SMSGEctypeInitialize_SC sMSGEctypeInitialize_SC = (SMSGEctypeInitialize_SC)GameDataManager.Instance.PeekData(DataType.InitializeEctype);
            EctypeContainerData     m_ectypeData            = EctypeConfigManager.Instance.EctypeContainerConfigList[sMSGEctypeInitialize_SC.dwEctypeContainerId];
            if (m_ectypeData.lEctypeType == 0 || m_ectypeData.lEctypeType == 9)
            {
                UIEventManager.Instance.TriggerUIEvent(UIEventType.OnBossShowEvent, null);
                SoundManager.Instance.PlaySoundEffect("Sound_UIEff_BossAppear");
            }
        }
        else
        {
            //加入箭头挂载脚本
#if !UNITY_EDITOR
            if (sMsgPropCreateEntity_SC_Monster.MonsterUnitValues.UNIT_FIELD_FIGHT_HOSTILITY !=
                PlayerManager.Instance.FindHeroDataModel().UnitValues.sMsgPropCreateEntity_SC_UnitVisibleValue.UNIT_FIELD_FIGHT_HOSTILITY)
            {
                if (monster.GetComponent <MonsterBehaviour>().m_MonsterConfigData._isShowGuideArrow == 1)
                {
                    ArrowManager.Instance.AddMonsterArrowt(monster);
                }
            }
#endif
        }
        //jamfing//
        //if(DefencePanel.Instance.ISDefenceEctype)
        {
            DefencePanel.Instance.DefenceMonsterCreated(monsterDataModel, monsterData);
        }
        //EntityController.Instance.RegisteEntity(entityDataStruct.SMsg_Header.uidEntity, monsterDataModel);
    }
Esempio n. 23
0
 public void Set(SMSGEctypeInitialize_SC sMSGEctypeInitialize_SC)
 {
     m_curEctypeProps = sMSGEctypeInitialize_SC;
 }
Esempio n. 24
0
    public void SetBloodNum(EntityModel bossModel)
    {
        if (!m_isInit)
        {
            m_isInit = true;

            m_BossModelDic.Clear();
            m_BossModelDic.Add(bossModel.EntityDataStruct.SMsg_Header.uidEntity, bossModel);

            m_BossUID = bossModel.EntityDataStruct.SMsg_Header.uidEntity;
            int bossID = ((SMsgPropCreateEntity_SC_Monster)bossModel.EntityDataStruct).BaseObjectValues.OBJECT_FIELD_ENTRY_ID;

            //m_BossModel = bossModel;
            var peekData = GameDataManager.Instance.PeekData(DataType.InitializeEctype);
            if (peekData == null)
            {
                TraceUtil.Log(SystemModel.Common, TraceLevel.Error, "DataType.InitializeEctype is null");
                return;
            }
            SMSGEctypeInitialize_SC ectypeSmg = (SMSGEctypeInitialize_SC)peekData;
            EctypeContainerData     ectypeData;
            if (EctypeConfigManager.Instance.EctypeContainerConfigList.ContainsKey((int)ectypeSmg.dwEctypeContainerId))
            {
                ectypeData = EctypeConfigManager.Instance.EctypeContainerConfigList[(int)ectypeSmg.dwEctypeContainerId];
            }
            else
            {
                return;
            }
            //BossHeadSprite.spriteName = ectypeData.BossHead; //boss头像
            //头像替换为prefab
            EctypeContainerResData     ectypeResData = EctypeResDataManager.Instance.GetEctypeContainerResData(ectypeData.lEctypeContainerID);
            EctypeContainerBossHeadRes headRes       = ectypeResData.BossHeadReses.SingleOrDefault(p => p.BossHeadID == bossID);
            if (ectypeResData != null && headRes != null)
            {
                Vector3    scale   = headRes.BossHeadGO.transform.localScale;
                GameObject headObj = (GameObject)Instantiate(headRes.BossHeadGO);
                headObj.transform.parent        = BossHeadPoint;
                headObj.transform.localPosition = Vector3.zero;
                headObj.transform.localScale    = scale;
            }

            int bossLifeLayer = ectypeData.BossLifeLayer;
            int MaxBloodValue = 0;
            var monsterData   = BattleConfigManager.Instance.GetMonsterData(bossID);
            if (monsterData != null)
            {
                MaxBloodValue = monsterData._maxHP;
            }
//			ectypeData.BossIDs.ApplyAllItem(p=>
//			                                {
//				var monsterData = BattleConfigManager.Instance.GetMonsterData(p);
//				if (monsterData != null)
//				{
//					MaxBloodValue += monsterData._maxHP;
//				}
//			});
            m_BloodsNum = bossLifeLayer;
            int allNum = UI_Bloods.Length;

            this.m_maxBloodValue = MaxBloodValue;
            m_OneBloodValue      = MaxBloodValue * 1f / bossLifeLayer;


            //new
            m_previousHealth = MaxBloodValue;


            if (bossLifeLayer >= allNum)
            {
                return;
            }

            for (int i = bossLifeLayer; i < allNum; i++)
            {
                UI_Bloods[i].enabled = false;
            }

            this.UpdateBloodValue();
            //TraceUtil.Log("SetBloodNum(EntityModel bossModel,int bossLifeLayer, int MaxBloodValue)");
        }
        //TraceUtil.Log("当前血槽序号 : " + m_currentBloodNo);
    }
Esempio n. 25
0
    public void SetBloodNum(EntityModel bossModel)
    {
        if (!m_isInit)
        {
            m_isInit = true;

            m_BossModelDic.Clear();
            m_BossModelDic.Add(bossModel.EntityDataStruct.SMsg_Header.uidEntity, bossModel);

            //m_BossModel = bossModel;
            var peekData = GameDataManager.Instance.PeekData(DataType.InitializeEctype);
            if (peekData == null)
            {
                TraceUtil.Log(SystemModel.Common, TraceLevel.Error, "DataType.InitializeEctype is null");
                return;
            }
            SMSGEctypeInitialize_SC ectypeSmg = (SMSGEctypeInitialize_SC)peekData;
            EctypeContainerData     ectypeData;
            if (EctypeConfigManager.Instance.EctypeContainerConfigList.ContainsKey((int)ectypeSmg.dwEctypeContainerId))
            {
                ectypeData = EctypeConfigManager.Instance.EctypeContainerConfigList[(int)ectypeSmg.dwEctypeContainerId];
            }
            else
            {
                return;
            }
            //BossHeadSprite.spriteName = ectypeData.BossHead; //boss头像
            //头像替换为prefab
            EctypeContainerResData ectypeResData = EctypeResDataManager.Instance.GetEctypeContainerResData(ectypeData.lEctypeContainerID);
            if (ectypeResData != null && ectypeResData.bossHead != null)
            {
                Vector3    scale   = ectypeResData.bossHead.transform.localScale;
                GameObject headObj = (GameObject)Instantiate(ectypeResData.bossHead);
                headObj.transform.parent        = BossHeadPoint;
                headObj.transform.localPosition = Vector3.zero;
                headObj.transform.localScale    = scale;
            }

            int bossLifeLayer = ectypeData.BossLifeLayer;
            int MaxBloodValue = 0;
            ectypeData.BossIDs.ApplyAllItem(p =>
            {
                var monsterData = BattleConfigManager.Instance.GetMonsterData(p);
                if (monsterData != null)
                {
                    MaxBloodValue += monsterData._maxHP;
                }
            });
            m_BloodsNum  = bossLifeLayer;
            m_BloodScale = Bloods[0].transform.localScale;
            int allNum = Bloods.Length;

            this.m_maxBloodValue = MaxBloodValue;
            m_OneBloodValue      = MaxBloodValue * 1f / bossLifeLayer;
            m_currentBloodNo     = bossLifeLayer - 1;
            Label_BloodNum.text  = (m_currentBloodNo + 1).ToString();
            m_bloodLightLength   = Vector3.Distance(BloodLightFullPoint.transform.position, BloodLightEmptyPoint.transform.position);

            if (bossLifeLayer >= allNum)
            {
                return;
            }

            for (int i = bossLifeLayer; i < allNum; i++)
            {
                Bloods[i].SetActive(false);
            }

            this.UpdateBloodValue();
            //TraceUtil.Log("SetBloodNum(EntityModel bossModel,int bossLifeLayer, int MaxBloodValue)");
        }
        //TraceUtil.Log("当前血槽序号 : " + m_currentBloodNo);
    }