小编Mac*_*ysy的帖子

获取结构的地址

这是我的代码:

using System.Collections;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using UnityEngine;
using System;
using System.IO;

public class CarMove : MonoBehaviour
{
public unsafe struct TrafficRoadSystem { };
public unsafe struct CarsSimulation { };
public unsafe struct CarPostion
{
    double position_x;
    double position_y;
    double position_z;
};

// Use this for initialization
[DllImport("Assets/traffic.dll", CharSet = CharSet.Ansi)]
public unsafe static extern int traffic_import_osm([MarshalAs(UnmanagedType.LPStr)] string osm_pbf_path, TrafficRoadSystem** out_road_system);
[DllImport("Assets/traffic.dll")]
public unsafe static extern int create_simulation(TrafficRoadSystem* road_system, CarsSimulation** out_simulation, double speed, int cars_count);
[DllImport("Assets/traffic.dll")]
public static extern …
Run Code Online (Sandbox Code Playgroud)

c# dll dllimport unity-game-engine

4
推荐指数
1
解决办法
1579
查看次数

标签 统计

c# ×1

dll ×1

dllimport ×1

unity-game-engine ×1