PActivityScheduler is responsible for managing a list of activities to be processed.
PActivityScheduler is given a chance to process these activities from the PRoot's ProcessInputs() method. Most users will not need to use the PActivityScheduler directly, instead you should look at:
  • PNode.AddActivity - to schedule a new activity
  • PActivity.Terminate - to terminate a running activity
  • PRoot.ProcessInputs - already calls processActivities for you.
예제 #1
0
        /// <summary>
        /// Overridden.  See <see cref="PActivity.OnActivityFinished">PActivity.OnActivityFinished</see>.
        /// </summary>
        protected override void OnActivityFinished()
        {
            RelativeTargetValue = 1;
            base.OnActivityFinished();

            PActivityScheduler scheduler = ActivityScheduler;

            if (loopCount > 1)
            {
                if (loopCount != int.MaxValue)
                {
                    loopCount--;
                }
                firstLoop = false;
                StartTime = scheduler.Root.GlobalTime;
                scheduler.AddActivity(this);
            }
        }
예제 #2
0
		/// <summary>
		/// Constructs a new PRoot.
		/// </summary>
		/// <remarks>
		/// Note the PCanvas already creates a basic scene graph for you so usually you
		/// will not need to construct your own roots.
		/// </remarks>
		public PRoot() {
			inputSources = new ArrayList();
			processScheduledInputsDelegate = new ProcessScheduledInputsDelegate(this.ProcessScheduledInputs);
			globalTime = PUtil.CurrentTimeMillis;
			activityScheduler = new PActivityScheduler(this);
		}