• unity绝对路径与相对路径转化


    绝对路径->相对路径

    string mp =“H:unity(project)New Unity ProjectAssets111.mat”;
    mp = mp.Substring(mp.IndexOf("Assets"));
    mp = mp.Replace('\', '/');

    变成Assets111.mat

    相对路径转绝对路径

    string path="Assets";

    DirectoryInfo direction = new DirectoryInfo(path);
    FileInfo[] files = direction.GetFiles("*", SearchOption.TopDirectoryOnly);

    path=files[0].FullName.ToString();

    变成“H:unity(project)New Unity ProjectAssets111.mat“(有空补)

  • 相关阅读:
    20191117-STD::讲解及求平均数例题
    计算机网络-ip分类
    游标cursor
    ajax
    django ORM
    urls
    templates
    views
    models
    setting
  • 原文地址:https://www.cnblogs.com/luxishi/p/7566090.html
Copyright © 2020-2023  润新知