Ejemplo n.º 1
0
 public void AddEvent()
 {
     // 按照 先后顺序 触发执行
     EnumEventDispatcher.AddEventListener(EnumEventType.JoystickPress, Func1);
     EnumEventDispatcher.AddEventListener(EnumEventType.JoystickPress, Func2);
     EnumEventDispatcher.AddEventListener(EnumEventType.JoystickPress, Func3);
 }
Ejemplo n.º 2
0
 private void Start()
 {
     IsAutoTargetPlayer = true;
     UpdateType         = FollowUpdateType.LateUpdate;
     EnumEventDispatcher.AddEventListener <Vector2>(EnumEventType.JoystickPress, JoystickPress);
     EnumEventDispatcher.AddEventListener <Vector2>(EnumEventType.JoystickRelease, JoystickRelease);
 }
Ejemplo n.º 3
0
 public void AddListeners()
 {
     // 按照 先后顺序 触发执行
     // 这里 this 会被 Action 的 Target 引用,必须 RemoveListeners
     EnumEventDispatcher.AddEventListener(EnumEventType.JoystickRelease, Func1);
     EnumEventDispatcher.AddEventListener(EnumEventType.JoystickRelease, Func2);
     EnumEventDispatcher.AddEventListener(EnumEventType.JoystickRelease, Func3);
 }
Ejemplo n.º 4
0
 /// <summary>
 /// CD构造函数
 /// </summary>
 /// <param name="theLabel"></param>
 /// <param name="theHours"></param>
 /// <param name="theMinutes"></param>
 /// <param name="theSeconds"></param>
 /// <param name="theEndAction">CD结束时回调</param>
 public AutoCountDown(Text theLabel, int theHours, int theMinutes, int theSeconds, Action theEndAction = null)
 {
     mText               = theLabel;
     mCountingText       = "";
     mStopText           = "";
     mEndText            = "";
     mDays               = 0;
     mHours              = theHours;
     mMinutes            = theMinutes;
     mSeconds            = theSeconds;
     IsStillCountingDown = true;
     mEndAction          = theEndAction;
     mTimeType           = TimeStringType.UpToMinutes;
     mText.text          = FormatTime();
     EnumEventDispatcher.AddEventListener(EnumEventType.SecondPast, CountDown);
 }
Ejemplo n.º 5
0
 /// <summary>
 /// CD构造函数
 /// </summary>
 /// <param name="theLabel"></param>
 /// <param name="secondsNum">CD秒数</param>
 /// <param name="theCountingText"></param>
 /// <param name="theStopText"></param>
 /// <param name="theEndText"></param>
 /// <param name="theTimeStringType"></param>
 /// <param name="theEndAction">CD结束时回调</param>
 public AutoCountDown(Text theLabel, int secondsNum, string theCountingText, string theStopText, string theEndText, TimeStringType theTimeStringType, Action theEndAction = null)
 {
     mText               = theLabel;
     mCountingText       = theCountingText;
     mStopText           = theStopText;
     mEndText            = theEndText;
     mDays               = secondsNum / SECONDS_DAY;
     mHours              = secondsNum % SECONDS_DAY / SECONDS_HOUR;
     mMinutes            = secondsNum % SECONDS_HOUR / SECONDS_MINUTE;
     mSeconds            = secondsNum % SECONDS_MINUTE;
     IsStillCountingDown = true;
     mEndAction          = theEndAction;
     mTimeType           = theTimeStringType;
     mText.text          = FormatTime();
     EnumEventDispatcher.AddEventListener(EnumEventType.SecondPast, CountDown);
 }