示例#1
0
        /// <summary>
        /// 显示英雄列表
        /// </summary>
        /// <param name="type"></param>
        /// 要显示的英雄类型
        protected void ShowHeroList(HeroType type)
        {
            List <int> heros = MarketHeroListModel.Instance.GetHeroListTime(type);

            if (heros == null || heros.Count == 0)
            {
                return;
            }
            int index = 0;

            for (int i = 0; i < HeroTimeLimitList.Count; i++)
            {
                HeroCard mCard = HeroTimeLimitList[i];
                if (i >= heros.Count)
                {
                    mCard.mRoot.SetActive(false);
                    continue;
                }
                mCard.mRoot.SetActive(true);
                mCard.mGoodsId      = GetGoodsId(heros[i]);
                mCard.mGoodsIdChild = heros[i];
                DeltCardInfo(heros[i], mCard);
                index++;
            }
            mLeft.gameObject.SetActive(false);
            mRight.gameObject.SetActive(index > 3);
            GameMethod.ScrollViewTweenPosition(mScroll, 729f);
            FreshGridPosition();
        }
示例#2
0
        /// <summary>
        /// 锁定目标
        /// </summary>
        /// <param name="ItemList"></param>
        private void OnLockEnemySoldier()
        {
            GameObject     mGameObjectLock = mBtnArray[(int)ShortCutBarBtn.BTN_CHANGELOCK].gameObject;
            List <Ientity> itemList        = new List <Ientity>();

            if (GamePlayGuideModel.Instance.IsGuideTrigger(ButtonTriggerType.mTypeClick, mGameObjectLock))
            {
                itemList = GameMethod.GetMonsterEnemyItemListByRadius(PlayerManager.Instance.LocalPlayer, GameConstDefine.PlayerLockTargetDis);
            }
            else
            {
                itemList = GameMethod.GetSoldierEnemyItemListByRadius(PlayerManager.Instance.LocalPlayer, GameConstDefine.PlayerLockTargetDis);
            }

            if (itemList == null || itemList.Count == 0)
            {
                return;
            }
            if (mSyncLockSelIndex >= itemList.Count)
            {
                mSyncLockSelIndex = 0;
            }
            PlayerManager.Instance.LocalPlayer.SetSyncLockTarget(itemList[mSyncLockSelIndex]);
            mSyncLockSelIndex++;
        }
        void SubmitRegister()
        {
            if (IsFirstInput)
            {
                noPass.gameObject.SetActive(true);
                MsgInfoManager.Instance.ShowMsg((int)ERROR_TYPE.eT_FillInNiceName);
                return;
            }
            if (!CheckNameInput())
            {
                noPass.gameObject.SetActive(true);
                MsgInfoManager.Instance.ShowMsg((int)ERROR_TYPE.eT_FillInNiceName);
                return;
            }



            List <string> split   = GameMethod.GetSplit();
            string        currStr = nickNameInput.value;

            foreach (string item in split)
            {
                int currPos = currStr.IndexOf(item, StringComparison.OrdinalIgnoreCase);
                if (currPos > -1)
                {
                    MsgInfoManager.Instance.ShowMsg(-130861);
                    return;
                }
            }
            IGuideTaskManager.Instance().SendTaskEnd(EGameEvent.eGameEvent_UIGuideCommitRegisterEnd);

            byte[] bytes = Encoding.UTF8.GetBytes(nickNameInput.label.text);
            CGLCtrl_GameLogic.Instance.GameCompleteBaseInfo(SelectServerData.Instance.serverUin, bytes, Convert.ToInt32(spriteHead.spriteName), isBoy);
        }
示例#4
0
        void Save(ref bool saveState, string key, SystemSet systemSet)
        {
            mObjOn[(int)systemSet].SetActive(saveState);
            mObjOff[(int)systemSet].SetActive(!saveState);
            int state = saveState ? 1 : 0;

            PlayerPrefs.SetInt(key, state);

            switch (systemSet)
            {
            case SystemSet.SoundButton:
                AudioManager.Instance.EnableSound(saveState);
                break;

            case SystemSet.MusicButton:
                AudioManager.Instance.EnableVoice(saveState);
                break;

            case SystemSet.EffectButton:
                BattleInfoCtrl.Instance.SetEffect(saveState);
                break;

            case SystemSet.RangeButton:
                GameMethod.SetRange(saveState);
                break;
            }
        }
        /// <summary>
        /// 锁定目标
        /// </summary>
        /// <param name="ItemList"></param>
        private void OnLockEnemySoldier()
        {
            GameObject     mGameObjectLock = mBtnArray[(int)ShortCutBarBtn.BTN_CHANGELOCK].gameObject; //锁定按钮
            List <IEntity> itemList        = new List <IEntity>();                                     //目标锁定集合

            if (GamePlayGuideModel.Instance.IsGuideTrigger(ButtonTriggerType.mTypeClick, mGameObjectLock))
            {
                //根据距离排序所有敌对阵营的野怪集合
                itemList = GameMethod.GetMonsterEnemyItemListByRadius(PlayerManager.Instance.LocalPlayer, GameConstDefine.PlayerLockTargetDis);
            }
            else
            {
                //根据距离排序所有敌对阵营的小兵集合
                itemList = GameMethod.GetSoldierEnemyItemListByRadius(PlayerManager.Instance.LocalPlayer, GameConstDefine.PlayerLockTargetDis);
            }

            if (itemList == null || itemList.Count == 0)
            {
                return;
            }

            if (mSyncLockSelIndex >= itemList.Count)//当索引大于集合长度时,索引从0再次开始
            {
                mSyncLockSelIndex = 0;
            }

            PlayerManager.Instance.LocalPlayer.SetSyncLockTarget(itemList[mSyncLockSelIndex]); //设置索引对象
            mSyncLockSelIndex++;                                                               //当再次点击时,目标自动寻找集合中的下一个
        }
示例#6
0
        private void SureClickBtn(GameObject go)
        {
            if (string.Compare(mNewTemp.value.Trim(), "请输入要更换的昵称") == 0 || string.Compare(mNewTemp.value.Trim(), "输入新的昵称") == 0)
            {
                return;
            }
            if (mNewTemp == null || mNewTemp.value.Trim() == "" || string.IsNullOrEmpty(mNewTemp.value.Trim()))
            {
                MsgInfoManager.Instance.ShowMsg(-130977);
                return;
            }
            if (string.Compare(mNewTemp.value, GameUserModel.Instance.GameUserNick) == 0)
            {
                MsgInfoManager.Instance.ShowMsg(10032);
                return;
            }
            List <string> split   = GameMethod.GetSplit();
            string        currStr = mNewTemp.value;

            foreach (string item in split)
            {
                int currPos = currStr.IndexOf(item, StringComparison.OrdinalIgnoreCase);
                if (currPos > -1)
                {
                    MsgInfoManager.Instance.ShowMsg(-130861);
                    return;
                }
            }
            PresonInfoCtrl.Instance.ChangeNickName(mNewTemp.value);
            mNewTemp.value = "输入新的昵称";
        }
        public void InitTaskInfo(int taskId, int times, int mathches)
        {
            sTaskId   = taskId;
            sTimes    = times;
            sMathches = mathches;
            data      = ConfigReader.GetGuideHelpInfo(sTaskId);
            switch (taskId)
            {
            case 20001:    //cp enough to buy
                curCheckBase = new SecondaryTaskCpEnoughCheck();
                break;

            case 20002:    //hp less back to city
                curCheckBase = new SecondaryTaskHpLessCheck();
                break;

            case 20003:
                curCheckBase = new SecondaryTaskFullFuryCheck();
                break;

            case 20004:
                curCheckBase = new SecondaryTaskOpenShopCheck();
                break;

            default:
                GameMethod.DebugError("Secondary task not define");
                break;
            }
            if (curCheckBase != null)
            {
                curCheckBase.OnEnter(this);
            }
        }
        public void showHeroHead(List <int> headsBoyOrGirl)
        {
            GameObject   headPanel = mRoot.Find("Head/Panel").gameObject;
            const float  distance  = 175 * 4;
            UIGrid       mGrid     = headPanel.GetComponent <UIGrid>();
            UIScrollView mScroll   = mRoot.Find("Head").GetComponent <UIScrollView>();

            for (int i = 0; i < ConfigReader.HeadSelectXmlInfoDict.Count; i++)
            {
                Transform  headParent = headPanel.transform.Find("Head" + (i + 1).ToString());
                GameObject head       = headParent.gameObject;
                if (i >= headsBoyOrGirl.Count)
                {
                    head.SetActive(false);
                    continue;
                }
                head.SetActive(true);
                UISprite sp = headParent.transform.Find("Portrait/Sprite").GetComponent <UISprite>();
                sp.spriteName = ConfigReader.HeadSelectXmlInfoDict[headsBoyOrGirl[i]].HeroHeadAtlas_Num;
                ButtonOnPress toggle = headParent.GetComponent <ButtonOnPress>();
                headList.Add(toggle);
            }

            mGrid.enabled = true;
            mGrid.Reposition();
            mScroll.ResetPosition();
            GameMethod.ScrollViewTweenPosition(mScroll, distance);
        }
示例#9
0
        //发送聊天信息
        public void SendTalkMessage(string msg)
        {
            string currStr = GameMethod.GetSplitStr(msg);

            byte[] utf8Bytes = Encoding.UTF8.GetBytes(currStr);

            CGLCtrl_GameLogic.Instance.EmsgToss_AskSendRoomTalk((UInt32)utf8Bytes.Length * sizeof(byte), utf8Bytes);
        }
 void OnChangeAccount(int ie, bool isPress)
 {
     if (isPress)
     {
         return;
     }
     GameMethod.LogOutToLogin();
 }
示例#11
0
 public void SetHasTriggerTask(string taskId)// get has trigger task from server
 {
     triggerTaskIdList.Clear();
     if (!string.IsNullOrEmpty(taskId))
     {
         triggerTaskIdList = GameMethod.ResolveToIntList(taskId, ',');
     }
 }
示例#12
0
    private static AssemblyDefinition DumpAssembly(GameAssembly runtimeAssembly)
    {
        // Check stack
        if (assemblyDumper.IsOnStack(runtimeAssembly))
        {
            return((AssemblyDefinition)assemblyDumper.GrabFromStack(runtimeAssembly));
        }

        // Generate assembly file
        AssemblyDefinition assembly   = AssemblyDefinition.CreateAssembly(new AssemblyNameDefinition(runtimeAssembly.Name, new Version(3, 7, 1, 6)), runtimeAssembly.Name, ModuleKind.Dll);
        ModuleDefinition   mainModule = assembly.MainModule;

        // Add to stack
        assemblyDumper.PushToStack(runtimeAssembly, assembly);

        // Store dumped classes
        Dictionary <GameClass, TypeDefinition> dumpedClasses = new Dictionary <GameClass, TypeDefinition>();

        // Get classes
        ClassDump classDumper = new ClassDump(runtimeAssembly);

        while (classDumper.HasNext())
        {
            // Get runtime class
            GameClass runtimeClass = classDumper.Next();
            if (runtimeClass == null)
            {
                continue;
            }

            // Dump
            dumpedClasses.Add(runtimeClass, DumpClass(classDumper, mainModule, runtimeClass));
        }

        // Populate classes
        foreach (GameClass runtimeClass in dumpedClasses.Keys)
        {
            // Dump methods
            MethodDump methodDumper = new MethodDump(runtimeClass);
            while (methodDumper.HasNext())
            {
                // Get method
                GameMethod runtimeMethod = methodDumper.Next();
                if (runtimeMethod == null)
                {
                    continue;
                }

                // Dump
                DumpMethod(methodDumper, dumpedClasses[runtimeClass], runtimeMethod);
            }
        }

        // End
        Logger.Log("Dumped assembly: " + runtimeAssembly.Name);
        assembly.Write("AtiRoNya\\Dumps\\" + runtimeAssembly.Name + ".dll");
        return(assembly);
    }
    public ReadMoveCameraConfig(string xmlFilePath)
    {
        ResourceItem xmlfileUnit = ResourcesManager.Instance.loadImmediate(xmlFilePath, ResourceType.ASSET);
        TextAsset    xmlfile     = xmlfileUnit.Asset as TextAsset;

        if (!xmlfile)
        {
            Debug.LogError(" error infos: 没有找到指定的xml文件:" + xmlFilePath);
        }

        xmlDoc = new XmlDocument();
        xmlDoc.LoadXml(xmlfile.text);

        XmlNodeList infoNodeList = xmlDoc.SelectSingleNode("CameraRemotion ").ChildNodes;

        for (int i = 0; i < infoNodeList.Count; i++)     //(XmlNode xNode in infoNodeList)
        {
            if ((infoNodeList[i] as XmlElement).GetAttributeNode("un32MapID") == null)
            {
                continue;
            }

            string tpName = (infoNodeList[i] as XmlElement).GetAttributeNode("un32MapID").InnerText;

            CameraRemotionConfigInfo cameraInfo = new CameraRemotionConfigInfo();
            cameraInfo.un32MapID = Convert.ToInt32(tpName);
            //NpcSelectInfo.NpcId = Convert.ToInt32(typeName);
            foreach (XmlElement xEle in infoNodeList[i].ChildNodes)
            {
                #region 搜索
                switch (xEle.Name)
                {
                case "LeftEdge":
                    cameraInfo.mLeftEdge = GameMethod.ResolveToVector3(xEle.InnerText);
                    break;

                case "RightEdge":
                    cameraInfo.mRightEdge = GameMethod.ResolveToVector3(xEle.InnerText);
                    break;

                case "TopEdge":
                    cameraInfo.mTopEdge = GameMethod.ResolveToVector3(xEle.InnerText);
                    break;

                case "BottomEdge":
                    cameraInfo.mBottomEdge = GameMethod.ResolveToVector3(xEle.InnerText);
                    break;

                case "MovementSpeed":
                    cameraInfo.mMovementSpeed = Convert.ToInt32(xEle.InnerText);
                    break;
                }
                #endregion
            }
            ConfigReader.cameraXmlInfoDict.Add(Convert.ToInt32(tpName), cameraInfo);
        }
    }
示例#14
0
        //播放特效
        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 ReadGuidePopTipTaskConfig(string xmlFilePath)
    {
        //TextAsset xmlfile = Resources.Load(xmlFilePath) as TextAsset;
        ResourceUnit xmlfileUnit = ResourcesManager.Instance.loadImmediate(xmlFilePath, ResourceType.ASSET);
        TextAsset    xmlfile     = xmlfileUnit.Asset as TextAsset;

        if (!xmlfile)
        {
            Debug.LogError(" error infos: 没有找到指定的xml文件:" + xmlFilePath);
        }

        xmlDoc = new XmlDocument();
        xmlDoc.LoadXml(xmlfile.text);

        XmlNodeList infoNodeList = xmlDoc.SelectSingleNode("PopWindow").ChildNodes;

        for (int i = 0; i < infoNodeList.Count; i++)     //(XmlNode xNode in infoNodeList)
        {
            if ((infoNodeList[i] as XmlElement).GetAttributeNode("id") == null)
            {
                continue;
            }

            string typeName = (infoNodeList[i] as XmlElement).GetAttributeNode("id").InnerText;

            PopTipskInfo info = new PopTipskInfo();
            info.TaskId = Convert.ToInt32(typeName);
            foreach (XmlElement xEle in infoNodeList[i].ChildNodes)
            {
                #region 搜索
                switch (xEle.Name)
                {
                case "content":
                    info.mTip = Convert.ToString(xEle.InnerText);
                    break;

                case "site":
                    info.mResPath = Convert.ToString(xEle.InnerText);
                    break;

                case "address":
                    info.mSitePos = GameMethod.ResolveToVector3(xEle.InnerText);
                    break;

                case "rate":
                    info.mRate = GameMethod.ResolveToVector3(xEle.InnerText);
                    break;

                case "mTime":
                    info.mTime = Convert.ToSingle(xEle.InnerText);
                    break;
                }
                #endregion
            }
            ConfigReader.guidePopTipTaskXmlDict.Add(info.TaskId, info);
        }
    }
示例#16
0
    // Update is called once per frame
    void Update()
    {
        if (isBombBase)
        {
            if (startTime == 0f)
            {
                startTime = Time.time;
            }
            if (move == transform.position && Time.time - startTime >= 1f)
            {
                Thanos.AudioManager.Instance.StopBgAudio();
                AudioSource soul = null;
                if (move == posDest)
                {
                    /*
                     * Animator ani = this.gameObject.GetComponent<Animator>();
                     * ani.enabled = true;
                     */
                    //soul = HolyTech.AudioManager.Instance.PlayEffectAudio(Resources.Load(AudioDefine.PATH_GAME_OVER_FAILE) as AudioClip);

                    ResourceItem clipUnit = ResourcesManager.Instance.loadImmediate(AudioDefine.PATH_GAME_OVER_FAILE, ResourceType.ASSET);
                    AudioClip    clip     = clipUnit.Asset as AudioClip;

                    soul = Thanos.AudioManager.Instance.PlayEffectAudio(clip);
                }
                else
                {
                    //soul = HolyTech.AudioManager.Instance.PlayEffectAudio(Resources.Load(AudioDefine.PATH_GAME_OVER_VICTORY) as AudioClip);

                    ResourceItem clipUnit = ResourcesManager.Instance.loadImmediate(AudioDefine.PATH_GAME_OVER_VICTORY, ResourceType.ASSET);
                    AudioClip    clip     = clipUnit.Asset as AudioClip;

                    soul = Thanos.AudioManager.Instance.PlayEffectAudio(clip);
                }
                isBombBase = false;
                if (StartEffectEvent != null)
                {
                    StartEffectEvent(4f);
                }

                if (Entity != null)
                {
                    GameMethod.SetLoadJianTaBaoZha(Entity, false);

                    Entity.OnEnterDead();
                }

                return;
            }
            float time = Vector3.Distance(Camera.main.transform.position, move) / 60f;
            Camera.main.transform.position = Vector3.SmoothDamp(Camera.main.transform.position, move, ref res, time);

            GameMethod.GetMainCamera.RefreshFrustumPlanes();
            //Camera.main.transform.position = Vector3.Lerp(Camera.main.transform.position, move,Time.deltaTime * time);
        }
    }
示例#17
0
        private void SdkLogOff()
        {
            GameMethod.LogOutToLogin();

            LoadingState lState = GameStateManager.Instance.getState(GameStateTypeEnum.Loading) as LoadingState;

            lState.SetNextState(GameStateTypeEnum.Login);
            lState.SetFrontScenes(View.EScenesType.EST_Play);
            SetStateTo(GameStateTypeEnum.Loading);
        }
示例#18
0
    public void ReplaceBuild()
    {
        GameMethod.BuildReplaceObject(Entity);
        int ret = EntityManager.HandleDelectEntity(Entity.GameObjGUID);

        if (ret != 0)
        {
            Debug.LogError("OnEnterDead HandleDelectEntity:" + Entity.GameObjGUID + "failed");
        }
    }
示例#19
0
    public ReadGuideHelpConfig(string xmlFilePath)
    {
        TextAsset xmlfile = Resources.Load(xmlFilePath) as TextAsset;

        if (!xmlfile)
        {
            Debug.LogError(" error infos: 没有找到指定的xml文件:" + xmlFilePath);
        }

        xmlDoc = new XmlDocument();
        xmlDoc.LoadXml(xmlfile.text);

        XmlNodeList infoNodeList = xmlDoc.SelectSingleNode("HelpTips").ChildNodes;

        for (int i = 0; i < infoNodeList.Count; i++)//(XmlNode xNode in infoNodeList)
        {
            if ((infoNodeList[i] as XmlElement).GetAttributeNode("id") == null)
            {
                continue;
            }

            string typeName = (infoNodeList[i] as XmlElement).GetAttributeNode("id").InnerText;

            GuideHelpData helpInfo = new GuideHelpData();
            helpInfo.helpId = Convert.ToInt32(typeName);
            foreach (XmlElement xEle in infoNodeList[i].ChildNodes)
            {
                #region 搜索
                switch (xEle.Name)
                {
                case "tiptimes":
                    helpInfo.helpTimes = Convert.ToInt32(xEle.InnerText);
                    break;

                case "tipmatches":
                    helpInfo.helpMatches = Convert.ToInt32(xEle.InnerText);
                    break;

                case "tippath":
                    helpInfo.helpObjPathList = GameMethod.ResolveToStrList(Convert.ToString(xEle.InnerText), ';');
                    break;

                case "tipevent":
                    helpInfo.helpTriggerEvent = Convert.ToInt32(xEle.InnerText);
                    break;

                case "tipShowTimes":
                    helpInfo.helpShowTime = float.Parse(xEle.InnerText);
                    break;
                }
                #endregion
            }
            ConfigReader.guideHelpXmlInfoDict.Add(helpInfo.helpId, helpInfo);
        }
    }
示例#20
0
    void OnEnable()
    {
        if (m_ProGressbar != null)
        {
            m_ProGressbar.value = 0.0f;
            SetEffectPos();
        }

        int[]  idArray = GameMethod.GetRandIntArrayFromList(LoadingTipData.GetIdList(), 1);
        string tip     = ConfigReader.GetLoadingTipInfo(idArray[0]).Tip;

        labelTip.text = tip;
    }
示例#21
0
        public void Exit()
        {
            EventCenter.RemoveListener <CEvent>(EGameEvent.eGameEvent_Loading, OnEvent);
            EventCenter.RemoveListener <CEvent>(EGameEvent.eGameEvent_IntoRoom, OnEvent);
            EventCenter.RemoveListener <CEvent>(EGameEvent.eGameEvent_IntoLobby, OnEvent);
            EventCenter.RemoveListener(EGameEvent.eGameEvent_ConnectServerFail, OnConnectServerFail);

            //GameMethod.DisableAllUI();

            GameMethod.RemoveUI("superwan(Clone)");
            PlayerManager.Instance.LocalPlayer.CleanWhenGameOver();
            JxBlGame.Instance.OpenConnectUI();
            GameObjectPool.Instance.Clear();
        }
示例#22
0
//         public void CallBack(object obj)
//         {
//             GameStateType state = (GameStateType)obj;
//             SetStateTo(state);
//         }

        public void Enter()
        {
            if (mNextState == GameStateType.GS_Continue)
            {
                return;
            }

            SetStateTo(GameStateType.GS_Continue);

            //加载UI
            mUIRoot = GameMethod.LoadProgress();
            LoadScene.Instance.GState        = mNextState;
            LoadScene.Instance.OnLoadFinish += LoadFinish;


            //加载场景之前需要进行清除操作
            BlGame.Effect.EffectManager.Instance.DestroyAllEffect();
            //清除GameObjectPool数据
            GameObjectPool.Instance.Clear();

            //加载场景
            if (mNextState == BlGame.GameState.GameStateType.GS_Play)
            {
                LoadScene.Instance.isCloseBySelf = false;
                string name = GetLoadMapName();
                LoadScene.Instance.LoadAsignedSene("Scenes/" + name);

                WindowManager.Instance.ChangeScenseToPlay(mFrontScenes);
            }
            else
            {
                //返回Pvp_Login选人界面需要清除预加载信息
                ReadPreLoadConfig.Instance.Clear();

                LoadScene.Instance.isCloseBySelf = true;
                LoadScene.Instance.LoadAsignedSene("Scenes/Pvp_Login");

                WindowManager.Instance.ChangeScenseToLogin(mFrontScenes);
            }
            //AudioClip clip = Resources.Load(AudioDefine.PATH_UIBGSOUND) as AudioClip;
            //AudioManager.Instance.PlayBgAudio(clip);

            ResourceUnit clipUnit = ResourcesManager.Instance.loadImmediate(AudioDefine.PATH_UIBGSOUND, ResourceType.ASSET);
            AudioClip    clip     = clipUnit.Asset as AudioClip;

            AudioManager.Instance.PlayBgAudio(clip);

            EventCenter.AddListener(EGameEvent.eGameEvent_ConnectServerFail, OnConnectServerFail);
            EventCenter.AddListener <CEvent>(EGameEvent.eGameEvent_IntoRoom, OnEvent);
        }
示例#23
0
        public void Exit()
        {
            EventCenter.RemoveListener <FEvent>((Int32)GameEventEnum.Loading, OnEvent);
            EventCenter.RemoveListener <FEvent>((Int32)GameEventEnum.IntoRoom, OnEvent);
            EventCenter.RemoveListener <FEvent>((Int32)GameEventEnum.IntoLobby, OnEvent);
            EventCenter.RemoveListener((Int32)GameEventEnum.ConnectServerFail, OnConnectServerFail);

            //GameMethod.DisableAllUI();

            GameMethod.RemoveUI("superwan(Clone)");
            PlayerManager.Instance.LocalPlayer.CleanWhenGameOver();
            HolyTechGameBase.Instance.OpenConnectUI();
            ObjectPool.Instance.Clear();
        }
示例#24
0
        public void SetJungleMonsterBeAtkVoice()
        {
            int           id   = (int)ObjTypeID;
            NpcConfigInfo info = ConfigReader.GetNpcInfo(id);

            if (entityType != EntityType.Monster || Hp < hpLimit || AudioManager.Instance.HeroLinesAudioDict.ContainsKey(GameObjGUID))
            {
                return;
            }
            List <float> ifPlaySoundList = new List <float>();

            for (int i = 0; i < ifPlayMonsterSound.Length; i++)
            {
                ifPlaySoundList.Add(ifPlayMonsterSound[i]);
            }
            int indexPlay = GameMethod.RandProbablityIndex(ifPlaySoundList);//获得是否播放下标

            if (indexPlay == 1)
            {
                return;
            }
            if (HasSameTypeNpcPlaySoundIsPlaying())
            {
                return;
            }

            if (info.n32Script1Rate == null)
            {
                return;
            }

            List <float> probabilityList = GameMethod.ResolveToFloatList(info.n32Script1Rate);//获得概率集合

            for (int i = 0; i < probabilityList.Count; i++)
            {
                probabilityList[i] = (float)(probabilityList[i] - 90000) / 100f;
            }
            int           index     = GameMethod.RandProbablityIndex(probabilityList); //获得概率下标
            List <string> voiceList = GameMethod.ResolveToStrList(info.un32Script1);
            string        name      = voiceList[index];                                //获得概率下标对应的声音
            string        path      = AudioDefine.PATH_JUNGLE_MONSTER_BE_ATK_SOUND + name;

            //AudioClip clip = Resources.Load(path) as AudioClip;
            ResourceItem clipUnit = ResourcesManager.Instance.loadImmediate(path, ResourceType.ASSET);
            AudioClip    clip     = clipUnit.Asset as AudioClip;


            AudioManager.Instance.PlayHeroLinesAudio(GameObjGUID, clip);
        }
示例#25
0
    // Update is called once per frame
    void Update()
    {
        UpdateHomeHp();

        deltaTime += Time.deltaTime;
        if (GameTimeData.Instance.GetStartTag() && deltaTime > 1.0f)
        {
            TimeSpan span  = GameTimeData.Instance.GetGameTime();
            int      sHour = span.Hours;
            int      sMin  = span.Minutes;
            int      sSec  = span.Seconds;
            TimeLabel.text = GameMethod.GetCurrSystemTime(sHour, sMin, sSec);
            deltaTime      = 0.0f;
        }
    }
示例#26
0
        public override void OnUpdate()
        {
            UpdateCoolDownGameItems();

            base.OnUpdate();
            if (Time.frameCount % 5 != 0)
            {
                return;
            }
            BuildingAtkWarningManager.Instance.OnUpdate();
            //SecondaryGuideManager.Instance.OnUpdate();
            IGuideMidMatchTip.Instance.OnUpdate();
            //if (UIEnemyTeamMateInfo.Instance != null)
            //{
            //    UIEnemyTeamMateInfo.Instance.OnUpdate();
            //}

            if (this.FSM != null && this.FSM.State == FsmState.FSM_STATE_DEAD)
            {
                return;
            }
            if (SyncLockTarget != null && SyncLockTarget.realObject != null)
            {
                if (Vector3.Distance(this.objTransform.position, SyncLockTarget.objTransform.position) > GameConstDefine.PlayerLockTargetDis)
                {
                    if (!PlayerManager.Instance.IsLocalSameType(SyncLockTarget) && SyncLockTarget.entityType == EntityType.Monster || SyncLockTarget.entityType == EntityType.Soldier)
                    {
                        if (SyncLockTarget.XueTiao != null)
                        {
                            SyncLockTarget.XueTiao.IsXueTiaoCpVib(false);
                        }
                    }
                    this.SetSyncLockTarget(null);
                }
                return;
            }
            if (AutoLockTarget)
            {
                IEnumerable <Ientity> ItemList = GameMethod.GetEnemyItemListByRadius(PlayerManager.Instance.LocalPlayer, GameConstDefine.PlayerLockTargetDis);
                IEnumerator <Ientity> Item     = ItemList.GetEnumerator();
                Item.MoveNext();
                if (ItemList == null || Item.Current == null)
                {
                    return;
                }
                this.SetSyncLockTarget(Item.Current);
            }
        }
示例#27
0
        public void Enter()
        {
            if (mNextState == GameStateTypeEnum.Continue)
            {
                return;
            }

            SetStateTo(GameStateTypeEnum.Continue);

            //加载UI
            mUIRoot = GameMethod.LoadProgress();
            LoadScene.Instance.GState        = mNextState; //狀態賦值
            LoadScene.Instance.OnLoadFinish += LoadFinish; //委託賦值   LoadFinish 封裝了設置狀態函數

            //加载场景之前需要进行清除操作
            Thanos.Effect.EffectManager.Instance.DestroyAllEffect();
            //清除GameObjectPool数据
            ObjectPool.Instance.Clear();

            //加载场景  如果下一个状态是战斗状态  加载战斗场景
            if (mNextState == Thanos.GameState.GameStateTypeEnum.Play)
            {
                LoadScene.Instance.isCloseBySelf = false;
                string name = GetLoadMapName();
                LoadScene.Instance.LoadAsignedSene("Scenes/" + name);
                //Play UI窗口加载
                WindowManager.Instance.ChangeScenseToPlay(mFrontScenes);
            }
            else
            {
                //返回Pvp_Login选人界面需要清除预加载信息
                ReadPreLoadConfig.Instance.Clear();
                LoadScene.Instance.isCloseBySelf = true;
                LoadScene.Instance.LoadAsignedSene("Scenes/Pvp_Login");//加载指定场景
                //Login UI窗口加载
                WindowManager.Instance.ChangeScenseToMain(mFrontScenes);
            }
            //音频播放
            ResourceItem clipUnit = ResourcesManager.Instance.loadImmediate(AudioDefine.PATH_UIBGSOUND, ResourceType.ASSET);
            AudioClip    clip     = clipUnit.Asset as AudioClip;

            AudioManager.Instance.PlayBgAudio(clip);

            //事件添加
            EventCenter.AddListener((Int32)GameEventEnum.ConnectServerFail, OnConnectServerFail);
            EventCenter.AddListener <FEvent>((Int32)GameEventEnum.IntoRoom, OnEvent);
        }
示例#28
0
        public override void InitWhenCreateModel()
        {
            // base.InitWhenCreateModel();
            if (PlayerPrefs.HasKey(GameMethod.RangeVoc))
            {
                int  sKey  = PlayerPrefs.GetInt(GameMethod.RangeVoc);
                bool state = (sKey == 1) ? true : false;
                GameMethod.SetRange(state);
            }

            bool effectState = false;

            if (PlayerPrefs.HasKey(GameMethod.EffectVoc))
            {
                int sKey = PlayerPrefs.GetInt(GameMethod.EffectVoc);
                effectState = (sKey == 1) ? true : false;
            }
            GameMethod.SetEffect(effectState);

            InitSkillDic(SkillIdDic);
            InitSkillDic(BaseSkillIdDic);

            EventCenter.Broadcast(EGameEvent.eGameEvent_LocalPlayerInit);

            ResourceUnit WalkAudioClipUnit = ResourcesManager.Instance.loadImmediate(AudioDefine.PATH_HERO_WALKSOUND + ConfigReader.GetHeroInfo(this.NpcGUIDType).un32WalkSound, ResourceType.ASSET);

            WalkAudioClip = WalkAudioClipUnit.Asset as AudioClip;

            ResourceUnit DeadAudioClipUnit = ResourcesManager.Instance.loadImmediate(AudioDefine.PATH_HERO_DEADSOUND + ConfigReader.GetHeroInfo(this.NpcGUIDType).HeroDeathSould, ResourceType.ASSET);

            DeadAudioClip = DeadAudioClipUnit.Asset as AudioClip;

            ResourceUnit EnterAltarClipUnit = ResourcesManager.Instance.loadImmediate(AudioDefine.PATH_ENTERALTAR_SOUND, ResourceType.ASSET);

            EnterAltarClip = EnterAltarClipUnit.Asset as AudioClip;

            ResourceUnit RebornClipUnit = ResourcesManager.Instance.loadImmediate(AudioDefine.PATH_REBORN_SOUND, ResourceType.ASSET);

            RebornClip = RebornClipUnit.Asset as AudioClip;

            base.InitWhenCreateModel();
            EventCenter.AddListener <UInt64>(EGameEvent.eGameEvent_GameOver, OnGameOver);

            OnCameraUpdatePosition();
        }
        public void InitFinishTask(int task, int matches)
        {
            GuideHelpData data = ConfigReader.GetGuideHelpInfo(task);

            if (data == null || data.helpMatches <= matches)
            {
                return;
            }
            if (taskDic.ContainsKey(task))
            {
                GameMethod.DebugError("secondary guide repeat");
                return;
            }
            SecondaryTaskInfo taskInfo = new SecondaryTaskInfo();

            taskInfo.InitTaskInfo(task, 0, matches);
            taskDic.Add(task, taskInfo);
        }
    public ReadGuideKillHeroTaskConfig(string xmlFilePath)
    {
        ResourceUnit xmlfileUnit = ResourcesManager.Instance.loadImmediate(xmlFilePath, ResourceType.ASSET);
        TextAsset    xmlfile     = xmlfileUnit.Asset as TextAsset;

        if (!xmlfile)
        {
            Debug.LogError(" error infos: 没有找到指定的xml文件:" + xmlFilePath);
        }

        xmlDoc = new XmlDocument();
        xmlDoc.LoadXml(xmlfile.text);

        XmlNodeList infoNodeList = xmlDoc.SelectSingleNode("killhero").ChildNodes;

        for (int i = 0; i < infoNodeList.Count; i++)//(XmlNode xNode in infoNodeList)
        {
            if ((infoNodeList[i] as XmlElement).GetAttributeNode("id") == null)
            {
                continue;
            }

            string typeName = (infoNodeList[i] as XmlElement).GetAttributeNode("id").InnerText;

            GuideKillHeroInfo info = new GuideKillHeroInfo();
            info.TaskId = Convert.ToInt32(typeName);
            foreach (XmlElement xEle in infoNodeList[i].ChildNodes)
            {
                #region 搜索
                switch (xEle.Name)
                {
                case "deadnpcid":
                    info.mDeadnpcid = GameMethod.ResolveToIntList(xEle.InnerText);
                    break;

                case "times":
                    info.mTimes = Convert.ToInt32(xEle.InnerText);
                    break;
                }
                #endregion
            }
            ConfigReader.guideKillHeroXmlInfoDict.Add(info.TaskId, info);
        }
    }