• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# LoopType类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: NewSequence

    void NewSequence(LoopType loopType, bool flip)
    {
    	main.Rewind();
    	main.Kill();

    	Sequence innerS0 = DOTween.Sequence()
            .SetId("INNER")
            // .SetLoops(3, loopType)
            .OnStepComplete(()=>Debug.Log("INNER Step Complete"));
            // .Append(targets[0].DOMoveX(3, 1).SetEase(Ease.Linear));
        // innerS0.InsertCallback(0.25f, ()=> Callback("INNER"));

        Sequence innerS1 = DOTween.Sequence()
            .SetId("INNER INNER")
            // .SetLoops(3, loopType)
            .OnStepComplete(()=> Debug.Log("INNER INNER Step Complete"));
		innerS1.Append(targets[0].DOMoveX(3, 1).SetEase(Ease.Linear));
        innerS1.InsertCallback(0.25f, ()=> Callback("INNER INNER"));
        innerS0.Append(innerS1);
        innerS0.InsertCallback(0.25f, ()=> Callback("INNER"));

        main = DOTween.Sequence()
            .SetId("MAIN")
            .SetLoops(3, loopType)
            .SetAutoKill(false)
            .OnStepComplete(()=> Debug.Log("MAIN Step Complete"));
            // .Append(targets[0].DOMoveX(3, 1).SetEase(Ease.Linear));
        main.Append(innerS0);
        main.InsertCallback(0.25f, ()=> Callback("MAIN"));

        if (flip) {
        	main.Complete();
        	main.Flip();
        	main.PlayBackwards();
        }
    }
开发者ID:amirebrahimi,项目名称:dotween,代码行数:36,代码来源:SequenceCallbacks.cs


示例17: ScaleTo

	/// <summary>
	/// Changes a GameObject's scale over time.
	/// </summary>
	/// <param name="scale">
	/// A <see cref="Vector3"/>
	/// </param>
	/// <param name="time">
	/// A <see cref="System.Single"/>
	/// </param>
	/// <param name="delay">
	/// A <see cref="System.Single"/>
	/// </param>
	/// <param name="easeType">
	/// A <see cref="EaseType"/>
	/// </param>
	/// <param name="loopType">
	/// A <see cref="LoopType"/>
	/// </param>
	public static void ScaleTo(this GameObject go,Vector3 scale,float time,float delay,EaseType easeType,LoopType loopType){
		iTween.ScaleTo(go,iTween.Hash("scale",scale,"time",time,"delay",delay,"easeType",easeType.ToString(),"looptype",loopType.ToString()));
	}
开发者ID:qishiyexu,项目名称:gravityball,代码行数:21,代码来源:iTweenExtensions.cs


示例18: RetrieveArgs

    //grab and set generic, neccesary iTween arguments:
    void RetrieveArgs()
    {
        foreach (Hashtable item in tweens) {
            if((GameObject)item["target"] == gameObject){
                tweenArguments=item;
                break;
            }
        }

        id=(string)tweenArguments["id"];
        type=(string)tweenArguments["type"];
        /* GFX47 MOD START */
        _name=(string)tweenArguments["name"];
        /* GFX47 MOD END */
        method=(string)tweenArguments["method"];

        if(tweenArguments.Contains("time")){
            time=(float)tweenArguments["time"];
        }else{
            time=Defaults.time;
        }

        //do we need to use physics, is there a rigidbody?
        if(rigidbody != null){
            physics=true;
        }

        if(tweenArguments.Contains("delay")){
            delay=(float)tweenArguments["delay"];
        }else{
            delay=Defaults.delay;
        }

        if(tweenArguments.Contains("namedcolorvalue")){
            //allows namedcolorvalue to be set as either an enum(C# friendly) or a string(JS friendly), string case usage doesn't matter to further increase usability:
            if(tweenArguments["namedcolorvalue"].GetType() == typeof(NamedValueColor)){
                namedcolorvalue=(NamedValueColor)tweenArguments["namedcolorvalue"];
            }else{
                try {
                    namedcolorvalue=(NamedValueColor)Enum.Parse(typeof(NamedValueColor),(string)tweenArguments["namedcolorvalue"],true);
                } catch {
                    Debug.LogWarning("iTween: Unsupported namedcolorvalue supplied! Default will be used.");
                    namedcolorvalue = iTween.NamedValueColor._Color;
                }
            }
        }else{
            namedcolorvalue=Defaults.namedColorValue;
        }

        if(tweenArguments.Contains("looptype")){
            //allows loopType to be set as either an enum(C# friendly) or a string(JS friendly), string case usage doesn't matter to further increase usability:
            if(tweenArguments["looptype"].GetType() == typeof(LoopType)){
                loopType=(LoopType)tweenArguments["looptype"];
            }else{
                try {
                    loopType=(LoopType)Enum.Parse(typeof(LoopType),(string)tweenArguments["looptype"],true);
                } catch {
                    Debug.LogWarning("iTween: Unsupported loopType supplied! Default will be used.");
                    loopType = iTween.LoopType.none;
                }
            }
        }else{
            loopType = iTween.LoopType.none;
        }

        if(tweenArguments.Contains("easetype")){
            //allows easeType to be set as either an enum(C# friendly) or a string(JS friendly), string case usage doesn't matter to further increase usability:
            if(tweenArguments["easetype"].GetType() == typeof(EaseType)){
                easeType=(EaseType)tweenArguments["easetype"];
            }else{
                try {
                    easeType=(EaseType)Enum.Parse(typeof(EaseType),(string)tweenArguments["easetype"],true);
                } catch {
                    Debug.LogWarning("iTween: Unsupported easeType supplied! Default will be used.");
                    easeType=Defaults.easeType;
                }
            }
        }else{
            easeType=Defaults.easeType;
        }

        if(tweenArguments.Contains("space")){
            //allows space to be set as either an enum(C# friendly) or a string(JS friendly), string case usage doesn't matter to further increase usability:
            if(tweenArguments["space"].GetType() == typeof(Space)){
                space=(Space)tweenArguments["space"];
            }else{
                try {
                    space=(Space)Enum.Parse(typeof(Space),(string)tweenArguments["space"],true);
                } catch {
                    Debug.LogWarning("iTween: Unsupported space supplied! Default will be used.");
                    space = Defaults.space;
                }
            }
        }else{
            space = Defaults.space;
        }

        if(tweenArguments.Contains("islocal")){
            isLocal = (bool)tweenArguments["islocal"];
//.........这里部分代码省略.........
开发者ID:hyf042,项目名称:BakeryGirl-chess,代码行数:101,代码来源:iTween.cs


示例19: ProcessCommand

        public void ProcessCommand(ICommand command)
        {
            //can't switch on type, so we use a series of ifs to get to the commands that we can switch on
            if (command is IFileCommand) {
                IFileCommand pfCommand = command as IFileCommand;
                switch (pfCommand.CommandType) {
                    case CommandType.PlayShortestTrack:
                        PlayNewTrack(fileFinder.FindFiles(pfCommand.Search, FileTypes.MP3, FileListSort.SmallestFirst));
                        break;
                    case CommandType.PlayRandomTrack:
                        PlayNewTrack(fileFinder.FindFiles(pfCommand.Search, FileTypes.MP3, FileListSort.Random));
                        break;
                    case CommandType.PlayPlaylist:
                        PlayPlaylist(
                            fileFinder.FindFiles(pfCommand.Search, new FileTypes[] {FileTypes.M3U, FileTypes.PLS}, FileListSort.SmallestFirst));
                        break;
                    case CommandType.PlayQueryAsList:
                        PlayGenericList(fileFinder.FindFiles(pfCommand.Search, FileTypes.MP3, FileListSort.SmallestFirst));
                        break;
                }
            }
            else if (command is IChangeStateCommand) {
                IChangeStateCommand csCommand = command as IChangeStateCommand;
                switch (csCommand.CommandType)
                {
                    case CommandType.SkipTime:
                        throw new NotImplementedException();
                        //break;
                    case CommandType.SkipTrack:
                        SkipTracks(csCommand.Magnitude);
                        break;
                    case CommandType.SkipToTrack:
                        SkipToTrack(csCommand.Magnitude - 1);
                        break;
                    case CommandType.Volume:
                        throw new NotImplementedException();
                        //break;
                }
            }
            else if (command is ILoopCommand) {
                ILoopCommand lCommand = command as ILoopCommand;
                loopType = lCommand.LoopType;
            }
            else
                switch (command.CommandType) {
                    case CommandType.Exit:
                    case CommandType.Stop:
                        Stop();
                        break;

                    case CommandType.Repeat:
                        Repeat();
                        break;

                    case CommandType.PlayPause:
                        PlayPause();
                        break;

                    case CommandType.Ignore:
                        break;
                }
            //ignore any other commands
        }
开发者ID:silpheed,项目名称:M,代码行数:63,代码来源:Player.cs


示例20: AudioFrom

	/// <summary>
	/// Instantly changes an AudioSource's volume and pitch then returns it to it's starting volume and pitch over time. Default AudioSource attached to GameObject will be used.
	/// </summary>
	/// <param name="volume"> 
	/// A <see cref="System.Single"/>
	/// </param>
	/// <param name="pitch"> 
	/// A <see cref="System.Single"/>
	/// </param>
	/// <param name="time"> 
	/// A <see cref="System.Single"/>
	/// </param>
	/// <param name="delay"> 
	/// A <see cref="System.Single"/>
	/// </param>
	/// <param name="looptype">
	/// A <see cref="LoopType"/>
	/// </param>
	public static void AudioFrom(this GameObject go,float volume,float pitch,float time,float delay,LoopType loopType){
		iTween.AudioFrom(go,iTween.Hash("volume",volume,"pitch",pitch,"time",time,"delay",delay,"looptype",loopType.ToString()));
	}
开发者ID:qishiyexu,项目名称:gravityball,代码行数:21,代码来源:iTweenExtensions.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Lot类代码示例发布时间:2022-05-24
下一篇:
C# Loop类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap