Beispiel #1
0
    public void Init(ItemInfo i)
    {
        //Debug.Log("the id:"+i.id);
        //Debug.Log("the icon:"+ GameDataMgr.GetInstance().GetItemInfo(i.id).icon);
        GetControl <Image>("item").sprite = ResMgr.GetInstance().Load <Sprite>("icon/" + GameDataMgr.GetInstance().GetItemInfo(i.id).icon);
        GetControl <Text>("itemNum").text = "数量:" + i.nums;
        item = GameDataMgr.GetInstance().GetItemInfo(i.id);

        EventTrigger trigger = gameObject.AddComponent <EventTrigger>();

        #region PointerEnter
        //UnityAction<BaseEventData> enter = new UnityAction<BaseEventData>(PointerEnter);
        //EventTrigger.Entry myenter = new EventTrigger.Entry();
        //myenter.eventID = EventTriggerType.PointerEnter;
        //myenter.callback.AddListener(enter);
        //trigger.triggers.Add(myenter);
        #endregion
        #region PointerExit

        EventTrigger.Entry myexit = new EventTrigger.Entry();
        myexit.eventID = EventTriggerType.PointerExit;
        myexit.callback.AddListener(PointerExit);
        trigger.triggers.Add(myexit);
        #endregion
        #region NewPointEnter
        EventTrigger.Entry newEnter = new EventTrigger.Entry();
        newEnter.eventID = EventTriggerType.PointerEnter;
        newEnter.callback.AddListener(PointerEnter);
        trigger.triggers.Add(newEnter);
        #endregion
    }
Beispiel #2
0
    /// <summary>
    /// 根据道具信息初始化 格子信息
    /// </summary>
    public void InitInfo(ItemInfo info)
    {
        this._itemInfo = info;
        if (info == null)
        {
            imgIcon.gameObject.SetActive(false);
            return;
        }
        GetControl <Image>("imgIcon").gameObject.SetActive(true);
        //根据道具信息,更新格子对象
        print("得到了id" + info.id + "  " + info.num);
        Item itemData = GameDataMgr.GetInstance().GetItemInfo(info.id);

        //使用我们的道具表中的数据
        GetControl <Image>("imgIcon").sprite = ResMgr.GetInstance().Load <Sprite>("Icon/" + itemData.icon);
        if (type == E_Item_Type.Bag)
        {
            //数量
            GetControl <Text>("txtNum").text = info.num.ToString();
        }
        //只要装备才可以进行拖动
        if (itemData.type == (int)E_Bag_Type.Equip)
        {
            OpenDragEvent();
        }
    }
Beispiel #3
0
    public static uint GetGuideLevelHeroTypeBtMobaHeroType(int mobaHeroType)
    {
        uint globeValue  = GameDataMgr.GetGlobeValue(RES_GLOBAL_CONF_TYPE.RES_GLOBAL_CONF_TYPE_NEWBIE_RECOMMEND_HEROTYPE1);
        uint globeValue2 = GameDataMgr.GetGlobeValue(RES_GLOBAL_CONF_TYPE.RES_GLOBAL_CONF_TYPE_NEWBIE_RECOMMEND_HEROTYPE2);
        uint globeValue3 = GameDataMgr.GetGlobeValue(RES_GLOBAL_CONF_TYPE.RES_GLOBAL_CONF_TYPE_NEWBIE_RECOMMEND_HEROTYPE3);

        switch (mobaHeroType + 1)
        {
        case 0:
        case 1:
        case 2:
            return(globeValue);

        case 3:
            return(globeValue3);

        case 4:
        case 5:
            return(globeValue);

        case 6:
            return(globeValue2);

        case 7:
            return(globeValue3);

        default:
            return(globeValue);
        }
    }
Beispiel #4
0
 // Use this for initialization
 void Start()
 {
     GameDataMgr.GetInstance().Init();
     //Debug.Log("item 1: "+GameDataMgr.GetInstance().GetItemInfo(1).name);
     //MusicMgr.GetInstance().PlayBGMusic("back01");//当前音乐格式不对
     UIManager.GetInstance().ShowPanel <MainPanel>("MainPanel", E_UI_Layer.Mid);
 }
    public bool isAttackable(int posX, int posY)
    {
        GameDataMgr mgr = GameDataMgr.GetInstance();

        for (int i = -1; i <= 1; i++)
        {
            for (int j = -1; j <= 1; j++)
            {
                if (i != 0 || j != 0)
                {
                    int nx = posX + i;
                    int ny = posY + j;
                    if (nx < 0 || nx >= mgr.row || ny < 0 || ny >= mgr.col || mgr.map[(int)nx, (int)ny] != 0)
                    {
                        continue;
                    }
                    else if (mgr.hasPeople(nx, ny) != -1)
                    {
                        return(true);
                    }
                }
            }
        }
        return(false);
    }
Beispiel #6
0
        public static bool IsCanBuy(uint heroId, uint skinId)
        {
            ResHeroSkin heroSkin = CSkinInfo.GetHeroSkin(heroId, skinId);

            if (heroSkin == null)
            {
                return(false);
            }
            if (!GameDataMgr.IsSkinAvailableAtShop(heroSkin.dwID))
            {
                return(false);
            }
            ResSkinPromotion resSkinPromotion = new ResSkinPromotion();
            stPayInfoSet     stPayInfoSet     = default(stPayInfoSet);

            resSkinPromotion = CSkinInfo.GetSkinPromotion(heroSkin.dwID);
            if (resSkinPromotion != null)
            {
                stPayInfoSet = CMallSystem.GetPayInfoSetOfGood(false, 0u, resSkinPromotion.bIsBuyCoupons > 0, resSkinPromotion.dwBuyCoupons, resSkinPromotion.bIsBuyDiamond > 0, resSkinPromotion.dwBuyDiamond, 10000u);
            }
            else
            {
                stPayInfoSet = CMallSystem.GetPayInfoSetOfGood(heroSkin);
            }
            return(stPayInfoSet.m_payInfoCount > 0);
        }
Beispiel #7
0
 /// <summary>
 /// 买商品
 /// </summary>
 public void BuyItem()
 {
     print("查看数据1" + info.priceType);
     print("查看数据2" + GameDataMgr.GetInstance().playerInfo.money);
     print("查看数据3" + info.price);
     //判断钱够不够
     if (info.priceType == 1 && GameDataMgr.GetInstance().playerInfo.money >= info.price)
     {
         //数据添加到玩家背包
         GameDataMgr.GetInstance().playerInfo.AddItem(info.itemInfo);
         EventCenter.GetInstance().EventTrigger <int>("MoneyChange", -info.price);
         TipMgr.GetInstance().ShowOneTipPanel("用金币购买成功");
     }
     //判断宝石够不够
     else if (info.priceType == 2 && GameDataMgr.GetInstance().playerInfo.gem >= info.price)
     {
         //数据添加到玩家背包
         GameDataMgr.GetInstance().playerInfo.AddItem(info.itemInfo);
         EventCenter.GetInstance().EventTrigger <int>("GemChange", -info.price);
         TipMgr.GetInstance().ShowOneTipPanel("用宝石购买成功");
     }
     //货币不足
     else
     {
         print("查看现在是不是没钱了");
         //这个panel就是OneBtnTipPanel所创建的对象,所以可以通过这个调用内部的方法,panel是在Uimanager里面创建并传过来的
         UIManager.GetInstance().ShowPanel <OneBtnTipPanel>("BuyTipPanel", E_UI_Layer.Top, (panel) =>
         {
             panel.InitTipText("钱不够了");
         });
     }
 }
Beispiel #8
0
 public override void updateTxt(string data)
 {
     GameDataMgr.inst().setLanguageTxt(transform.Find("btn_restart").Find("Text").GetComponent <Text>(), 9);
     GameDataMgr.inst().setLanguageTxt(transform.Find("btn_contine").Find("Text").GetComponent <Text>(), 10);
     GameDataMgr.inst().setLanguageTxt(transform.Find("btn_home").Find("Text").GetComponent <Text>(), 8);
     //	 GameDataMgr.inst().setLanguageTxt(transform.Find("btn_language").Find("Text").GetComponent<Text>(),16);
 }
Beispiel #9
0
    void Init()
    {
        Player p = GameDataMgr.GetInstance().GetPlayerInfo();

        for (int i = 0; i < p.items.Count; i++)
        {
            ItemCell temp = ResMgr.GetInstance().Load <GameObject>("UI/ItemCell").GetComponent <ItemCell>();

            temp.transform.SetParent(content);

            temp.transform.localScale = Vector3.one;
            temp.Init(p.items[i]);
        }
        for (int i = 0; i < p.equips.Count; i++)
        {
            ItemCell temp = ResMgr.GetInstance().Load <GameObject>("UI/ItemCell").GetComponent <ItemCell>();
            temp.transform.SetParent(content);
            temp.transform.localScale = Vector3.one;
            temp.Init(p.equips[i]);
        }
        for (int i = 0; i < p.gems.Count; i++)
        {
            ItemCell temp = ResMgr.GetInstance().Load <GameObject>("UI/ItemCell").GetComponent <ItemCell>();
            temp.transform.SetParent(content);
            temp.transform.localScale = Vector3.one;
            temp.Init(p.gems[i]);
        }
    }
    public static uint GetGuideLevelHeroTypeBtMobaHeroType(int mobaHeroType)
    {
        uint globeValue  = GameDataMgr.GetGlobeValue(284);
        uint globeValue2 = GameDataMgr.GetGlobeValue(285);
        uint globeValue3 = GameDataMgr.GetGlobeValue(286);

        switch (mobaHeroType + 1)
        {
        case 0:
        case 1:
        case 2:
            return(globeValue);

        case 3:
            return(globeValue3);

        case 4:
        case 5:
            return(globeValue);

        case 6:
            return(globeValue2);

        case 7:
            return(globeValue3);

        default:
            return(globeValue);
        }
    }
Beispiel #11
0
 private void ResetSkinList()
 {
     this.m_skinList.Clear();
     Dictionary <long, object> .Enumerator enumerator = GameDataMgr.heroSkinDatabin.GetEnumerator();
     while (enumerator.MoveNext())
     {
         KeyValuePair <long, object> current = enumerator.get_Current();
         ResHeroSkin resHeroSkin             = current.get_Value() as ResHeroSkin;
         if (resHeroSkin != null && resHeroSkin.dwSkinID != 0u && GameDataMgr.IsSkinAvailableAtShop(resHeroSkin.dwID))
         {
             ResHeroCfgInfo dataByKey = GameDataMgr.heroDatabin.GetDataByKey(resHeroSkin.dwHeroID);
             if (dataByKey != null && GameDataMgr.IsHeroAvailable(dataByKey.dwCfgID))
             {
                 CMallItem cMallItem = new CMallItem(resHeroSkin.dwHeroID, resHeroSkin.dwSkinID, CMallItem.IconType.Normal);
                 if (this.m_heroJobType == enHeroJobType.All || dataByKey.bMainJob == (byte)this.m_heroJobType || dataByKey.bMinorJob == (byte)this.m_heroJobType)
                 {
                     if (this.m_notOwnFlag)
                     {
                         if (!cMallItem.Owned(false))
                         {
                             this.m_skinList.Add(resHeroSkin);
                         }
                     }
                     else
                     {
                         this.m_skinList.Add(resHeroSkin);
                     }
                 }
             }
         }
     }
 }
Beispiel #12
0
 private void Reset()
 {
     this.m_enLastEventPriority = CRecordUseSDK.RECORD_EVENT_PRIORITY.RECORD_EVENT_TYPE_INVALID;
     this.m_lLastEventStartTime = 0L;
     this.m_lLastEventEndTime   = 0L;
     this.m_lGameStartTime      = 0L;
     this.m_lGameEndTime        = 0L;
     this.m_iContinuKillMaxNum  = -1;
     this.m_bIsStartRecordOk    = false;
     this.m_bIsMvp                   = false;
     this.m_iHostPlaterKillNum       = 0;
     this.m_iHostPlaterDeadNum       = 0;
     this.m_iHostPlaterAssistNum     = 0;
     this.m_bIsCallGameJoyGenerate   = false;
     this.m_bIsCallStopGameJoyRecord = false;
     this.m_lVideoTimeLen            = 0L;
     if (this.m_hostActor)
     {
         this.m_hostActor.Release();
     }
     if (this.m_stRecordInfo != null)
     {
         this.m_stRecordInfo.Clear();
     }
     this.m_uiEventStartTimeInterval            = GameDataMgr.GetGlobeValue(219) * 1000u;
     this.m_uiEventEndTimeInterval              = GameDataMgr.GetGlobeValue(249) * 1000u;
     this.m_uiEventNumMax                       = GameDataMgr.GetGlobeValue(220);
     this.m_ui543KillEventTotalTime             = GameDataMgr.GetGlobeValue(221) * 1000u;
     this.m_ui210KillEventTotalTime             = GameDataMgr.GetGlobeValue(256) * 1000u;
     this.m_uiMinSpaceLimit                     = GameDataMgr.GetGlobeValue(231);
     this.m_uiOnceDoubleEventTimeIntervalReduce = GameDataMgr.GetGlobeValue(248) * 1000u;
 }
    public static void RefreshRecommendTips()
    {
        CUIFormScript form = Singleton <CUIManager> .get_instance().GetForm(CRoleRegisterSys.s_heroTypeSelectFormPath);

        CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

        if (form != null && masterRoleInfo != null)
        {
            GameObject obj = null;
            if (masterRoleInfo.acntMobaInfo.bMobaUsedType == 1)
            {
                uint guideLevelHeroTypeBtMobaHeroType = CRoleRegisterView.GetGuideLevelHeroTypeBtMobaHeroType(masterRoleInfo.acntMobaInfo.iRecommendHeroType);
                if (guideLevelHeroTypeBtMobaHeroType == GameDataMgr.GetGlobeValue(284))
                {
                    obj = form.GetWidget(0).transform.FindChild("TuiJian").gameObject;
                }
                else if (guideLevelHeroTypeBtMobaHeroType == GameDataMgr.GetGlobeValue(285))
                {
                    obj = form.GetWidget(1).transform.FindChild("TuiJian").gameObject;
                }
                else if (guideLevelHeroTypeBtMobaHeroType == GameDataMgr.GetGlobeValue(286))
                {
                    obj = form.GetWidget(2).transform.FindChild("TuiJian").gameObject;
                }
            }
            else if (masterRoleInfo.acntMobaInfo.bMobaUsedType == 2)
            {
                obj = form.GetWidget(0).transform.FindChild("TuiJian").gameObject;
            }
            obj.CustomSetActive(true);
        }
    }
Beispiel #14
0
    void OnGUI()
    {
        GUIStyle style = new GUIStyle
        {
            border    = new RectOffset(10, 10, 10, 10),
            fontSize  = 50,
            fontStyle = FontStyle.BoldAndItalic,
        };


        int         peo_total = 0;
        int         peo_alive = 0;
        GameDataMgr dataMgr   = GameDataMgr.GetInstance();

        //获得存活人数和总人数
        foreach (int id in dataMgr.playerInfos.Keys)
        {
            //print(id);
            peo_total += 1;
            if ((bool)dataMgr.playerInfos[id].alive.Equals(true))
            {
                peo_alive += 1;
            }
        }


        //自定义宽度 ,高度大小 颜色,style
        GUI.Label(new Rect(10, 10, 200, 20), "<color=#00ff00><size=20>" + "Alive:" + peo_alive.ToString() + "</size></color>" +
                  "<color=#00ff00><size=20>" + " / Total:" + peo_total.ToString() + "</size></color>", style);
        GUI.Label(new Rect(10, 30, 200, 20), "<color=#00ff00><size=20>" + "FPS:" + fps.ToString("f2") + "</size></color>", style);
    }
        private void Open_ThirdBattleEntry(CUIEvent uiEvt)
        {
            this.m_selectMapID  = uiEvt.m_eventParams.tagUInt;
            this.m_selectMapRes = GameDataMgr.uinionBattleLevelDatabin.GetDataByKey(this.m_selectMapID);
            GameDataMgr.matchTimeInfoDict.TryGetValue(GameDataMgr.GetDoubleKey(5, this.m_selectMapID), out this.m_selectTimeInfo);
            switch (uiEvt.m_eventParams.tag)
            {
            case 0:
            case 1:
                if (uiEvt.m_eventParams.commonBool)
                {
                    CUIFormScript script = Singleton <CUIManager> .GetInstance().OpenForm(UNION_ENTRY_THIRD_PATH, false, true);

                    this.initThirdFormWidget();
                    SendAwartPoolReq(this.m_selectMapID);
                    break;
                }
                Singleton <CUIManager> .instance.OpenTips("Union_Battle_Tips15", true, 1f, null, new object[0]);

                return;

            case 2:
                Singleton <CUIManager> .instance.OpenTips("Union_Battle_Tips3", true, 1f, null, new object[0]);

                break;
            }
        }
        private uint GetTimeToCD(RES_CHANGE_NAME_TYPE changeType)
        {
            CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

            if (masterRoleInfo != null)
            {
                DateTime dateTime = Utility.ToUtcTime2Local((long)CRoleInfo.GetCurrentUTCTime());
                DateTime dateTime2;
                uint     globeValue;
                if (changeType != RES_CHANGE_NAME_TYPE.RES_CHANGE_NAME_TYPE_PLAYER)
                {
                    if (changeType != RES_CHANGE_NAME_TYPE.RES_CHANGE_NAME_TYPE_GUILD)
                    {
                        return(0u);
                    }
                    dateTime2  = Utility.ToUtcTime2Local((long)((ulong)masterRoleInfo.chgNameCD.dwLastChgGuildNameTime));
                    globeValue = GameDataMgr.GetGlobeValue(RES_GLOBAL_CONF_TYPE.RES_GLOBAL_CONF_TYPE_CHG_GUILD_NAME_CD);
                }
                else
                {
                    dateTime2  = Utility.ToUtcTime2Local((long)((ulong)masterRoleInfo.chgNameCD.dwLastChgPlayerNameTime));
                    globeValue = GameDataMgr.GetGlobeValue(RES_GLOBAL_CONF_TYPE.RES_GLOBAL_CONF_TYPE_CHG_PLAYER_NAME_CD);
                }
                uint dwConfValue = GameDataMgr.globalInfoDatabin.GetDataByKey(10u).dwConfValue;
                int  num         = Utility.Hours2Second((int)(dwConfValue / 100u)) + Utility.Minutes2Seconds((int)(dwConfValue % 100u));
                dateTime  = dateTime.AddSeconds(-(double)num).get_Date();
                dateTime2 = dateTime2.AddSeconds(-(double)num).get_Date();
                int days = (dateTime - dateTime2).get_Days();
                return((uint)(((long)days >= (long)((ulong)globeValue)) ? 0uL : ((ulong)globeValue - (ulong)((long)days))));
            }
            return(0u);
        }
Beispiel #17
0
    // Update is called once per frame
    void Update()
    {
        foreach (int id in playerMap.Keys)
        {
            //GameObject player_obj = playerMap[id];

            GameObject player_obj = GameObject.Find("player_" + id);
            Player     player     = GameDataMgr.GetInstance().playerInfos[id];
            float      x          = (float)(-(row - 1) / 2.0f + player.posX);
            float      y          = (float)(-(col - 1) / 2.0f + player.posY);
            //Debug.Log($"{x},{y},{player.posX},{player.posY}");
            player_obj.transform.position = new Vector3(y, 0, -x);
            //player_obj.transform.position = new Vector3((float)(player.posY),0,(float)-player.posX);
        }
        GameDataMgr dataMgr = GameDataMgr.GetInstance();

        if (dataMgr.restart)
        {
            dataMgr.restart = false;
            string[,] map   = dataMgr.loadedMap;
            row             = dataMgr.row;
            col             = dataMgr.col;
            GameObject pfb_forest = Resources.Load("FreeDimensionForge/LowPolyEnvironmentsPack/Art/ForestEnvironmentPack/Prefabs/forest") as GameObject;
            for (int i = 0; i < row; i++)
            {
                for (int j = 0; j < col; j++)
                {
                    if (map[i, j] == "t" && dataMgr.map[i, j] == 0)
                    {
                        String     name     = "empty_" + i.ToString() + "_" + j.ToString();
                        GameObject toDelete = GameObject.Find(name);
                        dataMgr.forest[(i, j)] = 1;
Beispiel #18
0
        public static bool IsCanBuy(uint heroId, uint skinId)
        {
            ResHeroSkin heroSkin = GetHeroSkin(heroId, skinId);

            if (heroSkin == null)
            {
                return(false);
            }
            if (!GameDataMgr.IsSkinAvailableAtShop(heroSkin.dwID))
            {
                return(false);
            }
            ResSkinPromotion skinPromotion    = new ResSkinPromotion();
            stPayInfoSet     payInfoSetOfGood = new stPayInfoSet();

            skinPromotion = GetSkinPromotion(heroSkin.dwID);
            if (skinPromotion != null)
            {
                payInfoSetOfGood = CMallSystem.GetPayInfoSetOfGood(false, 0, skinPromotion.bIsBuyCoupons > 0, skinPromotion.dwBuyCoupons, skinPromotion.bIsBuyDiamond > 0, skinPromotion.dwBuyDiamond, 0x2710);
            }
            else
            {
                payInfoSetOfGood = CMallSystem.GetPayInfoSetOfGood(heroSkin);
            }
            return(payInfoSetOfGood.m_payInfoCount > 0);
        }
Beispiel #19
0
        public void Init(GameObject objPanelEnemyHeroAtk)
        {
            SLevelContext curLvelContext = Singleton <BattleLogic> .instance.GetCurLvelContext();

            if (curLvelContext != null && curLvelContext.IsMobaMode())
            {
                this.m_bIsMobaMode = true;
                Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.Battle_EnemyHeroAtkBtn_Down, new CUIEventManager.OnUIEventHandler(this.OnEnemyHeroAtkBtnDown));

                Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.Battle_EnemyHeroAtkBtn_Up, new CUIEventManager.OnUIEventHandler(this.OnEnemyHeroAtkBtnUp));

                Singleton <EventRouter> .GetInstance().AddEventHandler <uint, bool>("ActorVisibleToHostPlayerChnage", new Action <uint, bool>(this.OnActorVisibleToHostPlayerChance));

                Singleton <EventRouter> .GetInstance().AddEventHandler <PoolObjHandle <ActorRoot>, int, int>("HeroHpChange", new Action <PoolObjHandle <ActorRoot>, int, int>(this.OnHeroHpChange));

                Singleton <GameEventSys> .instance.AddEventHandler <DefaultGameEventParam>(GameEventDef.Event_ActorRevive, new RefAction <DefaultGameEventParam>(this.OnActorRevive));

                Singleton <GameEventSys> .instance.AddEventHandler <DefaultGameEventParam>(GameEventDef.Event_FightStart, new RefAction <DefaultGameEventParam>(this.OnFightStart));

                Singleton <GameEventSys> .instance.AddEventHandler <DefaultGameEventParam>(GameEventDef.Event_CaptainSwitch, new RefAction <DefaultGameEventParam>(this.OnCaptainSwitched));

                this.m_objPanelEnemyHeroAtk = objPanelEnemyHeroAtk;
                this.m_hostActor            = Singleton <GamePlayerCenter> .instance.GetHostPlayer().Captain;

                this.m_iEnemyDistanceMax = (int)GameDataMgr.GetGlobeValue(RES_GLOBAL_CONF_TYPE.RES_GLOBAL_CONF_TYPE_ENEMYATKBTN_ENEMYDISTANCEMAX);
                int globeValue = (int)GameDataMgr.GetGlobeValue(RES_GLOBAL_CONF_TYPE.RES_GLOBAL_CONF_TYPE_HORIZON_RADIUS);
                this.m_iEnemyDistanceMax             = ((this.m_iEnemyDistanceMax < globeValue) ? this.m_iEnemyDistanceMax : globeValue);
                this.m_iCurTargetEnemyBtnIndex       = -1;
                this.m_iLastTargetEnemyBtnIndex      = -1;
                this.m_iLastSkillTargetEnemyBtnIndex = -1;
                this.m_bLastSkillUsed = true;
            }
        }
Beispiel #20
0
        public void ClearLogicData()
        {
            Singleton <CRoleInfoManager> .get_instance().ClearMasterRoleInfo();

            Singleton <CAdventureSys> .GetInstance().Clear();

            Singleton <CMatchingSystem> .GetInstance().Clear();

            Singleton <CRoomSystem> .GetInstance().Clear();

            Singleton <CSymbolSystem> .GetInstance().Clear();

            Singleton <ActivitySys> .GetInstance().Clear();

            Singleton <CFriendContoller> .get_instance().ClearAll();

            Singleton <CChatController> .get_instance().ClearAll();

            Singleton <BurnExpeditionController> .get_instance().ClearAll();

            Singleton <InBattleMsgMgr> .get_instance().ClearData();

            if (MonoSingleton <NewbieGuideManager> .HasInstance())
            {
                MonoSingleton <NewbieGuideManager> .get_instance().StopCurrentGuide();

                MonoSingleton <NewbieGuideManager> .ClearDestroy();
            }
            Singleton <CMailSys> .get_instance().Clear();

            Singleton <CTaskSys> .get_instance().Clear();

            Singleton <CGuildSystem> .GetInstance().Clear();

            Singleton <CGuildMatchSystem> .GetInstance().Clear();

            GameDataMgr.ClearServerResData();
            Singleton <CMallFactoryShopController> .GetInstance().Clear();

            Singleton <RankingSystem> .GetInstance().ClearAll();

            Singleton <CLobbySystem> .GetInstance().Clear();

            Singleton <CUnionBattleRankSystem> .GetInstance().Clear();

            Singleton <HeadIconSys> .get_instance().Clear();

            Singleton <CLoudSpeakerSys> .get_instance().Clear();

            Singleton <COBSystem> .get_instance().Clear();

            Singleton <CInviteSystem> .get_instance().Clear();

            Singleton <CArenaSystem> .get_instance().Clear();

            Singleton <SCModuleControl> .get_instance().Clear();

            MonoSingleton <IDIPSys> .GetInstance().ClearIDIPData();
        }
Beispiel #21
0
 public void showAtion(int languageID)
 {
     gameObject.SetActive(true);
     GameDataMgr.inst().setLanguageTxt(txt, languageID);
     gameObject.SetActive(true);
     transform.localPosition = oriPos;
     startAtion();
 }
Beispiel #22
0
 public override void updateTxt(string data)
 {
     GameDataMgr.inst().setLanguageTxt(transform.Find("addItemBtn").Find("adsImg").Find("txt").GetComponent <Text>(), 5);
     GameDataMgr.inst().setLanguageTxt(transform.Find("bigItemBtn").Find("adsImg").Find("txt").GetComponent <Text>(), 5);
     GameDataMgr.inst().setLanguageTxt(transform.Find("lightItemBtn").Find("adsImg").Find("txt").GetComponent <Text>(), 5);
     GameDataMgr.inst().setLanguageTxt(transform.Find("dogItemBtn").Find("adsImg").Find("txt").GetComponent <Text>(), 5);
     GameDataMgr.inst().setLanguageTxt(transform.parent.transform.Find("btn_addSpeed").Find("Image").Find("Text").GetComponent <Text>(), 6);
 }
Beispiel #23
0
 // Start is called before the first frame update
 void Start()
 {
     GameDataMgr.GetInstance().Init();
     Debug.Log(GameDataMgr.GetInstance().GetItemInfo(1).name);
     BagMgr.GetInstance().Init();
     //显示主面板
     UIManager.GetInstance().ShowPanel <MainPanel>("MainPanel", E_UI_Layer.Bot);
 }
Beispiel #24
0
    void Update()
    {
        obj   = this.transform.parent.parent.gameObject;
        Oname = obj.name;

        GameDataMgr mgr = GameDataMgr.GetInstance();

        Oname    = Oname.Split('_')[1];
        id       = int.Parse(Oname);
        thirsty  = (float)mgr.playerInfos[id].thirsty;
        starving = (float)mgr.playerInfos[id].starving;
        if (thirsty == 0 && starving != 0)
        {
            // HEALTH.value -= Time.deltaTime / 1f;
            // GameDataMgr.GetInstance().playerInfos[0].health = (float)HEALTH.value;
            mgr.playerInfos[id].health -= Time.deltaTime / 1f;
            mgr.playerInfos[id].health  = Math.Max(0, mgr.playerInfos[id].health);
            HEALTH.value = (float)mgr.playerInfos[id].health;
        }
        if (thirsty != 0 && starving != 0)
        {
            // HEALTH.value = 100;
            // GameDataMgr.GetInstance().playerInfos[0].health = (float)HEALTH.value;
            if (thirsty >= 70 && starving >= 70)
            {
                mgr.playerInfos[id].health += Time.deltaTime / 0.2f;
                if (mgr.playerInfos[id].health > 100)
                {
                    mgr.playerInfos[id].health = 100;
                }
            }

            HEALTH.value = (float)mgr.playerInfos[id].health;
        }
        if (thirsty != 0 && starving == 0)
        {
            // HEALTH.value -= Time.deltaTime / 0.6f;
            // GameDataMgr.GetInstance().playerInfos[0].health = (float)HEALTH.value;
            mgr.playerInfos[id].health -= Time.deltaTime / 0.6f;
            mgr.playerInfos[id].health  = Math.Max(0, mgr.playerInfos[id].health);
            HEALTH.value = (float)mgr.playerInfos[id].health;
        }
        if (thirsty == 0 && starving == 0)
        {
            // HEALTH.value -= Time.deltaTime / 0.3f;
            // GameDataMgr.GetInstance().playerInfos[0].health = (float)HEALTH.value;
            mgr.playerInfos[id].health -= Time.deltaTime / 0.3f;
            mgr.playerInfos[id].health  = Math.Max(0, mgr.playerInfos[id].health);
            HEALTH.value = (float)mgr.playerInfos[id].health;
        }
        if (mgr.playerInfos[id].health <= 0)
        {
            GameDataMgr.GetInstance().playerInfos[id].alive = false;
        }
        // Debug.Log($"{thirsty},{starving}");
        // Debug.Log(HEALTH.value);
    }
Beispiel #25
0
 void OnEnable()
 {
     GameMgr.inst().myEvent += updateTxt;
     if (preLanguageId != GameDataMgr.inst().languageID)
     {
         updateTxt("");
         preLanguageId = GameDataMgr.inst().languageID;
     }
 }
Beispiel #26
0
    /// <summary>
    /// 页签切换的函数
    /// </summary>
    /// <param name="type"></param>
    public void ChangeType(E_Bag_Type type)
    {
        //默认值是道具列表信息
        List <ItemInfo> tempInfo = GameDataMgr.GetInstance().playerInfo.items;

        switch (type)
        {
        case E_Bag_Type.Equip:
            tempInfo = GameDataMgr.GetInstance().playerInfo.equips;
            break;

        case E_Bag_Type.Gem:
            tempInfo = GameDataMgr.GetInstance().playerInfo.gems;
            break;
        }
        //更新前先删除之前的格子
        for (int i = 0; i < list.Count; i++)
        {
            Destroy(list[i].gameObject);
        }
        list.Clear();
        temp_items.Clear();

        int      totalNum  = 0;
        ItemInfo item_info = new ItemInfo();

        for (int i = 0; i < tempInfo.Count; i++)
        {
            if (temp_items.ContainsKey(tempInfo[i].id))
            {
                totalNum += tempInfo[i].num;
                temp_items[tempInfo[i].id] = new ItemInfo()
                {
                    id = tempInfo[i].id, num = totalNum
                };
            }
            else
            {
                totalNum = tempInfo[i].num;
                temp_items.Add(tempInfo[i].id, new ItemInfo()
                {
                    id = tempInfo[i].id, num = totalNum
                });
            }
        }
        //更新现在的数据
        //动态创建 ItemCell 预设体 并且将它存放到list里面
        foreach (var item in temp_items)
        {
            ItemCell cell = ResMgr.GetInstance().Load <GameObject>("UI/ItemCell").GetComponent <ItemCell>();
            cell.transform.parent     = content;
            cell.transform.localScale = Vector3.one;
            cell.InitInfo(temp_items[item.Key]);
            list.Add(cell);
        }
    }
        public CMallMysteryProduct GetProduct(uint itemType, uint itemID)
        {
            CMallMysteryProduct product = new CMallMysteryProduct();

            if (this.m_ProductDic.TryGetValue(GameDataMgr.GetDoubleKey(itemType, itemID), out product))
            {
                return(product);
            }
            return(null);
        }
Beispiel #28
0
    public override void updateTxt(string data)
    {
        GameDataMgr.inst().setLanguageTxt(transform.Find("endlessBtn").Find("Text").GetComponent <Text>(), 2);
        GameDataMgr.inst().setLanguageTxt(transform.Find("shopBtn").Find("Text").GetComponent <Text>(), 4);

        GameDataMgr.inst().setLanguageTxt(transform.Find("signBtn").Find("Text").GetComponent <Text>(), 3);

        GameDataMgr.inst().setLanguageTxt(transform.Find("normalBtn").Find("Text").GetComponent <Text>(), 26);
        GameDataMgr.inst().setLanguageTxt(transform.Find("ballBtn").Find("Text").GetComponent <Text>(), 25);
    }
Beispiel #29
0
 static public int ClearAllData_s(IntPtr l)
 {
     try {
         GameDataMgr.ClearAllData();
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
        private void OnBuyItem(CUIEvent uiEvent)
        {
            enPayType     tag           = (enPayType)uiEvent.m_eventParams.tag;
            uint          payValue      = uiEvent.m_eventParams.commonUInt32Param1;
            string        goodName      = string.Empty;
            COM_ITEM_TYPE com_item_type = COM_ITEM_TYPE.COM_OBJTYPE_NULL;
            uint          uniSkinId     = 0;
            long          key           = 0L;

            if (uiEvent.m_eventParams.heroSkinParam.skinId != 0)
            {
                com_item_type = COM_ITEM_TYPE.COM_OBJTYPE_HEROSKIN;
                uniSkinId     = CSkinInfo.GetSkinCfgId(uiEvent.m_eventParams.heroSkinParam.heroId, uiEvent.m_eventParams.heroSkinParam.skinId);
                ResHeroSkin heroSkin = CSkinInfo.GetHeroSkin(uniSkinId);
                DebugHelper.Assert(heroSkin != null, string.Format("找不到皮肤{0}的配置信息", uniSkinId));
                if (heroSkin == null)
                {
                    return;
                }
                goodName = StringHelper.UTF8BytesToString(ref heroSkin.szSkinName);
            }
            else if (uiEvent.m_eventParams.heroId != 0)
            {
                com_item_type = COM_ITEM_TYPE.COM_OBJTYPE_HERO;
                uniSkinId     = uiEvent.m_eventParams.heroId;
                ResHeroCfgInfo dataByKey = GameDataMgr.heroDatabin.GetDataByKey(uniSkinId);
                DebugHelper.Assert(dataByKey != null, string.Format("找不到英雄{0}的配置信息", uniSkinId));
                if (dataByKey == null)
                {
                    return;
                }
                goodName = StringHelper.UTF8BytesToString(ref dataByKey.szName);
            }
            else
            {
                DebugHelper.Assert(false, "神秘商店购买不支持该物品类型");
                return;
            }
            key = GameDataMgr.GetDoubleKey((uint)com_item_type, uniSkinId);
            CMallMysteryProduct product = new CMallMysteryProduct();

            if (!this.m_ProductDic.TryGetValue(key, out product))
            {
                DebugHelper.Assert(false, string.Format("神秘商店找不到该物品{0}/{1}", Enum.GetName(typeof(COM_ITEM_TYPE), com_item_type), uniSkinId));
            }
            else
            {
                CUIEvent uIEvent = Singleton <CUIEventManager> .GetInstance().GetUIEvent();

                uIEvent.m_eventID         = enUIEventID.Mall_Mystery_On_Confirm_Buy_Item;
                uIEvent.m_eventParams.tag = (int)product.ID;
                CMallSystem.TryToPay(enPayPurpose.Buy, goodName, tag, payValue, uIEvent.m_eventID, ref uIEvent.m_eventParams, enUIEventID.None, false, true);
            }
        }