コード例 #1
0
    void sendPlayerPosition()
    {
        GameObject    gameObject    = GameObject.FindWithTag("Player");
        Vector3       position      = gameObject.transform.position;
        ClientMessage clientMessage = baseMessage();
        Player        player        = clientMessage.player;

        Entity   entity  = new Entity();
        EVector3 evector = new EVector3();

        entity.vector3 = evector;

        entity.vector3.x = position.x;
        entity.vector3.y = position.z;
        entity.vector3.z = position.y;

        entity.id         = player.id;
        entity.entityType = "player";
        TrackEntity trackEntity = new TrackEntity();

        trackEntity.value  = true;
        entity.trackEntity = trackEntity;
        GetNeighbors getNeighbors = new GetNeighbors();

        getNeighbors.neighborType = "npc";
        getNeighbors.vector3      = new EVector3();
        getNeighbors.vector3.x    = position.x;
        getNeighbors.vector3.y    = position.z;
        getNeighbors.vector3.z    = position.y;
        entity.getNeighbors       = getNeighbors;
        clientMessage.entity.Add(entity);
        sendMessage(clientMessage);
    }
コード例 #2
0
    Player basePlayer()
    {
        Player player = new Player();

        player.id        = "player";
        player.authtoken = "authorized";
        return(player);
    }
コード例 #3
0
    ClientMessage baseMessage()
    {
        Player        player        = basePlayer();
        ClientMessage clientMessage = new ClientMessage();

        clientMessage.player = player;
        return(clientMessage);
    }