Пример #1
0
        public static void BeginFakeSelectHero()
        {
            HeroConfirmedPlayerNum = 0;
            FakeHeroSelectList.Clear();
            ChosenHeroes.Clear();
            EnemyChosenHeroes.Clear();
            RoomInfo roomInfo = Singleton <CRoomSystem> .GetInstance().roomInfo;

            DebugHelper.Assert(roomInfo != null);
            DebugHelper.Assert(roomInfo.roomAttrib.bWarmBattle);
            COM_PLAYERCAMP        selfCamp = roomInfo.GetSelfCamp();
            ListView <MemberInfo> view     = roomInfo[selfCamp];

            for (int i = 0; i < view.Count; i++)
            {
                MemberInfo info2 = view[i];
                if (info2.RoomMemberType == 2)
                {
                    FakeHeroSelect fakeSelect = new FakeHeroSelect {
                        FakePlayer = info2.WarmNpc
                    };
                    if (Singleton <CHeroSelectBaseSystem> .instance.selectType == enSelectType.enRandom)
                    {
                        fakeSelect.maxChangeHeroCount = UnityEngine.Random.Range(0, 2);
                        DoSelectAction(ref fakeSelect);
                    }
                    else
                    {
                        fakeSelect.maxChangeHeroCount = UnityEngine.Random.Range(1, 4);
                    }
                    fakeSelect.nextActionSec = UnityEngine.Random.Range(3, 6);
                    FakeHeroSelectList.Add(fakeSelect);
                }
            }
            if (FakeHeroSelectList.Count > 0)
            {
                Singleton <CTimerManager> .GetInstance().AddTimer(0x3e8, 60, new CTimer.OnTimeUpHandler(CFakePvPHelper.UpdateFakeSelectHero));

                bInFakeSelect = true;
            }
            Singleton <CTimerManager> .GetInstance().AddTimer(0xea60, 1, new CTimer.OnTimeUpHandler(CFakePvPHelper.OnSelectHeroTimeout));
        }
Пример #2
0
        public static void BeginFakeSelectHero()
        {
            CFakePvPHelper.HeroConfirmedPlayerNum = 0;
            CFakePvPHelper.FakeHeroSelectList.Clear();
            CFakePvPHelper.ChosenHeroes.Clear();
            CFakePvPHelper.EnemyChosenHeroes.Clear();
            RoomInfo roomInfo = Singleton <CRoomSystem> .GetInstance().roomInfo;

            DebugHelper.Assert(roomInfo != null);
            DebugHelper.Assert(roomInfo.roomAttrib.bWarmBattle);
            COM_PLAYERCAMP        selfCamp = roomInfo.GetSelfCamp();
            ListView <MemberInfo> listView = roomInfo[selfCamp];

            for (int i = 0; i < listView.get_Count(); i++)
            {
                MemberInfo memberInfo = listView.get_Item(i);
                if (memberInfo.RoomMemberType == 2u)
                {
                    CFakePvPHelper.FakeHeroSelect fakeHeroSelect = new CFakePvPHelper.FakeHeroSelect();
                    fakeHeroSelect.FakePlayer = memberInfo.WarmNpc;
                    if (Singleton <CHeroSelectBaseSystem> .get_instance().selectType == enSelectType.enRandom)
                    {
                        fakeHeroSelect.maxChangeHeroCount = Random.Range(0, 2);
                        CFakePvPHelper.DoSelectAction(ref fakeHeroSelect);
                    }
                    else
                    {
                        fakeHeroSelect.maxChangeHeroCount = Random.Range(1, 4);
                    }
                    fakeHeroSelect.nextActionSec = Random.Range(3, 6);
                    CFakePvPHelper.FakeHeroSelectList.Add(fakeHeroSelect);
                }
            }
            if (CFakePvPHelper.FakeHeroSelectList.get_Count() > 0)
            {
                Singleton <CTimerManager> .GetInstance().AddTimer(1000, 60, new CTimer.OnTimeUpHandler(CFakePvPHelper.UpdateFakeSelectHero));

                CFakePvPHelper.bInFakeSelect = true;
            }
            Singleton <CTimerManager> .GetInstance().AddTimer(60000, 1, new CTimer.OnTimeUpHandler(CFakePvPHelper.OnSelectHeroTimeout));
        }