Пример #1
0
 public void AddCallback(AbstractCallback task)
 {
     if (task != null)
     {
         Callback.Add(task);
     }
 }
 private void InsertCallback(float time, AbstractCallback callback)
 {
     if (State == ThreeState.Ready)
     {
         // 以当前最大结束时间作为开始时间点
         Insert(time, new BehaviourTimeCallback(callback), 0);
     }
 }
Пример #3
0
 public BTTimerTask(float interval, AbstractCallback callback)
 {
     mCallback       = callback;
     mCurrentSeconds = TimeUtils.GetTimeStampSeconds();
     mInterval       = interval;
     mNextSeconds    = mCurrentSeconds + mInterval;
     isStop          = true;
 }
Пример #4
0
 public SingleSequenceBehaviour()
 {
     Behaviours          = new LinkedList <SingleBehaviourTimeCallback>();
     OnCompletedCallback = null;
     Current             = null;
     MaxDuration         = 0;
     TimeElappsed        = 0;
 }
 private ParallelSequenceBehaviour()
 {
     TimeLine            = 0;
     State               = ThreeState.Ready;
     Behaviours          = new List <BehaviourTimeCallback>();
     OnCompletedCallback = null;
     PrependTime         = 0.0f;
     MaxDuration         = 0.0f;
 }
Пример #6
0
 public void OnPathTrigger(AbstractCallback callback)
 {
     if (callback != null)
     {
         callback.Run();
         ObjectPools.Instance.Release(callback);
     }
     DebugUtils.Info("FixedPathMoableTest", "OnPathTrigger AbstractCallback");
 }
Пример #7
0
 public BehaviourTimeCallback(AbstractCallback process = null, AbstractCallback begin = null, AbstractCallback end = null)
 {
     TimeElappsed    = 0;
     State           = ThreeState.Ready;
     BeginCallback   = begin;
     ProcessCallback = process;
     EndCallback     = end;
     SetStartTime(0, 0);
 }
Пример #8
0
        private TimerTask GetTimerData(AbstractCallback callback, int start, int interval)
        {
            TimerTask task = ObjectPools.Instance.Acquire <TimerTask>();

            task.Callback = callback;
            task.Interval = interval;
            task.TimerId  = NextTimerId;
            task.NextTick = mCurrentTick + 1 + start;
            return(task);
        }
 private void OnComplete(AbstractCallback callback)
 {
     OnCompletedCallback = callback;
 }
Пример #10
0
 public BehaviourTimeCallback End(AbstractCallback end)
 {
     EndCallback = end;
     return(this);
 }
Пример #11
0
 public BehaviourTimeCallback Process(AbstractCallback process)
 {
     ProcessCallback = process;
     return(this);
 }
Пример #12
0
 public BehaviourTimeCallback Begin(AbstractCallback begin)
 {
     BeginCallback = begin;
     return(this);
 }
Пример #13
0
 public PathTriggerEvent(float length, AbstractCallback callback)
 {
     mTriggerLength = length;
     mCallback      = callback;
 }
Пример #14
0
 public BTTSimpleTimerNode(float interval, AbstractCallback callback) : base()
 {
     mTimerTask = new BTTimerTask(interval, callback);
 }
Пример #15
0
        // 指定时间插入
        public void RegisterTrigger(float time, AbstractCallback callback)
        {
            float length = mLineSpeed * time;

            mNavPath.InsertTriggerByLength(false, length, callback);
        }
Пример #16
0
 public BehaviourSecondTimeCallback(AbstractCallback process = null, AbstractCallback begin = null, AbstractCallback end = null) : base(begin, process, end)
 {
 }