예제 #1
0
    System.Collections.IEnumerator IniProcedure(object obj)
    {
        LoadHeadTextTure();
        yield return(new WaitForEndOfFrame());

        m_Mask.Init();
        yield return(new WaitForEndOfFrame());

        m_GlobalHallUIObject.Add(m_HeadWind.Init());
        m_GlobalHallUIObject.Add(m_SettingWind.Init());
        m_GlobalHallUIObject.Add(m_FishSHow.Init());
        m_GlobalHallUIObject.Add(m_AboutOur.Init());
        m_GlobalHallUIObject.Add(m_TipBox_0.Init());
        m_Notice.InitObj();
        m_VipMgrLogic.Init();
        m_scale = m_Mask.BaseTranF.GetComponent <TweenScale>();
        if (m_scale.enabled)
        {
            m_scale.enabled = false;
        }
        yield return(new WaitForEndOfFrame());

        for (byte i = 0; i < FriendSysObj.Length; ++i)
        {
            m_FriendSysObj[i] = ResManager.Instance.LoadObject(string.Format("FriendSysWidget{0}", i), "ExtraRes/UI/Predab/FriendsSys/", ResType.ExtraRes, false);
        }
        for (byte j = 0; j < ShopSysObj.Length; ++j)
        {
            m_ShopSysObj[j] = ResManager.Instance.LoadObject(string.Format("ShopSysWndUI{0}", j), "ExtraRes/UI/Predab/ShopSys/", ResType.ExtraRes, false);
        }
        yield return(new WaitForEndOfFrame());

        m_GlobalUIObject[0] = ResManager.Instance.LoadObject("Account_Mgr_Wnd", "ExtraRes/UI/Predab/AccountMgr/", ResType.ExtraRes, false);
        m_GlobalUIObject[1] = ResManager.Instance.LoadObject("SystemTips_Dlg", "ExtraRes/UI/Predab/", ResType.ExtraRes, false);
        m_GlobalUIObject[2] = ResManager.Instance.LoadObject("Name_Card_Dlg", "ExtraRes/UI/Predab/NameCards/", ResType.ExtraRes, false);
        m_GlobalUIObject[3] = ResManager.Instance.LoadObject("Match_MsgBox", "ExtraRes/UI/Predab/", ResType.ExtraRes, false);
        m_GlobalUIObject[4] = ResManager.Instance.LoadObject("Show_RewardWnd", "ExtraRes/UI/Predab/", ResType.ExtraRes, false);

        m_GlobalUIObject[4] = ResManager.Instance.LoadObject("Show_RewardWnd", "ExtraRes/UI/Predab/", ResType.ExtraRes, false);

        m_GlobalUIObject[5] = ResManager.Instance.LoadObject("game_share", "ExtraRes/UI/Predab/", ResType.ExtraRes, false);

        m_objGiftBtneff = ResManager.Instance.LoadObject("UIEF_CharmClick", "ExtraRes/Effect/Prefabs/UIEFCharmClick/", ResType.ExtraRes, false);
        InitLogic.EndInit();
        yield break;
    }
예제 #2
0
    System.Collections.IEnumerator Initaudio(object dd)
    {
        for (byte i = 0; i < 9; i++)
        {
            Audio effectAudio = new Audio();
            effectAudio.AudioName = string.Format("bgm{0}", i);
            effectAudio.CreateAudioClip();
            m_listBGAudio.Add(effectAudio);
        }
        yield return(new WaitForEndOfFrame());

        for (byte o = 0; o <= 69; ++o)
        {
            Audio effectAudio = new Audio();
            effectAudio.AudioName = string.Format("0{0}", o);
            effectAudio.CreateAudioClip();
            if (effectAudio.MyAudioClip != null)
            {
                m_listOrdianryAudio.Add(effectAudio);
            }
            else
            {
                break;
            }
        }
        yield return(new WaitForEndOfFrame());

        for (byte s = 0; s < 10; ++s)
        {
            Audio effectAudio = new Audio();
            effectAudio.AudioName = string.Format("S{0}", s);
            effectAudio.CreateAudioClip();
            if (effectAudio.MyAudioClip != null)
            {
                m_listSkillAudio.Add(effectAudio);
            }
            else
            {
                break;
            }
        }
        InitLogic.EndInit();
        yield break;
    }
예제 #3
0
    System.Collections.IEnumerator InitProcedure(object objobj)
    {
        m_BoxObj  = ResManager.Instance.LoadObject("Box0", "FishRes/Prefab/", ResType.FishRes, false);
        m_CardObj = ResManager.Instance.LoadObject("FishCard", "FishRes/Prefab/", ResType.FishRes, false);

        for (byte i = 0; i < 30; ++i)
        {
            string fishid = "Fish" + i.ToString();
            Object obj    = ResManager.Instance.LoadObject(fishid, "FishRes/Prefab/", ResType.FishRes, false);
            if (obj == null)
            {
                m_FishObjList.Add(null);
                continue;
            }
            ++m_ValidCount;
            m_ValidMaxCount = i;
            m_FishObjList.Add(obj);
        }
        InitLogic.EndInit();
        yield break;
    }
예제 #4
0
    private static System.Collections.IEnumerator OnNewInit(object objd)
    {
        Object obj = ResManager.Instance.LoadObject("ServerSetting", "GlobalRes/ServerSetting/", ResType.GlobalRes, typeof(TextAsset));

        if (obj == null)
        {
            InitLogic.SetInitFailed();
            yield break;
        }
        TextAsset   ta  = obj as TextAsset;
        XmlDocument doc = new XmlDocument();

        doc.LoadXml(ta.text);
        XmlNode pConfig = doc.SelectSingleNode("Config");

        XmlNode verNode    = pConfig.SelectSingleNode("ServerVersion");
        XmlNode comboNode  = pConfig.SelectSingleNode("Combo");
        XmlNode energyNode = pConfig.SelectSingleNode("Energy");
        XmlNode cannonNode = pConfig.SelectSingleNode("Cannon");
        XmlNode skillNode  = pConfig.SelectSingleNode("Skill");
        XmlNode rateNode   = pConfig.SelectSingleNode("Rate");
        XmlNode fishNode   = pConfig.SelectSingleNode("Fish");
        XmlNode rankNode   = pConfig.SelectSingleNode("Rank");
        XmlNode dstNode    = pConfig.SelectSingleNode("FishDeadTime");

        if (verNode == null ||
            comboNode == null ||
            energyNode == null ||
            skillNode == null ||
            rateNode == null ||
            cannonNode == null ||
            fishNode == null ||
            rankNode == null ||
            dstNode == null)
        {
            LogMgr.Log("ServerSetting load failed.");
            InitLogic.SetInitFailed();
            yield break;
        }
        if (energyNode.ChildNodes.Count != cannonNode.ChildNodes.Count)
        {
            LogMgr.Log("energyNode<>cannonNode");
            InitLogic.SetInitFailed();
            yield break;
        }
        int nFishs      = 0;
        int nFishValues = 0;

        LauncherInfo [] plauncherinfo;


        yield return(new WaitForEndOfFrame());

        Attribute(verNode, "wonderful_base", ref ExtraSetting.WonderFulBase);
        /////Ver
        //Attribute(verNode, "maxfish", ref FishSetting.FISH_MAX_NUM);
        //Attribute(verNode, "maxbullet", ref BulletSetting.BULLET_MAX_NUM);

        /////Combo
        Attribute(comboNode, "sustain_time", ref DoubleHit.IntervalTime);
        Attribute(comboNode, "buff_cycle", ref DoubleHit.MaxTimes);

        ////Cannon
        int launcherCount = energyNode.ChildNodes.Count;

        plauncherinfo = new LauncherInfo[launcherCount];
        LauncherSetting.LauncherDataList = new LauncherData[launcherCount];
        for (int i = 0; i < launcherCount; ++i)//from energy
        {
            LauncherData ld = new LauncherData();

            XmlNode node = energyNode.ChildNodes[i];
            Attribute(node, "id", ref ld.ID);
            Attribute(node, "cditme", ref ld.LaserCDTime);
            Attribute(node, "speed", ref ld.LaserReduction.Speed);
            Attribute(node, "time1", ref ld.LaserReduction.Duration1);
            Attribute(node, "time2", ref ld.LaserReduction.Duration2);
            Attribute(node, "time3", ref ld.LaserReduction.Duration3);

            LauncherInfo Item = new LauncherInfo();
            Attribute(node, "mincatch", ref Item.nmincatch);
            Attribute(node, "maxcatch", ref Item.nmaxcatch);
            Attribute(node, "revise", ref Item.nrevise);
            Attribute(node, "energyratio", ref Item.denergyratio);



            if (LauncherSetting.LauncherDataList[ld.ID] != null)
            {
                LogMgr.Log("Exist the same launcher id.");
                InitLogic.SetInitFailed();
                yield break;
            }
            LauncherSetting.LauncherDataList[ld.ID] = ld;
            plauncherinfo[ld.ID] = Item;
        }
        yield return(new WaitForEndOfFrame());

        for (int i = 0; i < launcherCount; ++i)//from cannon
        {
            XmlNode node = cannonNode.ChildNodes[i];
            byte    byid = 0;
            Attribute(node, "id", ref byid);
            LauncherData ld = LauncherSetting.LauncherDataList[byid];

            ld.name = node.Attributes["name"].Value;
            Attribute(node, "launcherinterval", ref ld.Interval);
            Attribute(node, "consume", ref ld.Consume);
            Attribute(node, "bulletspeed", ref ld.Speed);
            Attribute(node, "itemid", ref ld.nItemid);
            Attribute(node, "itemcount", ref ld.nItemcount);
            Attribute(node, "skill", ref ld.nSkillBind);

            if (byid == (byte)LauncherType.LAUNCHER_4)//4号炮特有
            {
                Attribute(node, "speed", ref BulletSetting.FreezeBulletReduction.Speed);
                Attribute(node, "time1", ref BulletSetting.FreezeBulletReduction.Duration1);
                Attribute(node, "time2", ref BulletSetting.FreezeBulletReduction.Duration2);
                Attribute(node, "time3", ref BulletSetting.FreezeBulletReduction.Duration3);
            }
        }
        yield return(new WaitForEndOfFrame());

        /////SkillInfo
        int skillCount = skillNode.ChildNodes.Count;

        SkillSetting.SkillDataList = new SkillData[skillCount];
        for (int i = 0; i < skillCount; ++i)
        {
            SkillData sd   = new SkillData();
            XmlNode   node = skillNode.ChildNodes[i];
            Attribute(node, "id", ref sd.ID);
            sd.name = node.Attributes["name"].Value;
            Attribute(node, "cditme", ref sd.CDTime);
            Attribute(node, "goodsid", ref sd.ItemId);
            Attribute(node, "multiple", ref sd.multiple);
            Attribute(node, "speed", ref sd.Reduction.Speed);
            Attribute(node, "time1", ref sd.Reduction.Duration1);
            Attribute(node, "time2", ref sd.Reduction.Duration2);
            Attribute(node, "time3", ref sd.Reduction.Duration3);

            string szInfo = "";
            Attribute(node, "goodsconsume", ref szInfo);
            if (szInfo.Length > 0)
            {
                string[] pConsume = szInfo.Split(' ');
                for (int index = 0; index < pConsume.Length; index += 2)
                {
                    SkillConsume pskill = new SkillConsume();
                    pskill.byorder = System.Convert.ToByte(pConsume[index]);
                    pskill.byCount = System.Convert.ToByte(pConsume[index + 1]);
                    sd.NumRequire.Add(pskill);
                }
            }
            if (SkillSetting.SkillDataList[sd.ID] != null)
            {
                LogMgr.Log("Exist the same skill id.");
                InitLogic.SetInitFailed();
                yield break;
            }
            SkillSetting.SkillDataList[sd.ID] = sd;
        }
        yield return(new WaitForEndOfFrame());

        //Rate
        int rateCount = rateNode.ChildNodes.Count;

        BulletSetting.BulletRate = new ushort[rateCount];
        BulletSetting.RateUnlock = new ushort[rateCount];
        BulletSetting.RateReward = new ushort[rateCount];
        for (int i = 0; i < rateCount; ++i)
        {
            XmlNode node = rateNode.ChildNodes[i];
            byte    byid = 0;
            Attribute(node, "id", ref byid);
            Attribute(node, "value", ref BulletSetting.BulletRate[byid]);
            Attribute(node, "unlock", ref BulletSetting.RateUnlock[byid]);
            Attribute(node, "unlockreward", ref BulletSetting.RateReward[byid]);
        }

        //Fish
        int fishCount = fishNode.ChildNodes.Count;

        FishSetting.FishDataList = new FishData[fishCount];
        for (int i = 0; i < fishCount; ++i)
        {
            XmlNode  node = fishNode.ChildNodes[i];
            FishData fd   = new FishData();
            Attribute(node, "id", ref fd.ID);
            Attribute(node, "value", ref fd.Gold);
            fd.Name = node.Attributes["name"].Value;
            fd.Decl = node.Attributes["declare"].Value;
            if (FishSetting.FishDataList[fd.ID] != null)
            {
                LogMgr.Log("Exist the same fish id:" + fd.ID);
                InitLogic.SetInitFailed();
                yield break;
            }
            FishSetting.FishDataList[fd.ID] = fd;

            byte maxcount = 0;
            Attribute(node, "maxcount", ref maxcount);
            nFishs      += maxcount;
            nFishValues += maxcount * fd.Gold;
        }
        FishSetting.SortByGold();
        yield return(new WaitForEndOfFrame());

        //Rank
        int nRank = rankNode.ChildNodes.Count;

        Experience.Exp = new uint[nRank];
        for (int i = 0; i < nRank; i++)
        {
            XmlNode node = rankNode.ChildNodes[i];
            byte    byid = 0;
            Attribute(node, "id", ref byid);
            Attribute(node, "experience", ref Experience.Exp[byid]);
        }


        ///
        //FishDeadTime
        FishDeadTimeData ftd = new FishDeadTimeData();

        Attribute(dstNode, "TianZai_DouDong", ref ftd.TianZai_DouDong_Time);//float.Parse(fishDeadNode.ChildNodes[0].FirstChild.Value);
        Attribute(dstNode, "TianZai_Stay_Min", ref ftd.TianZai_Stay_Time1);
        Attribute(dstNode, "TianZai_Stay_Max", ref ftd.TianZai_Stay_Time2);
        Attribute(dstNode, "TianZai_Dead_Min", ref ftd.TianZai_Dead_Time1);
        Attribute(dstNode, "TianZai_Dead_Max", ref ftd.TianZai_Dead_Time2);
        Attribute(dstNode, "Bullet_BingDong_Dead_Min", ref ftd.Bullet_BingDong_Dead_Time1);
        Attribute(dstNode, "Bullet_BingDong_Dead_Max", ref ftd.Bullet_BingDong_Dead_Time2);
        Attribute(dstNode, "BingDong_Dead_Min", ref ftd.BingDong_Dead_Time1);
        Attribute(dstNode, "BingDong_Dead_Max", ref ftd.BingDong_Dead_Time2);
        Attribute(dstNode, "ShanDian_Dead_Min", ref ftd.ShanDian_Dead_Time1);
        Attribute(dstNode, "ShanDian_Dead_Max", ref ftd.ShanDian_Dead_Time2);
        Attribute(dstNode, "LongJuanFeng_Dead_Min", ref ftd.LongJuanFeng_Dead_Time1);
        Attribute(dstNode, "LongJuanFeng_Dead_Max", ref ftd.LongJuanFeng_Dead_Time2);
        Attribute(dstNode, "JiGuang_Stay_Time", ref ftd.JiGuang_Stay_Time);
        Attribute(dstNode, "JiGuang_Dead_Min", ref ftd.JiGuang_Dead_Time1);
        Attribute(dstNode, "JiGuang_Dead_Max", ref ftd.JiGuang_Dead_Time2);
        Attribute(dstNode, "ShandDian_Speed", ref ftd.ShandDian_Speed);
        Attribute(dstNode, "JiGuang_Speed", ref ftd.JiGuang_Speed);
        Attribute(dstNode, "JiGuang_BingDong_Speed", ref ftd.JiGuang_BingDong_Speed);
        Attribute(dstNode, "TianZai_Speed", ref ftd.TianZai_Speed);
        Attribute(dstNode, "BingDong_Speed", ref ftd.BingDong_Speed);
        FishSetting.FishDeadTime = ftd;
        //cal
        for (int i = 0; i < launcherCount; i++)
        {
            LauncherInfo item = plauncherinfo[i];
            item.nincome = (ushort)((item.nmincatch + item.nmaxcatch) / 2.0f / nFishs * nFishValues + item.nrevise);
            LauncherSetting.LauncherDataList[i].Energy = (ushort)(item.nincome * item.denergyratio);//大招
        }
        yield return(new WaitForEndOfFrame());

        int roomCount = 4;

        ExtraSetting.RoomDataList = new RoomData[roomCount];
        for (int i = 0; i < roomCount; ++i)
        {
            RoomData rd = new RoomData();
            rd.RoomID      = (byte)i;
            rd.RoomRateIdx = (byte)i;
            ExtraSetting.RoomDataList[i] = rd;
        }


        //XmlNode childNode = pConfig.SelectSingleNode("RoomInfo");
        //if (childNode == null)
        //{
        //    LogMgr.Log("RoomInfo not found.");
        //    InitLogic.SetInitFailed();
        //    yield break;
        //}
        //int roomCount = childNode.ChildNodes.Count;
        //ExtraSetting.RoomDataList = new RoomData[roomCount];
        //for (int i = 0; i < roomCount; ++i)
        //{
        //    RoomData rd = new RoomData();
        //    rd.RoomID = byte.Parse(childNode.ChildNodes[i].Attributes["id"].Value);
        //    rd.RoomRateIdx = byte.Parse(childNode.ChildNodes[i].FirstChild.Value);
        //    if (ExtraSetting.RoomDataList[rd.RoomID] != null)
        //    {
        //        LogMgr.Log("Exist the same room id.");
        //        InitLogic.SetInitFailed();
        //        yield break;
        //    }
        //    ExtraSetting.RoomDataList[rd.RoomID] = rd;
        //}
        ResManager.Instance.UnloadObject(obj);
        InitLogic.EndInit();
    }