本文整理汇总了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);
}
}
示例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;
}
示例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!");
}
}
示例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);
}
示例5: Run
public void Run(LoopType type)
{
ThrowIfDisposed();
if (IsV4)
ev_run(_native, type);
else
ev_loop(_native, type);
}
示例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);
}
示例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);
}
示例8: getLoop
LoopData getLoop(LoopType type) {
switch(type) {
case LoopType.Wind:
return windLoop;
case LoopType.Ocean:
return oceanLoop;
default:
return null;
}
}
示例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);
}
}
示例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();
}
示例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;
}
示例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();
}
}
示例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;
}
示例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);
}
示例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;
}