public static IObservable <Tuple <T0, T1, T2, T3> > AsObservable <T0, T1, T2, T3>(this UnityEvent <T0, T1, T2, T3> unityEvent)
        {
            int dummy = 0;

            return(Observable.FromEvent <UnityAction <T0, T1, T2, T3>, Tuple <T0, T1, T2, T3> >((Action <Tuple <T0, T1, T2, T3> > h) => delegate(T0 t0, T1 t1, T2 t2, T3 t3)
            {
                dummy.GetHashCode();
                h.Invoke(Tuple.Create <T0, T1, T2, T3>(t0, t1, t2, t3));
            }, delegate(UnityAction <T0, T1, T2, T3> h)
            {
                unityEvent.AddListener(h);
            }, delegate(UnityAction <T0, T1, T2, T3> h)
            {
                unityEvent.RemoveListener(h);
            }));
        }
예제 #2
0
 public void RemoveOnFinished(UnityEvent finishedCallBack)
 {
 }
예제 #3
0
 public DialogueAction(string text, UnityAction dAction)
 {
     this.text   = text;
     this.action = new UnityEvent();
     action.AddListener(dAction);
 }
예제 #4
0
 public override void Awake()
 {
     base.Awake();
     OnNextScene = OnNextScene ?? new UnityEvent();
     DontDestroyOnLoad(gameObject);
 }
예제 #5
0
 public void SetOnFinished(UnityEvent finishedCallBack)
 {
     onFinished = finishedCallBack;
 }
예제 #6
0
 protected override void OnAwake()
 {
     base.OnAwake();
     ChangeAttackTargetEvent = new UnityEvent();
     ChangeMoveTargetEvent   = new UnityEvent();
 }
예제 #7
0
 /// <summary>
 /// Appends a null SignalAsset with a reaction specified by the UnityEvent.
 /// </summary>
 /// <param name="reaction">The new reaction to be appended.</param>
 /// <returns>The index of the appended reaction.</returns>
 /// <remarks>Multiple null assets are valid.</remarks>
 public int AddEmptyReaction(UnityEvent reaction)
 {
     m_Events.Append(null, reaction);
     return(m_Events.events.Count - 1);
 }
예제 #8
0
 /// <summary>
 ///   <para>Adds a persistent, call to the listener. Will be invoked with the arguments as defined by the Event and sent from the call location.</para>
 /// </summary>
 /// <param name="unityEvent">Event to modify.</param>
 /// <param name="call">Function to call.</param>
 public static void AddPersistentListener(UnityEvent unityEvent, UnityAction call)
 {
     unityEvent.AddPersistentListener(call);
 }
예제 #9
0
 public static void AddPersistentListener <T0, T1, T2, T3>(UnityEvent <T0, T1, T2, T3> unityEvent, UnityAction <T0, T1, T2, T3> call)
 {
     unityEvent.AddPersistentListener(call);
 }
예제 #10
0
 public void Awake()
 {
     OnEntrySplash = OnEntrySplash ?? new UnityEvent();
     OnExitSplash  = OnExitSplash ?? new UnityEvent();
 }
예제 #11
0
 private void Awake()
 {
     DestroyEvent = new UnityEvent();
 }
예제 #12
0
 // slider, label
 public static IIgniteGUIGroup AddSlider(this IIgniteGUIGroup group, Action <float> onValueChanged, string label, float minValue = 0f, float maxValue = 1f, bool wholeNumbers = false, UnityEvent <float> valueChangeEvent = null, float initialValue = 0f)
 {
     return(group.Add(IgniteHorizontalGroup.Create().Add(IgniteSlider.Create(onValueChanged, minValue, maxValue, wholeNumbers, valueChangeEvent, initialValue)).AddLabel(label) as IgniteHorizontalGroup));
 }
예제 #13
0
        public static IgniteSlider Create(Action <float> onValueChanged, float minValue = 0f, float maxValue = 1f, bool wholeNumbers = false, UnityEvent <float> valueChangeEvent = null, float initialValue = 0f)
        {
            var instance = Instantiate(Resources.Load <GameObject>("IgniteGUI/Slider")).GetComponent <IgniteSlider>();

            instance.SetSize(IgniteGUISettings.ElementWidth, IgniteGUISettings.ElementHeight);
            instance.backgroundImage.color             = IgniteGUISettings.SliderBackgroundColor;
            instance.handleImage.color                 = IgniteGUISettings.SliderHandleColor;
            instance.sliderValueText.font              = IgniteGUISettings.Font;
            instance.sliderValueText.fontSize          = IgniteGUISettings.FontSize;
            instance.sliderValueText.resizeTextMaxSize = IgniteGUISettings.FontSize;
            instance.sliderValueText.color             = IgniteGUISettings.FontColor;
            instance.slider.minValue     = minValue;
            instance.slider.maxValue     = maxValue;
            instance.slider.wholeNumbers = wholeNumbers;
            instance.slider.onValueChanged.AddListener(new UnityAction <float>(onValueChanged));
            instance.slider.onValueChanged.AddListener(v => instance.sliderValueText.text = v.ToString("F"));
            instance.slider.value = initialValue;

            if (valueChangeEvent != null)
            {
                valueChangeEvent.AddListener(v =>
                {
                    if (instance != null)
                    {
                        instance.slider.value = v;
                    }
                });
            }

            return(instance);
        }
예제 #14
0
 public GameViewResult()
 {
     OnBack = new UnityEvent();
 }
예제 #15
0
 public WallGrabListener(State state, UnityEvent trig)
 {
     ownerState = state;
     transfrom  = state.transform;
     trigger    = trig;
 }
예제 #16
0
 /// <summary>
 ///   <para>Modifies the event at the given index.</para>
 /// </summary>
 /// <param name="unityEvent">Event to modify.</param>
 /// <param name="index">Index to modify.</param>
 /// <param name="call">Function to call.</param>
 public static void RegisterPersistentListener(UnityEvent unityEvent, int index, UnityAction call)
 {
     unityEvent.RegisterPersistentListener(index, call);
 }
예제 #17
0
 protected void Reset()
 {
     this.m_TargetTransform = this.transform as RectTransform;
     this.m_OnChange        = new UnityEvent();
 }
예제 #18
0
 public static void RegisterPersistentListener <T0, T1, T2, T3>(UnityEvent <T0, T1, T2, T3> unityEvent, int index, UnityAction <T0, T1, T2, T3> call)
 {
     unityEvent.RegisterPersistentListener(index, call);
 }
예제 #19
0
 public void Append(SignalAsset key, UnityEvent value)
 {
     m_Signals.Add(key);
     m_Events.Add(value);
 }
예제 #20
0
 void SetupEvents()
 {
     ContentChanged = new UnityEvent();
     ItemAdded      = new SKSItemEvent();
     ItemRemoved    = new SKSItemEvent();
 }
예제 #21
0
 // Start is called before the first frame update
 void Start()
 {
     quit          = new GoBackMainEvent();
     eventsManager = EasyGetter.GetUIEventsManager();
     eventsManager.AddEvent(EventType.GoBackMainEvent, quit);
 }
예제 #22
0
 public static void AddListener(this UnityEvent value, UnityAction action, object arg0)
 {
     value.AddListener(action);
 }
예제 #23
0
 public UnityFieldProxy(object target, IProxyFieldInfo fieldInfo, UnityEvent <TValue> unityEvent) : base(target, fieldInfo)
 {
     this.unityEvent = unityEvent;
 }
예제 #24
0
 /// <summary>
 /// 登録済みのイベントリスナーをすべて解除してから指定されたリスナーのみ追加します
 /// </summary>
 public static void SetListener(this UnityEvent self, Action call)
 {
     self.RemoveAllListeners();
     self.AddListener(() => call());
 }
예제 #25
0
 public void AddOnFinished(UnityEvent finishedCallBack)
 {
 }
예제 #26
0
 /// <summary>
 /// 登録済みのイベントリスナーをすべて解除してから指定されたリスナーのみ追加します
 /// </summary>
 public static void SetListener <T>(this UnityEvent <T> self, Action <T> call)
 {
     self.RemoveAllListeners();
     self.AddListener(value => call(value));
 }
예제 #27
0
 void Awake()
 {
     timerOff  = new UnityEvent();
     countdown = new UnityEvent();
 }
예제 #28
0
 // UI SetListener extension that removes previous and then adds new listener
 // (this version is for onEndEdit, onValueChanged etc.)
 public static void SetListener <T>(this UnityEvent <T> uEvent, UnityAction <T> call)
 {
     uEvent.RemoveAllListeners();
     uEvent.AddListener(call);
 }
예제 #29
0
 public ConversationPoint(string response, ResponseTree optionTree, UnityEvent onPresentText, UnityEvent onClosedText)
 {
     this.spokenText    = response;
     this.optionTree    = optionTree;
     this.onPresentText = onPresentText;
     this.onClosedText  = onClosedText;
 }
예제 #30
0
 public void SetEvent(UnityEvent _event)
 {
     _newStateAlert = _event;
 }