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


C# LoopType类代码示例

本文整理汇总了C#中LoopType的典型用法代码示例。如果您正苦于以下问题:C# LoopType类的具体用法?C# LoopType怎么用?C# LoopType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: LoopExponentially

        private void LoopExponentially(
            int length, int loopDepth, LoopType loopType, int index = 0, int nestLevel = 1, string value = "")
        {
            if (index++ < length)
            {
                if (nestLevel < loopDepth)
                {
                    int startIndexNextLoop = 0;
                    switch (loopType)
                    {
                        case LoopType.CombinationWithRepetitions: startIndexNextLoop = index - 1; break;
                        case LoopType.CombinationWithoutRepetitions: startIndexNextLoop = index; break;
                    }

                    // loops in depth to the most nested loop
                    LoopExponentially(length, loopDepth, loopType, startIndexNextLoop, nestLevel + 1, value + index);
                }

                if (value.Length == loopDepth - 1)
                {
                    // do the action in the most nested loop
                    loopAction(value + index);
                }

                // loops as a normal loop
                LoopExponentially(length, loopDepth, loopType, index, nestLevel, value);
            }
        }
开发者ID:stoian2662,项目名称:Data-Structures-And-Algorithms,代码行数:28,代码来源:CombinatorialUtils.cs

示例2: DOMove

 public static Tweener DOMove(Transform target, Vector3 endValue, float duration, int loops = -1, LoopType loopType = LoopType.Yoyo, float delay = 0, System.Action doComplete = null)
 {
     Tweener tweener = target.DOMove(endValue, duration);
     tweener.SetLoops(loops, loopType);
     SetTweenerComplete(tweener, delay, doComplete);
     return tweener;
 }
开发者ID:l980305284,项目名称:UGUIPlugin,代码行数:7,代码来源:DotweenUtlity.cs

示例3: Fix

 private static List<Frame>.Enumerator Fix(List<Frame>.Enumerator e, LoopType l, ref int timeLeft)
 {
     IEnumerator<Frame> f = e;
     switch (l) {
         case LoopType.LoopEnough:
         {
             f.Reset();
             int tL = timeLeft;
             while(f.MoveNext() && timeLeft > 0 && f.Current != null) {
                 f.Current.Delay = Math.Min(tL, f.Current.OriginalDelay);
                 tL -= f.Current.Delay;
             }
             f.Reset();
             f.MoveNext();
             return (List<Frame>.Enumerator)f;
         }
         case LoopType.FullLoop:
         {
             f.Reset();
             int tL = 0;
             while (f.MoveNext() && f.Current != null) {
                 tL += f.Current.OriginalDelay;
                 f.Current.Delay = f.Current.OriginalDelay;
             }
             timeLeft = Math.Max(timeLeft, tL);
             f.Reset();
             f.MoveNext();
             return (List<Frame>.Enumerator)f;
         }
         default:
             throw new InvalidOperationException("OffsetAnimator.Fix called with invalid LoopType!");
     }
 }
开发者ID:angelsl,项目名称:ms-MSIT,代码行数:33,代码来源:MapleAnimator.cs

示例4: iTweenSimple

		public iTweenSimple(float time, LoopType type, 
			System.Action<float> whenUpdate, 
			System.Action whenRestart, 
			System.Action whenComplete)
		{
			this.to(time, type, whenUpdate, whenRestart, whenComplete);
		}
开发者ID:kybird,项目名称:PhoenixProject,代码行数:7,代码来源:iTweenSimple.cs

示例5: Run

        public void Run(LoopType type)
        {
            ThrowIfDisposed();

            if (IsV4)
                ev_run(_native, type);
            else
                ev_loop(_native, type);
        }
开发者ID:nuxleus,项目名称:manos,代码行数:9,代码来源:Loop.cs

示例6: Process

 // Algorithm stolen from haha01haha01 http://code.google.com/p/hasuite/source/browse/trunk/HaRepackerLib/AnimationBuilder.cs
 public static IEnumerable<Frame> Process(Rectangle padding, Color background, LoopType loop, params List<Frame>[] zframess)
 {
     List<List<Frame>> framess = zframess.Select(aframess => aframess.Select(f => new Frame(f.Number, f.Image, new Point(-f.Offset.X, -f.Offset.Y), f.Delay)).ToList()).ToList();
     framess = PadOffsets(Translate(framess), padding);
     Size fs = GetFrameSize(framess, padding);
     framess = framess.Select(f => f.OrderBy(z => z.Number).ToList()).ToList();
     List<Frame> frames = MergeMultiple(framess, fs, background, loop).OrderBy(z => z.Number).ToList();
     return FinalProcess(frames, fs, background);
 }
开发者ID:angelsl,项目名称:ms-MSIT,代码行数:10,代码来源:MapleAnimator.cs

示例7: LoopCommandObjectCreatedIsSameAsAConstructedObject

        public void LoopCommandObjectCreatedIsSameAsAConstructedObject(LoopType loopType)
        {
            ILoopCommand commandFromFactory = (LoopCommand)commandFactory.NewLoopCommand(loopType);
            ILoopCommand commandConstructedDirectly = new LoopCommand(loopType);

            Assert.IsNotNull(commandFromFactory);
            Assert.AreEqual(typeof(LoopCommand), commandFromFactory.GetType());
            Assert.AreEqual(commandConstructedDirectly.CommandType, commandFromFactory.CommandType);
            Assert.AreEqual(commandConstructedDirectly.LoopType, commandFromFactory.LoopType);
        }
开发者ID:silpheed,项目名称:M,代码行数:10,代码来源:CommandFactoryFixture.cs

示例8: getLoop

	LoopData getLoop(LoopType type) {
		switch(type) {
			case LoopType.Wind:
				return windLoop;
			case LoopType.Ocean:
				return oceanLoop;
			default:
				return null;
		}
	}
开发者ID:fadookie,项目名称:mystjam,代码行数:10,代码来源:SoundManager.cs

示例9: playLoop

	public void playLoop(LoopType type, float delay) {
		if (type == LoopType.None) {
			loopSource.Stop();
		} else {
			LoopData loop = getLoop(type);
			loopSource.clip = loop.clip;
			loopSource.volume = loop.volume;
			loopSource.PlayDelayed(delay);
		}
	}
开发者ID:fadookie,项目名称:mystjam,代码行数:10,代码来源:SoundManager.cs

示例10: LoopChange

        public void LoopChange(string input, LoopType loopType)
        {
            ILoopCommand _loopCommand = Stub<ILoopCommand>();
            Expect.Call(_commandFactory.NewLoopCommand(loopType)).Return(_loopCommand);
            ReplayAll();

            IList<ICommand> result = _textDiscriminator.Interpret(input);

            Assert.IsNotNull(result);
            Assert.AreEqual(1, result.Count);
            VerifyAll();
        }
开发者ID:silpheed,项目名称:M,代码行数:12,代码来源:TextDiscriminatorFixture.cs

示例11: Player

        public Player(IFileFinder fileFinder, IPlaylistReader playlistReader, IAudioStreamFactory audioStreamFactory, 
			IBackgroundWorkerFactory backgroundWorkerFactory, IFileSystemFacade fileSystem)
        {
            this.fileFinder = fileFinder;
            this.playlistReader = playlistReader;
            this.backgroundWorkerFactory = backgroundWorkerFactory;
            this.audioStreamFactory = audioStreamFactory;
            this.fileSystem = fileSystem;

            history = new List<string>();

            isStopped = true;
            isPlaying = false;
            isPaused = false;

            wasPausedBeforeBadSound = isPaused;
            loopType = LoopType.None;
            upto = 0;
        }
开发者ID:silpheed,项目名称:M,代码行数:19,代码来源:Player.cs

示例12: to

		public void to(float time, LoopType type, 
			System.Action<float> whenUpdate, 
			System.Action whenRestart, 
			System.Action whenComplete)
		{
			this.time_ = time < 0 ? 0 : time;
			this.loopType = time > 0 ? type : LoopType.none;
			this.percentage = 0;
			
			this.TweenStart();
			
			this.whenUpdate = whenUpdate;
			this.whenRestart = whenRestart;
			this.whenComplete = whenComplete;

			if (time == 0){
				this.percentage = 1;
				this.TweenComplete();
			}
		}
开发者ID:kybird,项目名称:PhoenixProject,代码行数:20,代码来源:iTweenSimple.cs

示例13: Clear

        /// <summary>Clears and resets this TweenParams instance using default values,
        /// so it can be reused without instantiating another one</summary>
        public TweenParams Clear()
        {
            id = target = null;
            updateType = DOTween.defaultUpdateType;
            isIndependentUpdate = DOTween.defaultTimeScaleIndependent;
            onStart = onPlay = onRewind = onUpdate = onStepComplete = onComplete = onKill = null;
            onWaypointChange = null;
            isRecyclable = DOTween.defaultRecyclable;
            isSpeedBased = false;
            autoKill = DOTween.defaultAutoKill;
            loops = 1;
            loopType = DOTween.defaultLoopType;
            delay = 0;
            isRelative = false;
            easeType = Ease.Unset;
            customEase = null;
            easeOvershootOrAmplitude = DOTween.defaultEaseOvershootOrAmplitude;
            easePeriod = DOTween.defaultEasePeriod;

            return this;
        }
开发者ID:kanon1109,项目名称:dotween,代码行数:23,代码来源:TweenParams.cs

示例14: LoopLogicalConstruct

        /// <summary>
        /// Creates a new loop construct and attaches it to the logical tree.
        /// </summary>
        /// <param name="entry">The entry to the loop construct.</param>
        /// <param name="loopBody">Collection containing all of the constructs in the loop body.</param>
        /// <param name="loopType">The type of the loop.</param>
        /// <param name="loopCondition">The condition of the loop.</param>
        public LoopLogicalConstruct(ILogicalConstruct entry,
            HashSet<ILogicalConstruct> loopBody, LoopType loopType, ConditionLogicalConstruct loopCondition, TypeSystem typeSystem)
        {
			if (loopCondition != null)
			{
				loopCondition.LogicalContainer = this;
			}

            LoopType = loopType;
            LoopCondition = loopCondition;
            
            if(this.LoopType != LoopType.InfiniteLoop)
            {
                loopBody.Remove(LoopCondition);
            }

            DetermineLoopBodyBlock(entry, loopBody);

            RedirectChildrenToNewParent(GetLoopChildrenCollection());

            FixLoopCondition(typeSystem);
        }
开发者ID:Feng2012,项目名称:JustDecompileEngine,代码行数:29,代码来源:LoopLogicalConstruct.cs

示例15: reset

			internal void reset()
			{
				// any pointers or values that are not guaranteed to be set later are defaulted here
				transform = null;
				targetVector = _startVector = _diffVector = Vector3.zero;
				delay = 0;
				loopType = LoopType.None;
				easeFunction = null;
				isRelativeTween = false;
				onComplete = onLoopComplete = null;
				customAction = null;
				_material = null;
				materialProperty = null;

				if( nextTween != null )
				{
					// null out and return to the stack all additional tweens
					GoKitLite.instance._inactiveTweenStack.Push( nextTween );
					nextTween.reset();
				}

				nextTween = null;
			}
开发者ID:JTown-,项目名称:Arcade-Launcher,代码行数:23,代码来源:GoKitLite.cs


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