当前位置: 首页>>代码示例>>C#>>正文


C# AnimationClip.GetInstanceID方法代码示例

本文整理汇总了C#中UnityEngine.AnimationClip.GetInstanceID方法的典型用法代码示例。如果您正苦于以下问题:C# AnimationClip.GetInstanceID方法的具体用法?C# AnimationClip.GetInstanceID怎么用?C# AnimationClip.GetInstanceID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UnityEngine.AnimationClip的用法示例。


在下文中一共展示了AnimationClip.GetInstanceID方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetCurveGroupID

 public static int GetCurveGroupID(AnimationClip clip, EditorCurveBinding curveData)
 {
   if (curveData.type != typeof (Transform))
     return -1;
   int num = !((UnityEngine.Object) clip == (UnityEngine.Object) null) ? clip.GetInstanceID() : 0;
   string str = curveData.propertyName.Substring(0, curveData.propertyName.Length - 1);
   return num * 19603 ^ curveData.path.GetHashCode() * 729 ^ curveData.type.GetHashCode() * 27 ^ str.GetHashCode();
 }
开发者ID:BlakeTriana,项目名称:unity-decompiled,代码行数:8,代码来源:CurveUtility.cs

示例2: GetCurveGroupID

		public static int GetCurveGroupID(AnimationClip clip, EditorCurveBinding curveData)
		{
			if (curveData.type != typeof(Transform))
			{
				return -1;
			}
			int num = (!(clip == null)) ? clip.GetInstanceID() : 0;
			string text = curveData.propertyName.Substring(0, curveData.propertyName.Length - 1);
			return num * 19603 ^ curveData.path.GetHashCode() * 729 ^ curveData.type.GetHashCode() * 27 ^ text.GetHashCode();
		}
开发者ID:guozanhua,项目名称:UnityDecompiled,代码行数:10,代码来源:CurveUtility.cs

示例3: GetCurveGroupID

 public static int GetCurveGroupID(AnimationClip clip, EditorCurveBinding curveData)
 {
     if (curveData.type != typeof(Transform))
     {
         return -1;
     }
     int num = (clip != null) ? clip.GetInstanceID() : 0;
     string str = curveData.propertyName.Substring(0, curveData.propertyName.Length - 1);
     return ((((num * 0x4c93) ^ (curveData.path.GetHashCode() * 0x2d9)) ^ (curveData.type.GetHashCode() * 0x1b)) ^ str.GetHashCode());
 }
开发者ID:randomize,项目名称:VimConfig,代码行数:10,代码来源:CurveUtility.cs

示例4: GetCurveID

 public static int GetCurveID(AnimationClip clip, EditorCurveBinding curveData)
 {
   return (!((UnityEngine.Object) clip == (UnityEngine.Object) null) ? clip.GetInstanceID() : 0) * 19603 ^ curveData.path.GetHashCode() * 729 ^ curveData.type.GetHashCode() * 27 ^ curveData.propertyName.GetHashCode();
 }
开发者ID:BlakeTriana,项目名称:unity-decompiled,代码行数:4,代码来源:CurveUtility.cs

示例5: GetCurveID

		public static int GetCurveID(AnimationClip clip, EditorCurveBinding curveData)
		{
			int num = (!(clip == null)) ? clip.GetInstanceID() : 0;
			return num * 19603 ^ curveData.path.GetHashCode() * 729 ^ curveData.type.GetHashCode() * 27 ^ curveData.propertyName.GetHashCode();
		}
开发者ID:guozanhua,项目名称:UnityDecompiled,代码行数:5,代码来源:CurveUtility.cs

示例6: CloneAni

    void CloneAni(AnimationClip clip, float fps)
    {

        var ani = target as Animator;

        //创建CleanData.Ani
        FB.PosePlus.AniClip _clip = ScriptableObject.CreateInstance<FB.PosePlus.AniClip>();
        _clip.boneinfo = new List<string>();//也增加了每个动画中的boneinfo信息.

        //这里重新检查动画曲线,找出动画中涉及的Transform部分,更精确
        List<Transform> cdpath = new List<Transform>();
        AnimationClipCurveData[] curveDatas = AnimationUtility.GetAllCurves(clip, true);
        foreach (var dd in curveDatas)
        {
            Transform tran = ani.transform.Find(dd.path);
            if (cdpath.Contains(tran) == false)
            {
                _clip.boneinfo.Add(dd.path);
                cdpath.Add(tran);
            }
        }
        Debug.LogWarning("curve got path =" + cdpath.Count);


        string path = System.IO.Path.GetDirectoryName(AssetDatabase.GetAssetPath(clip.GetInstanceID()));
        _clip.name = clip.name;
        _clip.frames = new List<FB.PosePlus.Frame>();
        _clip.fps = fps;
        _clip.loop = clip.isLooping;
        float flen = (clip.length * fps);
        int framecount = (int)flen;
        if (flen - framecount > 0.0001) framecount++;
        //if (framecount < 1) framecount = 1;

        framecount += 1;
        FB.PosePlus.Frame last = null;

        //ani.StartPlayback();
        //逐帧复制
        //ani.Play(_clip.name, 0, 0);
        for (int i = 0; i < framecount; i++)
        {
            ani.Play(_clip.name, 0, (i * 1.0f / fps) / clip.length);
            ani.Update(0);

            last = new FB.PosePlus.Frame(last, i, cdpath);
            _clip.frames.Add(last);
        }
        if (_clip.loop)
        {
            _clip.frames[0].LinkLoop(last);
        }
        Debug.Log("FrameCount." + framecount);

        FB.PosePlus.AniPlayer con = ani.GetComponent<FB.PosePlus.AniPlayer>();

        List<FB.PosePlus.AniClip> clips = null;
        if (con.clips != null)
        {
            clips = new List<FB.PosePlus.AniClip>(con.clips);
        }
        else
        {
            clips = new List<FB.PosePlus.AniClip>();
        }
        foreach (var c in clips)
        {
            if (c.name == _clip.name + ".FBAni")
            {
                clips.Remove(c);
                break;
            }
        }

        //ani.StopPlayback();
        string outpath = path + "/" + clip.name + ".FBAni.asset";
        AssetDatabase.CreateAsset(_clip, outpath);
        var src = AssetDatabase.LoadAssetAtPath(outpath, typeof(FB.PosePlus.AniClip)) as FB.PosePlus.AniClip;

        //设置clip

        //FB.CleanData.AniController con = ani.GetComponent<FB.CleanData.AniController>();

        clips.Add(src);
        con.clips = clips;
    }
开发者ID:helojo,项目名称:EgretUnity,代码行数:86,代码来源:Inspector_Animator.cs

示例7: GetCurveID

 public static int GetCurveID(AnimationClip clip, EditorCurveBinding curveData)
 {
     int num = (clip != null) ? clip.GetInstanceID() : 0;
     return ((((num * 0x4c93) ^ (curveData.path.GetHashCode() * 0x2d9)) ^ (curveData.type.GetHashCode() * 0x1b)) ^ curveData.propertyName.GetHashCode());
 }
开发者ID:randomize,项目名称:VimConfig,代码行数:5,代码来源:CurveUtility.cs


注:本文中的UnityEngine.AnimationClip.GetInstanceID方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。