//----------------------------------------------------------------------------------- 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); }
void RpcNewFigure(Logic.Figure.EType eType, PosRot pos) { Logic.GlassRemote remote = (Logic.GlassRemote)m_glass; remote.NewFigure(eType, pos); }
void RpcInputNewState(int nStateFlags, PosRot pos) { m_inputProvider.ForceSetFlags(nStateFlags); Logic.GlassRemote remote = (Logic.GlassRemote)m_glass; remote.SetPos(pos, false); }
void RpcGameEnd() { Logic.GlassRemote remote = (Logic.GlassRemote)m_glass; remote.GameEnd(); }
void RpcFigurePlaced(PosRot pos) { Logic.GlassRemote remote = (Logic.GlassRemote)m_glass; remote.SetPos(pos, true); }