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


C# Part.FindModelAnimators方法代码示例

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


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

示例1: playAnimationSetToPosition

 public static void playAnimationSetToPosition(Part p, string animationName, float position)
 {
     Animation anim;
     anim = p.FindModelAnimators(animationName).FirstOrDefault();
     if (anim != null) {
         anim[animationName].normalizedTime = position;
         anim[animationName].speed = 0f;
         anim.Play(animationName);
         // anim [animationName].speed = 0;
     }
 }
开发者ID:khr15714n,项目名称:KerbalSmartParts,代码行数:11,代码来源:Utility.cs

示例2: SetUpAnimation

 //Thanks Majiir!
 public static AnimationState[] SetUpAnimation(string animationName, Part part)
 {
     var states = new List<AnimationState>();
     foreach (var animation in part.FindModelAnimators(animationName))
     {
         var animationState = animation[animationName];
         animationState.speed = 0;
         animationState.enabled = true;
         animationState.wrapMode = WrapMode.ClampForever;
         animation.Blend(animationName);
         states.Add(animationState);
     }
     return states.ToArray();
 }
开发者ID:RichardDastardly,项目名称:BDAnimationModules,代码行数:15,代码来源:AnimatedContainer.cs

示例3: SetUpSingleAnimation

		public static AnimationState SetUpSingleAnimation(string animationName, Part part)
		{
			var states = new List<AnimationState>();

			foreach (var animation in part.FindModelAnimators(animationName))
			{
				var animationState = animation[animationName];
				animationState.speed = 0;
				animationState.enabled = true;
				animationState.wrapMode = WrapMode.ClampForever;
				animation.Blend(animationName);
				return animationState;
			}

			return null;
		}
开发者ID:tetryds,项目名称:BDArmory,代码行数:16,代码来源:Misc.cs

示例4: playAnimation

        public static void playAnimation(Part p, string animationName, bool forward, bool play, float speed)
        {
            Animation anim;
            anim = p.FindModelAnimators(animationName).FirstOrDefault();
            if (anim != null) {

                if (forward) {
                    anim[animationName].speed = 1f * speed;
                    //PartModule.print ("NTime forward: " + anim [animationName].normalizedTime);
                    if (!play || !anim.isPlaying)
                        anim[animationName].normalizedTime = (play ? 0f : 1f);
                    anim.Blend(animationName, 2f);
                }
                else {
                    anim[animationName].speed = -1f * speed;
                    //PartModule.print ("NTime backward: " + anim [animationName].normalizedTime);
                    if (!play || !anim.isPlaying)
                        anim[animationName].normalizedTime = (play ? 1f : 0f);
                    anim.Blend(animationName, 2f);
                }
            }
        }
开发者ID:khr15714n,项目名称:KerbalSmartParts,代码行数:22,代码来源:Utility.cs

示例5: SetUpAnimation

 // This function loads up some animationstates
 public static AnimationState[] SetUpAnimation(string animationName, Part part)
 {
     var states = new List<AnimationState>();
     int layer = 0;
     foreach (var animation in part.FindModelAnimators(animationName))
     {
         var animationState = animation[animationName];
         animationState.speed = 0;
         animationState.enabled = true;
         // Clamp this or else weird things happen
         animationState.wrapMode = WrapMode.ClampForever;
         animation.Blend(animationName);
         animationState.blendMode = AnimationBlendMode.Additive;
         // animationState.layer = layer;
         states.Add(animationState);
         layer++;
     }
     // Convert
     return states.ToArray();
 }
开发者ID:billkerbinsky,项目名称:NearFuturePropulsion,代码行数:21,代码来源:Utils.cs


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