示例#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);
    }