PXR_PhfFile.cs 513 B

12345678910111213141516171819
  1. using System.Collections;
  2. using System.IO;
  3. using UnityEngine;
  4. #if UNITY_EDITOR
  5. using UnityEditor.AssetImporters;
  6. using UnityEditor.Experimental.AssetImporters;
  7. [ScriptedImporter(1, ".phf")]
  8. public class PXR_PhfFile : ScriptedImporter
  9. {
  10. public override void OnImportAsset(AssetImportContext ctx)
  11. {
  12. var phfTxt = File.ReadAllText(ctx.assetPath);
  13. var assetText = new TextAsset(phfTxt);
  14. ctx.AddObjectToAsset("main obj", assetText);
  15. ctx.SetMainObject(assetText);
  16. }
  17. }
  18. #endif
粤ICP备19079148号