• 大小: 58.77MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2022-06-12
  • 语言: 其他
  • 标签: Unity  HairWorks  毛发  

资源简介

NVIDIA Hairworks for Unity3d 毛发插件,5.2版本以上可以流畅运行,2018显示有问题

资源截图

代码片段和文件信息

using System;
using UnityEditor;
using UnityEngine;

namespace UTJ
{
    [CustomEditor(typeof(HairInstance))]
    public class HairInstanceEditor : Editor
    {
        public override void OnInspectorGUI()
        {
            var t = target as HairInstance;

            GUILayout.BeginHorizontal();
            if (GUILayout.Button(“Load Hair Asset“))
            {
                var path = EditorUtility.OpenFilePanel(“Select apx file in StreamingAssets directory“ Application.streamingAssetsPath “apx“);
                t.LoadHairAsset(MakeRelativePath(path));
            }
            if (GUILayout.Button(“Reload Hair Asset“))
            {
                t.ReloadHairAsset();
            }
            GUILayout.EndHorizontal();

            GUILayout.Space(10);

            GUILayout.BeginHorizontal();
            if (GUILayout.Button(“Load Hair Shader“))
            {
                var path = EditorUtility.OpenFilePanel(“Select compiled shader (.cso) file in StreamingAssets directory“ Application.streamingAssetsPath “cso“);
                t.LoadHairShader(MakeRelativePath(path));
            }
            if (GUILayout.Button(“Reload Hair Shader“))
            {
                t.ReloadHairShader();
            }
            GUILayout.EndHorizontal();

            GUILayout.Space(10);

            DrawDefaultInspector();

            GUILayout.Space(10);

            GUILayout.Label(
                “hair shader: “ + t.m_hair_shader + “\n“ +
                “hair asset: “ + t.m_hair_asset + “\n“ +
                “shader id: “ + HandleToString(t.shader_id) + “\n“ +
                “asset id: “ + HandleToString(t.asset_id) + “\n“ +
                “instance id: “ + HandleToString(t.instance_id));
        }

        static string HandleToString(uint h)
        {
            return h == 0xFFFFFFFF ? “(null)“ : h.ToString();
        }

        static string MakeRelativePath(string path)
        {
            Uri path_to_assets = new Uri(Application.streamingAssetsPath + “/“);
            return path_to_assets.MakeRelativeUri(new Uri(path)).ToString();
        }
    }

}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2017-02-07 21:44  HairWorks5.2.5-master\
     文件         378  2017-02-07 21:44  HairWorks5.2.5-master\.gitattributes
     目录           0  2017-02-07 21:44  HairWorks5.2.5-master\Assets\
     文件        7040  2017-02-07 21:44  HairWorks5.2.5-master\Assets\HumanHead.controller
     文件         180  2017-02-07 21:44  HairWorks5.2.5-master\Assets\HumanHead.controller.meta
     文件         192  2017-02-07 21:44  HairWorks5.2.5-master\Assets\Materials.meta
     目录           0  2017-02-07 21:44  HairWorks5.2.5-master\Assets\Materials\
     文件        4892  2017-02-07 21:44  HairWorks5.2.5-master\Assets\Materials\Floor.mat
     文件         180  2017-02-07 21:44  HairWorks5.2.5-master\Assets\Materials\Floor.mat.meta
     文件        4944  2017-02-07 21:44  HairWorks5.2.5-master\Assets\Materials\Mite_Model_Mite_Test_v12b_Mite_Test_v12b_blinn.mat
     文件         180  2017-02-07 21:44  HairWorks5.2.5-master\Assets\Materials\Mite_Model_Mite_Test_v12b_Mite_Test_v12b_blinn.mat.meta
     文件        4892  2017-02-07 21:44  HairWorks5.2.5-master\Assets\Materials\phong1.mat
     文件         180  2017-02-07 21:44  HairWorks5.2.5-master\Assets\Materials\phong1.mat.meta
     文件        4892  2017-02-07 21:44  HairWorks5.2.5-master\Assets\Materials\whit4e.mat
     文件         180  2017-02-07 21:44  HairWorks5.2.5-master\Assets\Materials\whit4e.mat.meta
     文件         192  2017-02-07 21:44  HairWorks5.2.5-master\Assets\Model.meta
     目录           0  2017-02-07 21:44  HairWorks5.2.5-master\Assets\Model\
     文件     2442816  2017-02-07 21:44  HairWorks5.2.5-master\Assets\Model\HumanFemale_HeadBust_Bind.FBX
     文件       39224  2017-02-07 21:44  HairWorks5.2.5-master\Assets\Model\HumanFemale_HeadBust_Bind.FBX.meta
     文件     2151824  2017-02-07 21:44  HairWorks5.2.5-master\Assets\Model\Madeline.FBX
     文件       35730  2017-02-07 21:44  HairWorks5.2.5-master\Assets\Model\Madeline.FBX.meta
     文件     3645952  2017-02-07 21:44  HairWorks5.2.5-master\Assets\Model\Manjaladon_wFur.fbx
     文件       32199  2017-02-07 21:44  HairWorks5.2.5-master\Assets\Model\Manjaladon_wFur.fbx.meta
     文件         192  2017-02-07 21:44  HairWorks5.2.5-master\Assets\Model\Materials.meta
     目录           0  2017-02-07 21:44  HairWorks5.2.5-master\Assets\Model\Materials\
     文件        4892  2017-02-07 21:44  HairWorks5.2.5-master\Assets\Model\Materials\Checker.mat
     文件         180  2017-02-07 21:44  HairWorks5.2.5-master\Assets\Model\Materials\Checker.mat.meta
     文件        4896  2017-02-07 21:44  HairWorks5.2.5-master\Assets\Model\Materials\Eye_LEDs_mat.mat
     文件         180  2017-02-07 21:44  HairWorks5.2.5-master\Assets\Model\Materials\Eye_LEDs_mat.mat.meta
     文件        4892  2017-02-07 21:44  HairWorks5.2.5-master\Assets\Model\Materials\Eye_mat.mat
     文件         180  2017-02-07 21:44  HairWorks5.2.5-master\Assets\Model\Materials\Eye_mat.mat.meta
............此处省略515个文件信息

评论

共有 条评论