Exemple #1
0
    public void RpcDeactivateObstacle(int obstacleIndex)
    {
        ObstacleNetworking obstacle = obstacles[obstacleIndex];

        if (obstacle != null)
        {
            obstacle.DeactivateFromServer();
        }
    }
Exemple #2
0
    public void RpcResetObstacle(int obstacleIndex)
    {
        ObstacleNetworking obstacle = obstacles[obstacleIndex];

        if (obstacle != null)
        {
            obstacle.ResetFromServer();
        }
    }
Exemple #3
0
    // Find the index of the obstacle
    public int GetObstacleIndex(ObstacleNetworking obstacle)
    {
        int obstacleIndex = 0;

        foreach (ObstacleNetworking o in obstacles)
        {
            if (obstacle.gameObject == o.gameObject)
            {
                return(obstacleIndex);
            }

            obstacleIndex++;
        }

        return(-1);
    }
Exemple #4
0
    // Deactivate the obstacle on the server
    public void DeactivateObstacle(ObstacleNetworking obstacle)
    {
        IntegerMessage msg = new IntegerMessage(GetObstacleIndex(obstacle));

        NetworkManager.singleton.client.connection.Send(DEACTIVATE_MESSAGE, msg);
    }
Exemple #5
0
    public void ResetObstacle(ObstacleNetworking obstacle)
    {
        IntegerMessage msg = new IntegerMessage(GetObstacleIndex(obstacle));

        NetworkManager.singleton.client.connection.Send(RESET_MESSAGE, msg);
    }