예제 #1
0
    protected override void _OnLoadingCompleteImp()
    {
        base._OnLoadingCompleteImp();
        mCurScene.CreateBall();

        if (m_config == null)
        {
            Debug.LogError("Match config file loading failed.");
            return;
        }

        mainRole                  = GameSystem.Instance.mClient.mPlayerManager.GetPlayerById(uint.Parse(m_config.MainRole.id));
        mainRole.operMode         = Player.OperMode.Input;
        mainRole.m_InfoVisualizer = new PlayerInfoVisualizer(mainRole);
        mainRole.m_team.m_role    = GameMatch.MatchRole.eOffense;
        mainRole.position         = GameSystem.Instance.MatchPointsConfig.BeginPos.offenses_transform[0].position;
        mainRole.GrabBall(mCurScene.mBall);

        _UpdateCamera(mainRole);

        _CreateGUI();

        GameMsgSender.SendGameBegin();

        mCurScene.mBasket.onGoal = OnGoal;
    }
예제 #2
0
    public override void ViewUpdate()
    {
        base.ViewUpdate();

        if (!GameSystem.Instance.mClient.mUIManager.isInMatchLoading && m_uiController == null)
        {
            _CreateGUI();
            PostCreateUI();

            practise_behaviour.match    = this;
            practise_behaviour.practise = practise;

            GameMsgSender.SendGameBegin();
        }
    }
예제 #3
0
    void OnHandleMatchBeginTimer()
    {
        Debug.Log("match begin.");
        NetworkConn conn = GameSystem.Instance.mNetworkManager.m_gameConn;

        if (conn == null || conn is VirtualNetworkConn || m_matchBeginPack == null)
        {
            return;
        }
        GameSystem.Instance.mNetworkManager.m_gameMsgHandler.UnregisterHandler(MsgID.MatchBeginID, HandleMatchBegin);
        //conn.m_handler.UnregisterHandler(MsgID.PVPLoadCompleteRespID, HandleLoadComplete);

        MatchBegin resp = Serializer.Deserialize <MatchBegin>(new MemoryStream(m_matchBeginPack.buffer));

        if (resp == null)
        {
            Debug.LogError("no pvp loading complete resp");
            return;
        }

        //close ui
        foreach (KeyValuePair <uint, List <LuaComponent> > items in mapPlayerIdLoadingState)
        {
            items.Value.Clear();
        }
        mapPlayerIdLoadingState.Clear();

        GameSystem.Instance.mClient.pause = false;


        GameMatch_PVP match = GameSystem.Instance.mClient.mCurMatch as GameMatch_PVP;

        match.OnInitPlayer();

        if (MainPlayer.Instance.inPvpJoining)
        {
            GameMsgSender.SendGameBegin();
            m_delayDestroy = true;
        }
        else
        {
            match.m_stateMachine.SetState(MatchState.State.eOpening);
            Object.Destroy(gameObject);
        }
    }
예제 #4
0
 void HandleEnterPlatResp(Pack pack)
 {
     GameMsgSender.SendGameBegin();
 }