Ejemplo n.º 1
0
 private void OnDisable()
 {
     dayTick.RemoveListener(SetNewDestination);
     weekTick.RemoveListener(RollForEvent);
     dayTick.RemoveListener(UpdateScores);
     getPaid.RemoveListener(ReceivePayment);
 }
Ejemplo n.º 2
0
 private void OnDisable()
 {
     SubtractGoldCost.RemoveListener(RemoveGold);
     MinionRecruited.RemoveListener(AddMinionToList);
     DayTick.RemoveListener(AddGold);
     WeekTick.RemoveListener(PayMinions);
 }
Ejemplo n.º 3
0
        public static void StopListeningIntEvent(string eventName, UnityAction <int> listener)
        {
            Init();
            IntEvent thisIntEvent = null;

            if (intEventDictionary.TryGetValue(eventName, out thisIntEvent))
            {
                thisIntEvent.RemoveListener(listener);
            }
        }
Ejemplo n.º 4
0
        static void Main(string[] args)
        {
            EventManager eventManager = new EventManager();

            // Create event and add some listeners.
            IntEvent intEvent = new IntEvent();

            intEvent.AddListener(eventManager, Program.Listener);
            intEvent.AddListener(eventManager, Program.Listener2);

            // Trigger the event.
            intEvent.Trigger(eventManager, 123);

            // Remember to remove the listeners.
            intEvent.RemoveListener(eventManager, Program.Listener);
            intEvent.RemoveListener(eventManager, Program.Listener2);

            // Pause the terminal so we can see the output.
            Console.ReadKey();
        }
Ejemplo n.º 5
0
        private void OnDestroy()
        {
            if (TimeStepEvent != null)
            {
                TimeStepEvent.RemoveListener(timeStepAction);
            }

            if (SkillProgressUi != null)
            {
                SkillProgressUi.Clear();
            }
        }
Ejemplo n.º 6
0
    public static void StopListeningInt(string eventName, UnityAction <int> listener)
    {
        if (eventManager == null)
        {
            return;
        }
        IntEvent thisEvent = null;

        if (instance.IntEventDictionary.TryGetValue(eventName, out thisEvent))
        {
            thisEvent.RemoveListener(listener);
        }
    }
 private void OnDisable()
 {
     MaleNameChosen.RemoveListener(OnMaleNameChosen);
     FemaleNameChosen.RemoveListener(OnFemaleNameChosen);
     YeharaFavorEvent.RemoveListener(UpdateYeharaFavor);
     MaliceFavorEvent.RemoveListener(UpdateMaliceFavor);
     VonEckensteinFavorEvent.RemoveListener(UpdateVonEckensteinFavor);
     BorkPraise.RemoveListener(BorkPraisesYou);
     BorkAdvice.RemoveListener(BorkGivesAdvice);
     Round2Proper.RemoveListener(OnSecondMeeting);
     YeharaEnding.RemoveListener(OnYeharaEnding);
     EckensteinEnding.RemoveListener(OnEckensteinEnding);
     MaliceEnding.RemoveListener(OnMaliceEnding);
     Victory.RemoveListener(OnVictory);
     Defeat.RemoveListener(OnDefeat);
     MonthTick.RemoveListener(AdvanceMonth);
 }
Ejemplo n.º 8
0
 public void RemoveListener(UnityAction <int> value)
 {
     changeEvent.RemoveListener(value);
 }
Ejemplo n.º 9
0
 private void OnDisable()
 {
     onEnemiesKilld.RemoveListener(OnEnemieKilld);
     onLevelPassed.RemoveListener(OnLevelPassed);
 }
 public static void AddOnce(this IntEvent thisEvent, UnityAction <int> reciever)
 {
     thisEvent.RemoveListener(reciever);
     thisEvent.AddListener(reciever);
 }
Ejemplo n.º 11
0
 private void OnDisable()
 {
     positionInput.RemoveListener(SetPosition);
 }
Ejemplo n.º 12
0
 public static void AddCleanIntListener(this IntEvent @event, UnityAction <int> action)
 {
     @event.RemoveListener(action);
     @event.AddListener(action);
 }
Ejemplo n.º 13
0
 private void OnDisable()
 {
     addPoints.RemoveListener(AddPoints);
 }