Exemplo n.º 1
0
    HexSubMapView CreateSubMapView(int x, int y)
    {
#if UNITY_EDITOR
        if (MapEditorEntry.Instance != null)
        {
            return(CreateSubMapViewInEditor(x, y));
        }
#endif
        HexSubMapView sub      = null;
        var           cachedGo = GameObjectPool.GetInstance().WithdrawGo(MapPrefabDef.MAP_SUB_VIEW);
        if (null == cachedGo)
        {
            sub = Instantiate(subMapViewTemplate);
            LogModule.WarningLog("HexSubMapView Allocated!");
        }
        else
        {
            sub = cachedGo.GetComponent <HexSubMapView>();
        }

        sub.name = string.Format("({0}, {1})", x, y);
        //sub.tileTmpDict = App.MapTileLoader.TileTmpDict;
        sub.hex              = hex;
        sub.layout           = Layout;
        sub.xIdx             = x;
        sub.yIdx             = y;
        sub.transform.parent = transform;
        return(sub);
    }
Exemplo n.º 2
0
 public void StopAnimEffect()
 {
     if (m_ObjChar == null)
     {
         return;
     }
     if (m_curAnimData == null)
     {
         LogModule.WarningLog("cur animation id is not exit " + m_curAnimData.AnimID.ToString());
         return;
     }
     for (int i = 0; i < m_curAnimData.getStartEffectCount(); i++)
     {
         if (m_curAnimData.AnimID == 24)
         {
             break;
         }
         int effectId = m_curAnimData.GetStartEffectbyIndex(i);
         if (effectId != -1)
         {
             m_ObjChar.StopEffect(effectId);
         }
     }
     if (m_curAnimData.EndEffect != -1)
     {
         m_ObjChar.StopEffect(m_curAnimData.EndEffect);
     }
 }
Exemplo n.º 3
0
        public static void CreateModelStoryObj(int nCharModelID, string strName, DelAsycModelOver delAsycStroyModel)
        {
            Tab_CharModel charModel = TableManager.GetCharModelByID(nCharModelID, 0);

            if (null == charModel)
            {
                LogModule.WarningLog("can not find char model id in table :" + nCharModelID);
                return;
            }

            GameObject charObj = ResourceManager.InstantiateResource("Prefab/Model/PlayerRoot", strName) as GameObject;

            if (null == charObj)
            {
                LogModule.WarningLog("can not load PlayerRoot :" + nCharModelID);
                return;
            }
            Obj_Client curCharacter = charObj.GetComponent <Obj_Client>();

            if (null == curCharacter)
            {
                charObj.AddComponent <Obj_Client>();
            }

            LoadModelToRoot(nCharModelID, EResourceType.CharacterModel, LoadModelComplete, charObj, charModel, delAsycStroyModel);
        }
Exemplo n.º 4
0
    /// <summary>
    /// </summary>
    /// <param name="p_name"></param>
    /// <param name="isShowAnimation"></param>
    /// <returns></returns>
    public bool CloseUI(string p_name, bool isShowAnimation)
    {
        try
        {
            if (!m_UIItemMap.ContainsKey(p_name))
            {
                throw new KeyNotFoundException(string.Format("Cannot close UI: {0} cause key not found in UIItemMap",
                                                             p_name));
            }

            if (m_UIItemMap.ContainsKey(p_name) && !m_UIItemMap[p_name].IsShowing)
            {
                LogModule.WarningLog("Cancel close {0} UI cause already closed.", p_name);
                return(false);
            }

            if (isShowAnimation)
            {
                m_UIItemMap[p_name].ViewBase.OnClose();
            }
            else
            {
                CloseUIInternal(p_name);
            }

            return(true);
        }
        catch (Exception e)
        {
            LogModule.ErrorLog("Exception in close UI, {0}\n{1}", e.Message, e.StackTrace);
            return(false);
        }
    }
Exemplo n.º 5
0
    bool ProcessInput()
    {
        if (m_SocketInputStream == null)
        {
            return(false);
        }
        if (m_Socket.IsCanReceive() == false)
        {
            return(true);
        }

        uint nSizeBefore = m_SocketInputStream.Length();
        uint ret         = m_SocketInputStream.Fill();
        uint nSizeAfter  = m_SocketInputStream.Length();

        if (ret == SOCKET_ERROR)
        {
            LogModule.WarningLog("send packet fail");
            m_Socket.close();
            ConnectLost();
            return(false);
        }

        //收包统计
        if (nSizeAfter > nSizeBefore)
        {
            if (NetWorkLogic.s_nReceiveCount < 0)
            {
                NetWorkLogic.s_nReceiveCount = 0;
            }
            NetWorkLogic.s_nReceiveCount += (int)(nSizeAfter - nSizeBefore);
        }
        return(true);
    }
Exemplo n.º 6
0
    static public void OnLog(string message, string stackTrace, LogType type)
    {
        switch (type)
        {
        case LogType.Exception:
        {
            string bugMsg = "{\n" +
                            "\"message\":" + "\"" + message.Replace("\n", "") + "\"" +
                            ",\n\"stacktrace\":" + "\"" + stackTrace.Replace("\n", "") + "\"" +
                            ",\n\"time\":" + "\"" + PlatformHelper.GetCurrentTime() + "\""
                            + "\n" + "\"" + "\n}";

            //PlatformHelper.UploadBug(butMsg);
            LogModule.ErrorLog(bugMsg);
            break;
        }

        case LogType.Log:
            LogModule.DebugLog(message);
            break;

        case LogType.Warning:
            LogModule.WarningLog(message);
            break;

        case LogType.Error:
            LogModule.ErrorLog(message);
            break;
        }
    }
Exemplo n.º 7
0
    //////////////////////////////////////////////////////////////////////////
    #region Thread For Connect

    public void ConnectThread()
    {
        m_connectStatus = ConnectStatus.CONNECTING;
        while (true)
        {
            m_Socket.close();

            Console.WriteLine("connect:" + m_strServerAddr);
            m_strConnectResult = m_Socket.connect(m_strServerAddr, m_nServerPort);
            if (m_strConnectResult.Length == 0 && m_Socket.IsValid)
            {
                m_SocketInputStream  = new SocketInputStream(m_Socket);
                m_SocketOutputStream = new SocketOutputStream(m_Socket);
                m_connectStatus      = ConnectStatus.CONNECTED;
                break;
            }
            else
            {
                LogModule.WarningLog(m_strConnectResult);
            }
            m_Socket.close();

            Thread.Sleep(m_nConnectSleep);
            m_connectStatus = ConnectStatus.DISCONNECTED;
            break;
        }

        m_bConnectFinish = true;
    }
Exemplo n.º 8
0
        /// <summary>
        /// 日志检测处理方法
        /// </summary>
        /// <param name="message"></param>
        /// <param name="stacktrace"></param>
        /// <param name="type"></param>
        public void OnLog(string message, string stacktrace, LogType type)
        {
            if (UnityGuiConsole.Instance != null)
            {
                UnityGuiConsole.Instance.LogCallback(message, stacktrace, type);
            }
            switch (type)
            {
            case LogType.Exception:
            {
                string butMsg = "{\n" +
                                "\"message\":" + "\"" + message.Replace("\n", "") + "\"" +
                                ",\n\"stacktrace\":" + "\"" + stacktrace.Replace("\n", "") + "\"" +
                                ",\n\"time\":" + "\"" + PlatformHelper.getcurrentTime() + "\""
                                + "\n" + "\"" + "\n}";

                //PlatformHelper.UploadBug(butMsg);
                LogModule.DebugLog(butMsg);
                break;
            }

            case  LogType.Log:
                LogModule.DebugLog(message);
                break;

            case LogType.Warning:
                LogModule.WarningLog(message);
                break;

            case LogType.Error:
                LogModule.ErrorLog(message);
                break;
            }
        }
    public void SwitchToScene(SceneId sceneId, object param = null)
    {
        if (sceneId == CurrentSceneId)
        {
            LogModule.WarningLog("switch to current scene: " + sceneId);
        }
        LogModule.DebugLog("SceneMgr  SwitchToScene  sceneId:" + sceneId.ToString() + "  " + System.DateTime.Now.ToString());
        mParam = param;

        if (mCurScene != null)
        {
            mCurScene.OnWillExit();
            //App.EventMgr.Post(EventId.SceneWillExit, mCurScene.Id);
        }

        if (mSceneTypeDict.ContainsKey(sceneId))
        {
            mNextScene = Activator.CreateInstance(mSceneTypeDict[sceneId]) as SceneBase;
            if (mNextScene != null)
            {
                mNextScene.OnWillEnter(param);
            }
        }

        if (hdlSceneWillSwitch != null)
        {
            hdlSceneWillSwitch.Invoke(mCurrentSceneId, sceneId, param);
        }

        SceneManager.LoadScene(sceneId.ToString());
    }
Exemplo n.º 10
0
    public static void ChangeShader(Transform obj)
    {
        if (obj.GetComponent <Renderer>() != null && obj.GetComponent <Renderer>().material != null)
        {
            Material sm         = obj.GetComponent <Renderer>().material;
            var      shaderName = sm.shader.name;
            if (!string.IsNullOrEmpty(shaderName))
            {
                var newShader = Shader.Find(shaderName);
                if (newShader != null)
                {
                    sm.shader = newShader;
                }
                else
                {
                    LogModule.WarningLog("unable to refresh shader: " + shaderName + " in material " + sm.name);
                }
            }
        }

        for (int i = 0; i < obj.childCount; i++)
        {
            ChangeShader(obj.transform.GetChild(i));
        }
    }
Exemplo n.º 11
0
        public void FinishAnimEffect(int finishedAnimID)
        {
            if (m_ObjChar == null)
            {
                return;
            }
            Tab_Animation curAnim = TableManager.GetAnimationByID(finishedAnimID, 0);

            if (curAnim == null)
            {
                LogModule.WarningLog("cur animation id is not exit " + finishedAnimID.ToString());
                return;
            }
            for (int i = 0; i < curAnim.getStartEffectCount(); i++)
            {
                int effectId = curAnim.GetStartEffectbyIndex(i);
                if (effectId != -1)
                {
                    if (curAnim.GetIsStartEffectAutoEndbyIndex(i) == false)
                    {
                        m_ObjChar.StopEffect(effectId);
                    }
                }
            }
            if (curAnim.EndEffect >= 0)
            {
                if (DebugHelper.m_bShowEffect)
                {
                    m_ObjChar.PlayEffect(curAnim.EndEffect);
                }
            }
        }
Exemplo n.º 12
0
    public void SetData(ItemClickDelegate clickFun, ItemClickDelegate doubleClickFun, ItemClickDelegate iconClickFun, int shopIndex, Tab_SystemShop tabSysShop)
    {
        if (tabSysShop == null)
        {
            return;
        }
        delItemClick       = clickFun;
        delItemDoubleClick = doubleClickFun;
        delItemIconClick   = iconClickFun;
        int pid = tabSysShop.GetPidbyIndex(shopIndex);

        LabelMoney.text = tabSysShop.GetPricebyIndex(shopIndex).ToString();
        Tab_CommonItem curTabItem = TableManager.GetCommonItemByID(pid, 0);

        if (null == curTabItem)
        {
            LogModule.WarningLog("can not read cur common item talbe :" + pid.ToString());
            return;
        }

        int groupCount = tabSysShop.GetNumPerGroupbyIndex(shopIndex);

        if (groupCount < 0)
        {
            groupCount = 1;
        }

        LabelName.text     = curTabItem.Name;// +"*" + groupCount.ToString();
        sprIcon.spriteName = curTabItem.Icon;
        int colorQuality = curTabItem.Quality - 1;

        if (colorQuality >= 0 && colorQuality < GlobeVar.QualityColorGrid.Length)
        {
            QualitySprite.spriteName = GlobeVar.QualityColorGrid[curTabItem.Quality - 1];
        }


        int moneyType    = tabSysShop.GetMoneyTypebyIndex(shopIndex);
        int moneySubType = tabSysShop.GetMoneySubTypebyIndex(shopIndex);

        if (moneyType == (int)Consume_Type.COIN)
        {
            MoneyIcon.spriteName = "qian5";
        }
        else if (moneyType == (int)Consume_Type.YUANBAO)
        {
            if (moneySubType == (int)Consume_SubType.YUANBAO_NORMAL)
            {
                MoneyIcon.spriteName = "qian2";
            }
            else if (moneySubType == (int)Consume_SubType.YUANBAO_BIND)
            {
                MoneyIcon.spriteName = "qian3";
            }
        }

        m_curGameItem        = new GameItem();
        m_curGameItem.DataID = pid;
    }
Exemplo n.º 13
0
    public void InitInfo(int nTableID)
    {
        Tab_CangJingGeExtraReward tabExtraReward = TableManager.GetCangJingGeExtraRewardByID(nTableID, 0);

        if (null == tabExtraReward)
        {
            LogModule.WarningLog("CangJingGeExtraRewardItem::InitInfo TableID is Invalid!!!");
            Clear();
        }
        else
        {
            Clear();
            ExtraRewardTableID = nTableID;
            m_TierNum.text     = StrDictionary.GetClientDictionaryString("#{2087}", tabExtraReward.TierLimit);
            for (int ii = 0; ii < MAX_ITEM_NUM; ++ii)
            {
                int nItemID = tabExtraReward.GetItemIDbyIndex(ii);
                int nCount  = tabExtraReward.GetItemNumbyIndex(ii);
                if (0 >= nCount || 0 > nItemID)
                {
                    m_Reward[ii].SetActive(false);
                    continue;
                }
                Tab_CommonItem tabItem = TableManager.GetCommonItemByID(nItemID, 0);
                if (null == tabItem)
                {
                    m_Reward[ii].SetActive(false);
                    continue;
                }
                else
                {
                    m_RewardItemIconSprite[ii].spriteName = tabItem.Icon;
                    m_RewardItemCount[ii].text            = nCount.ToString();
                    m_nRewardItemID[ii] = tabItem.Id;
                }
            }

            if (GetReceiveExtraRewardTableID() == ExtraRewardTableID)
            {
                m_BtnReceive.SetActive(true);
                m_CantReceive.SetActive(false);
            }
            else
            {
                m_BtnReceive.SetActive(false);
                m_CantReceive.SetActive(true);
                m_CantReceive.GetComponent <UIWidget>().color = new Color(0, 1, 1, 1);
                if (GameManager.gameManager.PlayerDataPool.CommonData.IsAlreadyReceiveReward(ExtraRewardTableID))
                {
                    m_LabelCantReceive.text = StrDictionary.GetClientDictionaryString("#{10819}");
                }
                else
                {
                    m_LabelCantReceive.text = StrDictionary.GetClientDictionaryString("#{10818}");
                }
            }
        }
    }
Exemplo n.º 14
0
    void OnConnectTimeOut()
    {
        if (!m_bShowConnectResult)
        {
            StartCoroutine(RequestServerState(PlayerPreferenceData.LastServer));
            m_bShowConnectResult = true;
        }

        LogModule.WarningLog("connect fail");
        m_connnectTimer = 0;
    }
Exemplo n.º 15
0
    HexSubMapView CreateSubMapViewInEditor(int x, int y)
    {
        HexSubMapView sub      = null;
        var           cachedGo = GameObjectPool.GetInstance().WithdrawGo(MapPrefabDef.MAP_SUB_VIEW);

        if (null == cachedGo)
        {
            sub = Instantiate(subMapViewTemplate);
            LogModule.WarningLog("HexSubMapView Allocated!");
        }
        else
        {
            sub = cachedGo.GetComponent <HexSubMapView>();
        }

        sub.name = string.Format("({0}, {1})", x, y);
        //sub.tileTmpDict = App.MapTileLoader.TileTmpDict;
        sub.hex    = hex;
        sub.layout = Layout;
        sub.xIdx   = x;
        sub.yIdx   = y;

        sub.transform.parent = transform;
        sub.InitPos();
        if (MapEditorEntry.Instance != null)
        {
            switch (MapEditorEntry.Instance.curOp)
            {
            case MapEditorEntry.EDIT_OP.EDIT_AREA:
                sub.InitBg(false);
                sub.ShowMarks(MapEditorEntry.EDIT_OP.EDIT_AREA, MapEditorEntry.Instance.campColors);
                break;

            case MapEditorEntry.EDIT_OP.EDIT_LV:
                sub.InitBg(false);
                sub.ShowMarks(MapEditorEntry.EDIT_OP.EDIT_LV, MapEditorEntry.Instance.levelColors);
                break;

            case MapEditorEntry.EDIT_OP.EDIT_TILETYPE:
                sub.InitBg(false);
                sub.ShowMarks(MapEditorEntry.EDIT_OP.EDIT_TILETYPE, MapEditorEntry.Instance.typeColors);
                break;

            default:
                sub.InitBg(true);
                sub.HideMarks();
                sub.InitBlocks();
                break;
            }
        }
        return(sub);
    }
 void OnConnectResult(bool bSuccess, string result)
 {
     LogModule.DebugLog(result);
     if (bSuccess)
     {
         LogModule.DebugLog("connect success");
         SwitchToMapScene();
     }
     else
     {
         LogModule.WarningLog("connect fail");
     }
 }
    public void GoOutClick()
    {
        var toSend = m_WorldModel.MyMarchList.Where(item => item.IsOut == false).ToList();

        if (toSend.Any())
        {
            m_WorldModel.SendSendMarchMsg(toSend.First());
        }
        else
        {
            LogModule.WarningLog("No remaining march to send.");
        }
    }
    public void PlayEffect(int effectID, PlayEffectDelegate delPlayEffect = null, object param = null)
    {
        if (!m_hasInited)
        {
        }
        Tab_Effect EffectInfo = TableManager.GetEffectByID(effectID, 0);

        if (EffectInfo == null)
        {
            if (null != delPlayEffect)
            {
                delPlayEffect(null, param);
            }
            return;
        }
        if (!DoPlayEffectWhenModelInvisible && !EffectHolderVisible && EffectInfo.Duration > 0)
        {
            return;
        }
        //设置了 取消技能特效 且满足条件
        if (EffectInfo.IsCanHide && !PlayerPreferenceData.SystemSkillEffectEnable)  //&& IsCanHideEffectObj)  这个 永远 返回 false ....
        {
            return;
        }
        ///特效持有者对象为空时 不处理 回调null
        if (m_EffectGameObj == null)
        {
            LogModule.WarningLog("effect can not play before init");
            if (null != delPlayEffect)
            {
                delPlayEffect(null, param);
            }
            return;
        }
        //加个数量限制
        //如果表格配置为-1则不限制,此时不用判断数量
        if (EffectInfo.MaxOwnNum >= 0 && GetEffectCountById(effectID) >= EffectInfo.MaxOwnNum)
        {
            return;
        }

        LoadEffect(EffectInfo, delPlayEffect, param);

        // 高能预警!!高能预警!!高能预警!!高能预警!!高能预警!!高能预警!!高能预警!!高能预警!!
        // 要开始挖坑了!!!	坑////////坑////////坑////////坑////////坑////////坑/////
        // 高能预警!!高能预警!!高能预警!!高能预警!!高能预警!!高能预警!!高能预警!!高能预警!!
//		if (GlobeVar.PLAYERLEVELUPEFFECTID == effectID)
//		{
//			UIManager.HideAllUIWhenLevelUp();
//		}
    }
Exemplo n.º 19
0
    static void ExportDevScene()
    {
#if UNITY_WINDOWS
        LogModule.WarningLog("really???? crazy!");
        return;
#endif
        string selectPath = GetSelectPath("Scene");
        if (null == selectPath)
        {
            return;
        }

        ExportScene(selectPath, BundleManager.DevelopOutputPath, CommandBuild.GetBuildResTarget);
    }
    // Update is called once per frame
    void Update()
    {
        int drawn = 0;

        while (currentLogTestCount < logTestCount && drawn < 10)
        {
            LogModule.DebugLog("Test Log " + currentLogTestCount);
            LogModule.DebugLog("Test LogError " + currentLogTestCount);
            LogModule.WarningLog("Test LogWarning " + currentLogTestCount);
            drawn++;
            currentLogTestCount++;
        }

        //test exception
        //GameObject o = null;
        //o.name = "opps this is null";
    }
    // Use this for initialization
    void Start()
    {
        inGameLogs = FindObjectOfType(typeof(InGameLog)) as InGameLog;
        LogModule.DebugLog("test long text sdf asdfg asdfg sdfgsdfg sdfg sfg sdfgsdfg sdfg sdf gsdfg sfdg sf gsdfg sdfg asdfg asdf asdf asdf asdf adsf ");

        style                  = new GUIStyle();
        style.alignment        = TextAnchor.MiddleCenter;
        style.normal.textColor = Color.white;
        style.wordWrap         = true;

        for (int i = 0; i < 10; i++)
        {
            LogModule.DebugLog("Test Collapsed log");
            LogModule.WarningLog("Test Collapsed Warning");
            LogModule.DebugLog("Test Collapsed Error");
        }
    }
Exemplo n.º 22
0
    string GetPowerAniStr()
    {
        if (m_nBufferNewPower <= 0)
        {
            LogModule.WarningLog("New power < 0, error.");
            return("0");
        }
        int    length    = Mathf.FloorToInt(Mathf.Log10(m_nBufferNewPower));
        int    lengthAni = Mathf.FloorToInt(Mathf.Log10(powerAni));
        string result    = "";

        for (int i = 0; i < length - lengthAni; i++)
        {
            result += "0";
        }
        result += powerAni.ToString();
        return(result);
    }
Exemplo n.º 23
0
    /// <summary>
    /// Open a UI, will create one if no cache exist
    /// </summary>
    /// <param name="p_type">UI category: fullscreen, window, popup, etc</param>
    /// <param name="p_name">name you defined</param>
    /// <param name="p_mediatorType"></param>
    /// <param name="p_bundlePath">prefab to instantiate</param>
    /// <param name="p_viewInitCallBack"></param>
    /// <param name="p_viewRefreshCallBack"></param>
    /// <param name="p_allocateDepth">allocate several panel depth to ui</param>
    /// <param name="p_viewName"></param>
    /// <param name="isShowAnimation"></param>
    public bool OpenUIInternal(UIItemConfig p_config, DelegateHelper.TableDelegate p_viewInitCallBack = null, DelegateHelper.TableDelegate p_viewRefreshCallBack = null, bool isShowAnimation = true)
    {
        try
        {
            if (m_UIItemMap.ContainsKey(p_config.Name) && m_UIItemMap[p_config.Name].IsShowing)
            {
                LogModule.WarningLog("Cancel open {0} UI cause already in showing.", p_config.Name);
                //Execute refresh without animation.
                ExeAfterOpenUI(p_config, p_viewRefreshCallBack, false);

                return(false);
            }

            if (!m_UICategoryMap[p_config.Type].CanOpenUI)
            {
                m_UICategoryMap[p_config.Type].AddToToShowList(new UICategory.ToShowConfig()
                {
                    ItemConfig      = p_config,
                    ViewDelegate    = p_viewInitCallBack,
                    RefreshDelegate = p_viewRefreshCallBack,
                    IsShowAnim      = isShowAnimation
                });
                return(false);
            }

            if (!m_UIItemMap.ContainsKey(p_config.Name))
            {
                CreateUI(p_config, p_viewInitCallBack, p_viewRefreshCallBack, isShowAnimation);
            }
            else
            {
                m_UICategoryMap[p_config.Type].CheckOpenDepth(p_config.Name);

                ExeAfterOpenUI(p_config, p_viewRefreshCallBack, isShowAnimation);
            }

            return(true);
        }
        catch (Exception e)
        {
            LogModule.ErrorLog("Exception in open UI internal, {0}\n{1}", e.Message, e.StackTrace);
            return(false);
        }
    }
Exemplo n.º 24
0
    public void SwitchWindow(int index)
    {
        if (null == childWindows)
        {
            LogModule.WarningLog("child window is not set");
            return;
        }

        if (index >= childWindows.Length)
        {
            LogModule.WarningLog("child window index out range :" + index.ToString() + " " + childWindows.Length.ToString());
            return;
        }

        for (int i = 0; i < childWindows.Length; i++)
        {
            childWindows[i].SetActive(i == index);
        }
    }
Exemplo n.º 25
0
        public float GetProgress()
        {
            if (_listeningAssetBundles.Count <= 0)
            {
                return(1f);
            }
            if (_totalSize == 0)
            {
                LogModule.WarningLog("totalSize = 0,_listeningAssetBundles count:{0}", _listeningAssetBundles.Count);
                return(1f);
            }
            float loadedSize = 0;

            for (int i = 0; i < _listeningAssetBundles.Count; i++)
            {
                AssetLoader loader = _listeningAssetBundles[i];
                loadedSize += loader.GetLoadingProgress() * loader.GetAssetSize();
            }
            return(loadedSize / _totalSize);
        }
Exemplo n.º 26
0
    /// <summary>
    /// 设置数据
    /// </summary>
    /// <param name="mission"></param>
    public void SetData(Tab_DailyMission mission)
    {
        mMissionId = mission.MissionID;
        mGoToUIId  = mission.UIName;
        MissionManager        missionManager = GameManager.gameManager.MissionManager;
        Tab_MissionDictionary missionDic     = TableManager.GetMissionDictionaryByID(mMissionId, 0);
        Tab_MissionBase       missionBase    = TableManager.GetMissionBaseByID(mMissionId, 0);

        if (missionBase == null || missionBase.LogicType != (int)TableType.Table_OperationNum)
        {
            LogModule.WarningLog("DailyMission Logic Type Error, id = " + mission.Id);
            return;
        }
        Tab_MissionOperationNum missionOp = TableManager.GetMissionOperationNumByID(missionBase.LogicID, 0);

        lblMissionName.text = string.Format(missionDic.MissionName, "", "");
        sprIcon.spriteName  = missionDic.MissionIcon;
        lblDesc.text        = missionDic.MissionDesc;
        lblActive.text      = StrDictionary.GetClientDictionaryString("#{1634}", mission.AwardActiveness);

        int progress = missionOp.OperationCount;

        if (missionManager.IsHaveMission(mMissionId))
        {
            progress = missionManager.GetMissionParam(mMissionId, 0);
            doneArea.SetActive(false);
            rewardArea.SetActive(true);
            btnClaim.SetActive(missionManager.GetMissionState(mMissionId) == (byte)MissionState.Mission_Completed);
            UIEventListener.Get(btnClaim).onClick = ClaimReward;
            SetRewards(mission);
        }
        else
        {
            doneArea.SetActive(true);
            rewardArea.SetActive(false);
            btnClaim.SetActive(false);
        }
        lblProgress.text = progress + "/" + missionOp.OperationCount;
        UpdateProgress(progress, missionOp.OperationCount);
        UIEventListener.Get(btnGoTo).onClick = GoToUI;
    }
Exemplo n.º 27
0
 void OnConnectResult(bool bSuccess, string result)
 {
     if (bSuccess)
     {
         MessageBoxLogic.CloseBox();
         if (LoginUILogic.Instance() != null)
         {
             LoginUILogic.Instance().EnterAccount();
         }
     }
     else
     {
         if (!m_bShowConnectResult)
         {
             StartCoroutine(RequestServerState(PlayerPreferenceData.LastServer));
             m_bShowConnectResult = true;
         }
         LogModule.WarningLog("connect fail");
         m_connnectTimer = 0;
     }
 }
Exemplo n.º 28
0
    public void InitInfo(Tab_FashionData tabFashionData, bool isObtained)
    {
        m_FashionID = tabFashionData.Id;

        if (tabFashionData == null)
        {
            LogModule.WarningLog("FashionItemLogic::InitInfo FashionID is Invalid!!!");
            m_ItemIcon.gameObject.SetActive(false);
            m_ItemName.text = "Invalid";
            m_Highlight.gameObject.SetActive(false);
        }
        else
        {
            m_ItemIcon.spriteName = tabFashionData.Icon;
            m_ItemIcon.gameObject.SetActive(isObtained);
            m_ItemName.text  = tabFashionData.Name;
            m_ItemName2.text = tabFashionData.Name;
        }

        HideChosenSprite();
    }
Exemplo n.º 29
0
        /// <summary>
        /// 创建陷阱
        /// </summary>
        /// <param name="nCharModelID"></param>
        /// <param name="initData"></param>
        public static void CreateModelSnareObj(ObjSnare_Init_Data initData)
        {
            if (null == initData)
            {
                return;
            }

            //根据RoleBase的ID获得路径
            Tab_SnareObjInfo SnareObjInfo = TableManager.GetSnareObjInfoByID(initData.m_SnareID, 0);

            if (null == SnareObjInfo)
            {
                return;
            }
            int nCharModelID = SnareObjInfo.CharModelId;

            Tab_CharModel charModel = TableManager.GetCharModelByID(nCharModelID, 0);

            if (charModel == null)
            {
                LogModule.WarningLog("can not find char model id in table :{0}", nCharModelID);
                return;
            }
            GameObject SnareObj = ResourceManager.InstantiateResource("Prefab/Model/SnareRoot", initData.m_ServerID.ToString()) as GameObject;

            if (null != SnareObj)
            {
                //加载逻辑体,同时异步加载渲染体
                Obj_Snare objSnare = SnareObj.AddComponent <Obj_Snare>();;

                if (objSnare.Init(initData))
                {
                    objSnare.CanLogic = true;
                    Singleton <ObjManager> .Instance.AddPoolObj(objSnare.ServerID.ToString(), objSnare);
                }
                //ReloadModel(SnareObj, charModel.ResPath, AsycSnareObjOver, initData);
                LoadModelToRoot(nCharModelID, EResourceType.CharacterModel, LoadModelComplete, SnareObj, charModel, null);
            }
        }
Exemplo n.º 30
0
        public bool Init()
        {
            m_UIRoot = GameObject.Find("UI Root");
            if (null == m_UIRoot)
            {
                LogModule.WarningLog("can not find uiroot in curscene");
            }
            else
            {
                if (null == m_UIRoot.GetComponent <UIManager>())
                {
                    m_UIRoot.AddComponent <UIManager>();
                }
            }

            GameObject sceneEffect = new GameObject("SceneEffect");

            Utils.ResetTransform(sceneEffect.transform);
            m_sceneEffect = sceneEffect.AddComponent <SceneEffectBehaviourController>();
            m_sceneEffect.InitEffect(sceneEffect);

            if ((int)Games.GlobeDefine.GameDefine_Globe.SCENE_DEFINE.SCENE_LOGIN != GameManager.gameManager.RunningScene)
            {
                SceneInit();
            }

            else
            {
                FakeObjRoot = GameObject.Find("FakeObjRoot");
                if (FakeObjRoot == null)
                {
                    FakeObjRoot = ResourceManager.InstantiateResource("Prefab/HeadInfo/FakeObjRoot") as GameObject;
                    FakeObjRoot.SetActive(false);
                }
            }

            return(true);
        }