Exemple #1
0
    }                                                                     //---------------------------------

    void OnGameStart()
    {
        if (networkManager.IsMasterClient())
        {
            renderer.material.color = new Color(1.0f, 0, 0); // for debug
            Move[] movesToSend =
            {
                new Move(A_PIECE_1, Move.Direction.UP),
                new Move(A_PIECE_2, Move.Direction.DOWN),
            };
            networkManager.SendTurn(new List <Move[]> {
                movesToSend, movesToSend, movesToSend
            });
        }
        else
        {
            renderer.material.color = new Color(0, 0, 1.0f); // for debug
            Move[] movesToSend =
            {
                new Move(B_PIECE_1, Move.Direction.UP),
                new Move(B_PIECE_2, Move.Direction.DOWN),
            };         // debug as well
            networkManager.SendTurn(new List <Move[]> {
                movesToSend, movesToSend, movesToSend
            });
        }
    }
Exemple #2
0
 // Start is called before the first frame update
 void Start()
 {
     stateManager   = GetComponent <StateManager>();
     networkManager = GetComponent <NetworkEventManager>();
     renderer       = GetComponent <Renderer>();
     if (networkManager.IsMasterClient())
     {
         SetUpDummyBoard();
     }
 }