以下の内容はhttps://baba-s.hatenablog.com/entry/2020/09/15/090000より取得しました。


【Unity】アセットのパスに関する処理を記述しやすくする構造体「UniAssetPath」を GitHub に公開しました

リポジトリ

使用例

using Kogane;
using UnityEditor;
using UnityEngine;

public static class Test
{
    [MenuItem( "Tools/Hoge" )]
    private static void Hoge()
    {
        var assetPath = new AssetPath( "Assets/New Material.mat" );

        // 下記の記述も可能
        //AssetPath assetPath = "Assets/New Material.mat";

        Debug.Log( assetPath );
        Debug.Log( assetPath.DirectoryName );
        Debug.Log( assetPath.Extension );
        Debug.Log( assetPath.FileName );
        Debug.Log( assetPath.FileNameWithoutExtension );
        Debug.Log( assetPath.FullPath );
        Debug.Log( assetPath.GUID );
        Debug.Log( assetPath.IsValidFolder );

        // string への暗黙的なキャスト
        string str = assetPath;

        Debug.Log( str );

        // string からの暗黙的なキャスト
        assetPath = str;

        Debug.Log( assetPath );
    }
}



以上の内容はhttps://baba-s.hatenablog.com/entry/2020/09/15/090000より取得しました。
このページはhttp://font.textar.tv/のウェブフォントを使用してます

不具合報告/要望等はこちらへお願いします。
モバイルやる夫Viewer Ver0.14