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

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

        if (obstacle != null)
        {
            obstacle.ResetFromServer();
        }
    }
예제 #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);
    }
예제 #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);
    }
예제 #5
0
    public void ResetObstacle(ObstacleNetworking obstacle)
    {
        IntegerMessage msg = new IntegerMessage(GetObstacleIndex(obstacle));

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