Exemple #1
0
        //-----------------------------------------------------------------------------------
        void OnEnable()
        {
            if (photonView.isMine)
            {
                Logic.GlassLocal glass = new Logic.GlassLocal();
                glass.m_delNewFigure    += OnGlassNewFigure;
                glass.m_delChangePos    += OnGlassChangePos;
                glass.m_delFigurePlaced += OnGlassFigurePlaced;
                glass.m_delLineAdded    += OnGlassLineAdded;
                glass.m_delGameEnd      += OnGlassGameEnd;
                m_glass = glass;
            }
            else
            {
                m_glass = new Logic.GlassRemote();
            }
            m_glass.Init();

            m_inputProvider = GetComponent <InputProvider>();
            if (m_inputProvider != null)
            {
                m_inputProvider.m_delEvent += m_glass.ProcessInput;

                if (photonView.isMine)
                {
                    m_inputProvider.local = true;
                    m_inputProvider.m_delNewInputState += OnInputNewState;
                }
                else
                {
                    m_inputProvider.local = false;
                }
            }

            Game.instance.netMan.players.Add(this);
        }
Exemple #2
0
 void RpcNewFigure(Logic.Figure.EType eType, PosRot pos)
 {
     Logic.GlassRemote remote = (Logic.GlassRemote)m_glass;
     remote.NewFigure(eType, pos);
 }
Exemple #3
0
 void RpcInputNewState(int nStateFlags, PosRot pos)
 {
     m_inputProvider.ForceSetFlags(nStateFlags);
     Logic.GlassRemote remote = (Logic.GlassRemote)m_glass;
     remote.SetPos(pos, false);
 }
Exemple #4
0
 void RpcGameEnd()
 {
     Logic.GlassRemote remote = (Logic.GlassRemote)m_glass;
     remote.GameEnd();
 }
Exemple #5
0
 void RpcFigurePlaced(PosRot pos)
 {
     Logic.GlassRemote remote = (Logic.GlassRemote)m_glass;
     remote.SetPos(pos, true);
 }