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); })); }
public void RemoveOnFinished(UnityEvent finishedCallBack) { }
public DialogueAction(string text, UnityAction dAction) { this.text = text; this.action = new UnityEvent(); action.AddListener(dAction); }
public override void Awake() { base.Awake(); OnNextScene = OnNextScene ?? new UnityEvent(); DontDestroyOnLoad(gameObject); }
public void SetOnFinished(UnityEvent finishedCallBack) { onFinished = finishedCallBack; }
protected override void OnAwake() { base.OnAwake(); ChangeAttackTargetEvent = new UnityEvent(); ChangeMoveTargetEvent = new UnityEvent(); }
/// <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); }
/// <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); }
public static void AddPersistentListener <T0, T1, T2, T3>(UnityEvent <T0, T1, T2, T3> unityEvent, UnityAction <T0, T1, T2, T3> call) { unityEvent.AddPersistentListener(call); }
public void Awake() { OnEntrySplash = OnEntrySplash ?? new UnityEvent(); OnExitSplash = OnExitSplash ?? new UnityEvent(); }
private void Awake() { DestroyEvent = new UnityEvent(); }
// 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)); }
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); }
public GameViewResult() { OnBack = new UnityEvent(); }
public WallGrabListener(State state, UnityEvent trig) { ownerState = state; transfrom = state.transform; trigger = trig; }
/// <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); }
protected void Reset() { this.m_TargetTransform = this.transform as RectTransform; this.m_OnChange = new UnityEvent(); }
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); }
public void Append(SignalAsset key, UnityEvent value) { m_Signals.Add(key); m_Events.Add(value); }
void SetupEvents() { ContentChanged = new UnityEvent(); ItemAdded = new SKSItemEvent(); ItemRemoved = new SKSItemEvent(); }
// Start is called before the first frame update void Start() { quit = new GoBackMainEvent(); eventsManager = EasyGetter.GetUIEventsManager(); eventsManager.AddEvent(EventType.GoBackMainEvent, quit); }
public static void AddListener(this UnityEvent value, UnityAction action, object arg0) { value.AddListener(action); }
public UnityFieldProxy(object target, IProxyFieldInfo fieldInfo, UnityEvent <TValue> unityEvent) : base(target, fieldInfo) { this.unityEvent = unityEvent; }
/// <summary> /// 登録済みのイベントリスナーをすべて解除してから指定されたリスナーのみ追加します /// </summary> public static void SetListener(this UnityEvent self, Action call) { self.RemoveAllListeners(); self.AddListener(() => call()); }
public void AddOnFinished(UnityEvent finishedCallBack) { }
/// <summary> /// 登録済みのイベントリスナーをすべて解除してから指定されたリスナーのみ追加します /// </summary> public static void SetListener <T>(this UnityEvent <T> self, Action <T> call) { self.RemoveAllListeners(); self.AddListener(value => call(value)); }
void Awake() { timerOff = new UnityEvent(); countdown = new UnityEvent(); }
// 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); }
public ConversationPoint(string response, ResponseTree optionTree, UnityEvent onPresentText, UnityEvent onClosedText) { this.spokenText = response; this.optionTree = optionTree; this.onPresentText = onPresentText; this.onClosedText = onClosedText; }
public void SetEvent(UnityEvent _event) { _newStateAlert = _event; }