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

C# Timeline类代码示例

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

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



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

示例1: Awake

    public void Awake()
    {
        Debug.Log(gameObject.name);

        charPositionTimeline = TimelineManager.Default.Get<Vector3>(gameObject.name);
        charPositionTimeline.AddSendFilter(TimelineUtils.BuildDeltaRateFilter <Vector3>((x,y) => Vector3.Distance(x,y), ()=>0.05f, ()=>2.0f));
    }
开发者ID:Berrrrnie,项目名称:Storytelling,代码行数:7,代码来源:TouchCharacterController.cs


示例2: Init

        public void Init(ITimelineContext timelineContext)
        {
            this.timelineContext = timelineContext;
            this.timeline = timelineContext.GetTimeline();

            if (timeline == null || timeline.PropertyItem == null)
            {
                return;
            }

            string unit = (string)timeline.GetPropertyValue(Constants.TIME_UNIT_KEY);
            if (Constants.TIME_UNIT_MS.Equals(unit))
            {
                period = 1;
            }
            else if (Constants.TIME_UNIT_S.Equals(unit))
            {
                period = 1000;
            }
            else if (Constants.TIME_UNIT_M.Equals(unit))
            {
                period = 60000;
            }
            max = long.Parse(timeline.GetPropertyValue(Constants.TIME_MAX_KEY));

            // Init Timer
            timer.Interval = period;
            timer.Elapsed += new ElapsedEventHandler(timer_Elapsed);
            timer.AutoReset = true;
        }
开发者ID:blueskywyf,项目名称:ShowMaker,代码行数:30,代码来源:DefaultTimeLineEngine.cs


示例3: Initialize

        /// <summary>
        /// Initialize the modify event.
        /// </summary>
        /// <param name="timeline">The timeline this event is part of.</param>
        /// <param name="start">The start of the event.</param>
        /// <param name="dependentOn">An optional event to be dependent upon, ie. wait for.</param>
        /// <param name="move">The move to calculate impact from.</param>
        protected virtual void Initialize(Timeline timeline, float start, TimelineEvent dependentOn, BattleMove move)
        {
            //Call the base method.
            base.Initialize(timeline, start, dependentOn);

            //Initialize the variables.
            _Move = move;
        }
开发者ID:LaudableBauble,项目名称:Insipidus,代码行数:15,代码来源:ImpactEvent.cs


示例4: GetNextChildren

 public void GetNextChildren(int count, CancellationToken token)
 {
     this.InitListIfFirst(token);
     this._NewestTimeline = this._NewestTimeline.GetNewer(count);
     foreach(var status in this._NewestTimeline){
         this._StatusList.Add(new StatusSystemEntry(this, status));
     }
 }
开发者ID:catwalkagogo,项目名称:Heron,代码行数:8,代码来源:TimelineSystemDirectory.cs


示例5: If_there_are_no_points_in_the_timeline_the_last_valid_change_set_is_null

        public void If_there_are_no_points_in_the_timeline_the_last_valid_change_set_is_null()
        {
            var timeline = new Timeline("Timeline", new TestingReferenceValueType(), new Point[] {});

            var lastValid = timeline.GetLastValidChangeSet(int.MaxValue);

            Assert.IsNull(lastValid);
        }
开发者ID:SzymonPobiega,项目名称:ReferenceDataManager,代码行数:8,代码来源:TimelineTests.cs


示例6: HandleCharacterCommandEntryInserted

    void HandleCharacterCommandEntryInserted(Timeline<string> timeline, TimelineEntry<string> entry)
    {
        Debug.Log("Character command recieved");

        // the various parts of the command are separated by commas
        string[]tokens = entry.Value.Split(',');
        string action = tokens[0];
    }
开发者ID:Berrrrnie,项目名称:Storytelling,代码行数:8,代码来源:CharacterTimelines.cs


示例7: It_adds_point_to_the_timeline

        public void It_adds_point_to_the_timeline()
        {
            var timeline = new Timeline("Timeline", new TestingReferenceValueType(), new Point[] { });

            timeline.AddPoint(new Point(ChangeSetId.NewUniqueId(), timeline.ReferenceType.GetCurrentValue()));

            Assert.AreEqual(1, timeline.Points.Count());
        }
开发者ID:SzymonPobiega,项目名称:ReferenceDataManager,代码行数:8,代码来源:TimelineTests.cs


示例8: If_throws_when_trying_to_add_point_with_incompatible_type

        public void If_throws_when_trying_to_add_point_with_incompatible_type()
        {
            var timeline = new Timeline("Timeline", new TestingReferenceValueType(), new Point[] { });

            TestDelegate act = () => timeline.AddPoint(new Point(ChangeSetId.NewUniqueId(), 100m));

            Assert.Throws<InvalidOperationException>(act);
        }
开发者ID:SzymonPobiega,项目名称:ReferenceDataManager,代码行数:8,代码来源:TimelineTests.cs


示例9: Build

        public static List<ComposerEventViewModel> Build(IEnumerable<Composer> composers, IEnumerable<ComposerEraViewModel> musicEras, Timeline.Timeline timeline)
        {
            var eventList = new List<ComposerEventViewModel>();

            foreach (var composer in composers)
            {
                var background = (Brush)null;
                var composerEras = new List<ComposerEraViewModel>();

                foreach (var era in composer.Eras)
                {
                    foreach (var musicEra in musicEras)
                    {
                        if (era.Name == musicEra.Label)
                        {
                            composerEras.Add(musicEra);
                        }
                    }
                }

                var composerEraCount = composerEras.Count;

                if (composerEraCount > 1)
                {
                    var linearGradientBrush = new LinearGradientBrush();
                    linearGradientBrush.StartPoint = new Point(0, 0.5);
                    linearGradientBrush.EndPoint = new Point(1, 0.5);

                    for (int i = 0; i < composerEraCount; i++)
                    {
                        linearGradientBrush.GradientStops.Add(new GradientStop(((SolidColorBrush)composerEras[i].Background).Color, i / (composerEraCount - 1)));
                    }

                    background = linearGradientBrush;
                }
                else if (composerEraCount == 1)
                {
                    background = composerEras[0].Background;
                }
                else
                {
                    background = Brushes.Black;
                }

                var composerEvent = new ComposerEventViewModel(
                    NameUtility.ToFirstLast(composer.Name),
                    ExtendedDateTimeInterval.Parse(composer.Dates),
                    composer,
                    background,
                    Brushes.White,
                    composerEras,
                    GetCommand(composer.ComposerId, timeline));

                eventList.Add(composerEvent);
            }

            return eventList.OrderBy(e => e.Dates.Earliest()).ToList();
        }
开发者ID:nharren,项目名称:MusicTimeline,代码行数:58,代码来源:ComposerEventViewModelBuilder.cs


示例10: CacheComponents

        /// <summary>
        /// The components used by the local clock are cached for performance optimization. If you  add or remove the Timeline on the GameObject, you need to call this method to update the local clock accordingly. 
        /// </summary>
        public virtual void CacheComponents()
        {
            timeline = GetComponent<Timeline>();

            if (timeline == null)
            {
                throw new ChronosException(string.Format("Missing timeline for local clock."));
            }
        }
开发者ID:VervergGames,项目名称:Canonhero,代码行数:12,代码来源:LocalClock.cs


示例11: TurnToBack

 public void TurnToBack()
 {
     Timeline = new Timeline (180);
     Timeline.NewFrame += delegate (object o, NewFrameArgs args) {
         SetRotation(RotateAxis.Y, args.FrameNum, 0, 0, 0);
         if (args.FrameNum > 90)
             BackSide (); };
     Timeline.Start ();
 }
开发者ID:hbons,项目名称:Deal,代码行数:9,代码来源:Deal.cs


示例12: Initialize

        /// <summary>
        /// Initialize the modify event.
        /// </summary>
        /// <param name="timeline">The timeline this event is part of.</param>
        /// <param name="start">The start of the event.</param>
        /// <param name="dependentOn">An optional event to be dependent upon, ie. wait for.</param>
        /// <param name="character">The character whos energy will be modified.</param>
        /// <param name="amount">The amount to add to the energy.</param>
        protected virtual void Initialize(Timeline timeline, float start, TimelineEvent dependentOn, Creature character, float amount)
        {
            //Call the base method.
            base.Initialize(timeline, start, dependentOn);

            //Initialize the variables.
            _Character = character;
            _Amount = amount;
        }
开发者ID:LaudableBauble,项目名称:Insipidus,代码行数:17,代码来源:ModifyEnergyEvent.cs


示例13: ChangeSet

        /// <summary>
        /// Initializes a new instance of the <see cref="ChangeSet"/> class.
        /// </summary>
        /// <param name="owner">The timeline that owns this change set.</param>
        /// <param name="name">The name of the change set.</param>
        /// <exception cref="ArgumentNullException">
        ///     Thrown if <paramref name="owner"/> is <see langword="null" />.
        /// </exception>
        public ChangeSet(Timeline owner, string name)
        {
            {
                Lokad.Enforce.Argument(() => owner);
            }

            m_Owner = owner;
            m_Name = name;
        }
开发者ID:pvandervelde,项目名称:Apollo,代码行数:17,代码来源:ChangeSet.cs


示例14: Initialize

        /// <summary>
        /// Initialize the modify event.
        /// </summary>
        /// <param name="timeline">The timeline this event is part of.</param>
        /// <param name="start">The start of the event.</param>
        /// <param name="dependentOn">An optional event to be dependent upon, ie. wait for.</param>
        /// <param name="character">The character who health will be modified.</param>
        /// <param name="state">The state to change into.</param>
        protected virtual void Initialize(Timeline timeline, float start, TimelineEvent dependentOn, Creature character, BattleState state)
        {
            //Call the base method.
            base.Initialize(timeline, start, dependentOn);

            //Initialize the variables.
            _Character = character;
            _ChangeState = state;
        }
开发者ID:LaudableBauble,项目名称:Insipidus,代码行数:17,代码来源:ModifyStateEvent.cs


示例15: Main

        public static void Main(string[] args)
        {
            Application.Init ();

            Stage stage = Stage.Default as Stage;
            (stage as Stage).KeyPressEvent += delegate {
                Clutter.Main.Quit();
            };

            // fixme: add constructor
            Clutter.Color stage_color = new Clutter.Color (0xcc, 0xcc, 0xcc, 0xff);
            stage.SetColor (stage_color);

            Clutter.Group group = new Group();
            stage.Add (group);
            group.Show ();

            // Make a hand
            Clutter.Actor hand = new Texture ("redhand.png");
            hand.SetPosition (0,0);
            hand.Show ();

            // Make a rect
            Clutter.Rectangle rect = new Clutter.Rectangle();
            rect.SetPosition (0,0);
            rect.SetSize ((int)hand.Width, (int)hand.Height);

            Clutter.Color rect_bg_color = new Clutter.Color (0x33, 0x22, 0x22, 0xff);
            rect.SetColor (rect_bg_color);
            rect.BorderWidth = 10;
            rect.Show ();

            group.Add (rect);
            group.Add (hand);

            // Make a timeline
            Timeline timeline = new Timeline (100, 26);
            timeline.Loop = true;

            Alpha alpha = new Alpha (timeline, (a) => a.Value);

            Behaviour o_behave = new BehaviourOpacity (alpha, 0x33, 0xff);
            o_behave.Apply (group);

            // Make a path behaviour and apply that too
            Behaviour p_behave = new BehaviourPath(alpha, knots); // fixme: add custom constructor?
            p_behave.Apply (group);

            // start timeline
            timeline.Start ();

            stage.ShowAll();

            // launch
            Application.Run ();
        }
开发者ID:abock,项目名称:clutter-sharp,代码行数:56,代码来源:test-behave.cs


示例16: Initialize

        /// <summary>
        /// Initialize the modify event.
        /// </summary>
        /// <param name="timeline">The timeline this event is part of.</param>
        /// <param name="start">The start of the event.</param>
        /// <param name="dependentOn">An optional event to be dependent upon, ie. wait for.</param>
        /// <param name="move">The move to modify.</param>
        /// <param name="character">The character whos state of control will be modified.</param>
        /// <param name="control">The new state of control.</param>
        protected virtual void Initialize(Timeline timeline, float start, TimelineEvent dependentOn, BattleMove move, Creature character, bool control)
        {
            //Call the base method.
            base.Initialize(timeline, start, dependentOn);

            //Initialize the variables.
            _Move = move;
            _Character = character;
            _HasControl = control;
        }
开发者ID:LaudableBauble,项目名称:Insipidus,代码行数:19,代码来源:ModifyControlEvent.cs


示例17: TurnToFront

 public void TurnToFront(uint Delay)
 {
     Timeline = new Timeline (180);
     Timeline.Delay = Delay;
     Timeline.NewFrame += delegate (object o, NewFrameArgs args) {
         SetRotation(RotateAxis.Y, args.FrameNum, 0, 0, 0);
         if (args.FrameNum > 90)
             FrontSide ();
     };
     Timeline.Start ();
 }
开发者ID:hbons,项目名称:Deal,代码行数:11,代码来源:Deal.cs


示例18: Start

    // Use this for initialization
    void Start()
    {
        Debug.Log("Starting Timelines Script");

        Application.runInBackground = true;

        // create a timeline
        characterCommand = TimelineManager.Default.Get<string>("command");
        // listen for commands being inserted on both  local and remote clients
        characterCommand.EntryInserted += HandleCharacterCommandEntryInserted;
    }
开发者ID:Berrrrnie,项目名称:Storytelling,代码行数:12,代码来源:CharacterTimelines.cs


示例19: Awake

        private void Awake()
        {
            time = GetComponentInParent<Timeline>();
            renderer = GetComponent<Renderer>();
            particleSystem = GetComponent<ParticleSystem>();

            if (particleSystem != null)
            {
                particles = new ParticleSystem.Particle[particleSystem.maxParticles];
            }
        }
开发者ID:arancauchi,项目名称:Mini-Games,代码行数:11,代码来源:ExampleTimeColor.cs


示例20: AddAnimation

 public static void AddAnimation(this Storyboard storyboard,
 DependencyObject item, Timeline t, DependencyProperty p)
 {
     if (p == null) throw new ArgumentNullException("p");
       Storyboard.SetTarget(t, item);
     #if WINDOWS_PHONE
       Storyboard.SetTargetProperty(t, new PropertyPath(p));
     #else
       Storyboard.SetTargetProperty(t, item.GetDependencyPropertyName(p));
     #endif
       storyboard.Children.Add(t);
 }
开发者ID:Remmo,项目名称:WpWinNl,代码行数:12,代码来源:StoryboardExtensions.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# TimeoutHelper类代码示例发布时间:2022-05-24
下一篇:
C# TimeUnit类代码示例发布时间: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