예제 #1
0
파일: RoomData.cs 프로젝트: happylays/tbb2
        private static void SerializeRoomPlayer(List <RoomPlayerInfo> dancerList)
        {
            for (int i = 0; i < dancerList.Count; ++i)
            {
                RoomPlayerInfo playerInfo = dancerList[i];
                RoomPlayer     dancerInfo = new RoomPlayer();
                dancerInfo.Serialize(playerInfo);

                if (CommonLogicData.MainPlayerID > 0 && CommonLogicData.IsMainPlayer(dancerInfo.RoleID))
                {
                    mMeInfo = dancerInfo;
                }

                int tempIndex = dancerInfo.RolePos;
                if (tempIndex < CommonDef.MAX_ROOM_PLAYER && tempIndex >= 0 && tempIndex < mRoomPlayer.Length)
                {
                    AddDancer(dancerInfo.RoleID, dancerInfo);
                    if (dancerInfo == mMeInfo)
                    {
                        mRoomPlayer[tempIndex] = CommonLogicData.MainPlayer;
                    }
                    else
                    {
                        mRoomPlayer[tempIndex] = PlayerManager.CreateLogic(dancerInfo.GetBriefAttr(), true, playerInfo.m_ItemPacket, playerInfo.m_GenePacket);
                    }
                    mRoomPlayer[tempIndex].PlayerMoveType = (PlayerMoveType)playerInfo.m_nMoveType;
                }
            }
        }
예제 #2
0
    public void Init()
    {
        NetworkMgr.InitNetwork();
        UIMgr.Init();

        MainCoroutine.InitMainCoroutine();              //初始化Coroutine

        mCurStage = cBaseStage.eSTAGE.eStage_Login;
        //mStages = new cBaseStage[(int)cBaseStage.eSTAGE.eStage_Max];
        mStages[(int)cBaseStage.eSTAGE.eStage_Login] = new cLoginStage();
        //mStages[(int)cBaseStage.eSTAGE.eStage_Select] = new cSelectStage();
        mStages[(int)cBaseStage.eSTAGE.eStage_Lobby] = new cLobbyStage();
        mStages[(int)cBaseStage.eSTAGE.eStage_Room]  = new cRoomStage();
        mStages[(int)cBaseStage.eSTAGE.eStage_Game]  = new cGameStage();

        for (int i = 0; i < (int)cBaseStage.eSTAGE.eStage_Max; ++i)
        {
            mStages[i].Init(this);
        }
        /// stage open
        mStages[(int)mCurStage].InitStage();
        mStages[(int)mCurStage].Open();

        CommonLogicData.RegisteredUnityLogic(new UnityLogic());
    }
예제 #3
0
    protected override void InitAnimation()
    {
        if (AnimationLoader.RoomAniExist && OwnerAni != null)
        {
            // set animName
            List <string> animationNames = null;
            string[]      standVIPs      = new string[3];
            string[]      standRooms     = new string[3];
            if (true)//OwnerPlayer.RoleAttr.IsBoy)
            {
                standVIPs[0]  = AnimationLoader.VIP_STAND_BOY_01;
                standVIPs[1]  = AnimationLoader.VIP_STAND_BOY_02;
                standVIPs[2]  = AnimationLoader.VIP_STAND_BOY_03;
                standRooms[0] = AnimationLoader.StandRoomBoy_B;
                standRooms[1] = AnimationLoader.StandRoomBoy_C;
                standRooms[2] = AnimationLoader.StandRoomBoy_D;
            }


            OwnerAni.AddClip(GetAniClipBySex(Hello), Hello, WrapMode.Once, 3);
            if (true)//IsNeedTransIdleAni)
            {
                animationNames = new List <string>()
                {
                    standRooms[0], standRooms[1], standRooms[2]
                };
                AddStandAni(animationNames);
            }


            if (!CommonLogicData.IsMainPlayer(OwnerPlayer.RoleAttr.RoleID))
            {
                OwnerAni.CrossFadeQueued(Hello);
            }
        }
    }