private void OnEnable() { if (EventDelegate.IsValid(onChange)) { eventReceiver = null; functionName = null; } if (font != null) { if (font.isDynamic) { trueTypeFont = font.dynamicFont; fontStyle = font.dynamicFontStyle; mUseDynamicFont = true; } else if (bitmapFont == null) { bitmapFont = font; mUseDynamicFont = false; } font = null; } if (textScale != 0f) { fontSize = ((!(bitmapFont != null)) ? 16 : Mathf.RoundToInt((float)bitmapFont.defaultSize * textScale)); textScale = 0f; } if (trueTypeFont == null && bitmapFont != null && bitmapFont.isDynamic) { trueTypeFont = bitmapFont.dynamicFont; bitmapFont = null; } }
/// <summary> /// Trigger all event notification callbacks. /// </summary> protected void TriggerCallbacks() { if (!mExecuting) { mExecuting = true; UIPopupList old = current; current = this; // Legacy functionality if (mLegacyEvent != null) { mLegacyEvent(mSelectedItem); } if (EventDelegate.IsValid(onChange)) { EventDelegate.Execute(onChange); } else if (eventReceiver != null && !string.IsNullOrEmpty(functionName)) { // Legacy functionality support (for backwards compatibility) eventReceiver.SendMessage(functionName, mSelectedItem, SendMessageOptions.DontRequireReceiver); } current = old; mExecuting = false; } }
private void OnEnable() { if (EventDelegate.IsValid(this.onChange)) { this.eventReceiver = null; this.functionName = null; } if (this.font != null) { if (this.font.isDynamic) { this.trueTypeFont = this.font.dynamicFont; this.fontStyle = this.font.dynamicFontStyle; this.mUseDynamicFont = true; } else if (this.bitmapFont == null) { this.bitmapFont = this.font; this.mUseDynamicFont = false; } this.font = null; } if (this.textScale != 0f) { this.fontSize = ((!(this.bitmapFont != null)) ? 16 : Mathf.RoundToInt((float)this.bitmapFont.defaultSize * this.textScale)); this.textScale = 0f; } if (this.trueTypeFont == null && this.bitmapFont != null && this.bitmapFont.isDynamic) { this.trueTypeFont = this.bitmapFont.dynamicFont; this.bitmapFont = null; } }
/// <summary> /// Set the progress bar's value. If setting the initial value, call Start() first. /// </summary> public void Set(float val, bool notify = true) { val = Mathf.Clamp01(val); if (mValue != val) { float before = value; mValue = val; if (mStarted && before != value) { ForceUpdate(); if (notify && NGUITools.GetActive(this) && EventDelegate.IsValid(onChange)) { current = this; EventDelegate.Execute(onChange); current = null; } } #if UNITY_EDITOR if (!Application.isPlaying) { NGUITools.SetDirty(this); } #endif } }
protected void TriggerCallbacks() { if (!this.mExecuting) { this.mExecuting = true; UIPopupList uIPopupList = UIPopupList.current; UIPopupList.current = this; if (this.mLegacyEvent != null) { this.mLegacyEvent(this.mSelectedItem); } if (EventDelegate.IsValid(this.onChange)) { EventDelegate.Execute(this.onChange); } else { if (this.eventReceiver != null && !string.IsNullOrEmpty(this.functionName)) { this.eventReceiver.SendMessage(this.functionName, this.mSelectedItem, SendMessageOptions.DontRequireReceiver); } } UIPopupList.current = uIPopupList; this.mExecuting = false; } }
private void OnEnable() { //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) if (EventDelegate.IsValid(onChange)) { eventReceiver = null; functionName = null; } if (font != null) { if (font.isDynamic) { trueTypeFont = font.dynamicFont; fontStyle = font.dynamicFontStyle; mUseDynamicFont = true; } else if (bitmapFont == null) { bitmapFont = font; mUseDynamicFont = false; } font = null; } if (textScale != 0f) { fontSize = ((!(bitmapFont != null)) ? 16 : Mathf.RoundToInt((float)bitmapFont.defaultSize * textScale)); textScale = 0f; } if (trueTypeFont == null && bitmapFont != null && bitmapFont.isDynamic) { trueTypeFont = bitmapFont.dynamicFont; bitmapFont = null; } }
private void Start() { if (this.eventReceiver != (UnityEngine.Object)null && EventDelegate.IsValid(this.onFinished)) { this.eventReceiver = (GameObject)null; this.callWhenFinished = (String)null; } }
// Token: 0x060031C5 RID: 12741 RVA: 0x000F6958 File Offset: 0x000F4D58 private void Start() { if (this.eventReceiver != null && EventDelegate.IsValid(this.onFinished)) { this.eventReceiver = null; this.callWhenFinished = null; } }
/// <summary> /// Event receiver is only kept for backwards compatibility purposes. It's removed on start if new functionality is used. /// </summary> void Start() { if (eventReceiver != null && EventDelegate.IsValid(onFinished)) { eventReceiver = null; callWhenFinished = null; } }
private void Awake() { if (eventReceiver != null && EventDelegate.IsValid(onFinished)) { eventReceiver = null; callWhenFinished = null; } }
protected void ExecuteOnChange() { if (UIInput.current == (UnityEngine.Object)null && EventDelegate.IsValid(this.onChange)) { UIInput.current = this; EventDelegate.Execute(this.onChange); UIInput.current = (UIInput)null; } }
static int IsValid(IntPtr L) { LuaScriptMgr.CheckArgsCount(L, 1); List <EventDelegate> arg0 = (List <EventDelegate>)LuaScriptMgr.GetNetObject(L, 1, typeof(List <EventDelegate>)); bool o = EventDelegate.IsValid(arg0); LuaScriptMgr.Push(L, o); return(1); }
protected void ExecuteOnChange() { if (current == null && EventDelegate.IsValid(onChange)) { current = this; EventDelegate.Execute(onChange); current = null; } }
protected void OnEnable() { if (mStarted && current == null && EventDelegate.IsValid(onChange)) { current = this; EventDelegate.Execute(onChange); current = null; } }
private static int IsValid(IntPtr L) { LuaScriptMgr.CheckArgsCount(L, 1); List <EventDelegate> list = (List <EventDelegate>)LuaScriptMgr.GetNetObject(L, 1, typeof(List <EventDelegate>)); bool b = EventDelegate.IsValid(list); LuaScriptMgr.Push(L, b); return(1); }
protected void ExecuteOnChange() { if (UIInput.current == null && EventDelegate.IsValid(this.onChange)) { UIInput.current = this; EventDelegate.Execute(this.onChange); UIInput.current = null; } }
protected void ExecuteOnChange() { if (!((UnityEngine.Object)UIInput.current == (UnityEngine.Object)null) || !EventDelegate.IsValid(this.onChange)) { return; } UIInput.current = this; EventDelegate.Execute(this.onChange); UIInput.current = (UIInput)null; }
protected void ExecuteOnKeyTriggered(KeyCode key) { if (UIInput.current == null && EventDelegate.IsValid(this.onKeyTriggered)) { UIInput.current = this; this.recentKey = key; EventDelegate.Execute(this.onKeyTriggered); this.recentKey = KeyCode.None; UIInput.current = null; } }
/// <summary> /// Check or uncheck on click. /// </summary> void OnClick() { if (enabled) { value = !value; } if (EventDelegate.IsValid(onClick)) { EventDelegate.Execute(onClick); } }
/// <summary> /// Trigger all event notification callbacks. /// </summary> protected void TriggerCallbacks() { current = this; if (EventDelegate.IsValid(onChange)) { EventDelegate.Execute(onChange); } current = null; }
public override void CloseSelf() { base.CloseSelf(); if (onClose.Count > 0) { if (EventDelegate.IsValid(onClose)) { EventDelegate.Execute(onClose); } } }
void OnEnable() { mTrigger = target as UIEventTrigger; EditorPrefs.SetBool("ET0", EventDelegate.IsValid(mTrigger.onHoverOver)); EditorPrefs.SetBool("ET1", EventDelegate.IsValid(mTrigger.onHoverOut)); EditorPrefs.SetBool("ET2", EventDelegate.IsValid(mTrigger.onPress)); EditorPrefs.SetBool("ET3", EventDelegate.IsValid(mTrigger.onRelease)); EditorPrefs.SetBool("ET4", EventDelegate.IsValid(mTrigger.onSelect)); EditorPrefs.SetBool("ET5", EventDelegate.IsValid(mTrigger.onDeselect)); EditorPrefs.SetBool("ET6", EventDelegate.IsValid(mTrigger.onClick)); EditorPrefs.SetBool("ET7", EventDelegate.IsValid(mTrigger.onDoubleClick)); }
void Awake() { // Remove deprecated functionality if new one is used if (eventReceiver != null && EventDelegate.IsValid(onFinished)) { eventReceiver = null; callWhenFinished = null; #if UNITY_EDITOR UnityEditor.EditorUtility.SetDirty(this); #endif } }
void Awake() { // Remove deprecated functionality if new one is used if (eventReceiver != null && EventDelegate.IsValid(onFinished)) { eventReceiver = null; callWhenFinished = null; #if UNITY_EDITOR && !DLL_TYPE NGUITools.SetDirty(this); #endif } }
/// <summary> /// Activate the initial state. /// </summary> public void Start() { if (mStarted) { return; } if (startsChecked) { startsChecked = false; startsActive = true; #if UNITY_EDITOR NGUITools.SetDirty(this); #endif } // Auto-upgrade if (!Application.isPlaying) { if (checkSprite != null && activeSprite == null) { activeSprite = checkSprite; checkSprite = null; } if (checkAnimation != null && activeAnimation == null) { activeAnimation = checkAnimation; checkAnimation = null; } if (Application.isPlaying && activeSprite != null) { activeSprite.alpha = invertSpriteState ? (startsActive ? 0f : 1f) : (startsActive ? 1f : 0f); } if (EventDelegate.IsValid(onChange)) { eventReceiver = null; functionName = null; } } else { mIsActive = !startsActive; mStarted = true; bool instant = instantTween; instantTween = true; Set(startsActive); instantTween = instant; } }
/// <summary> /// Activate the initial state. /// </summary> void Start() { if (startsChecked) { startsChecked = false; startsActive = true; #if UNITY_EDITOR NGUITools.SetDirty(this); #endif } #if UNITY_EDITOR // Auto-upgrade if (!Application.isPlaying) { if (checkSprite != null && activeSprite == null) { activeSprite = checkSprite; checkSprite = null; } if (checkAnimation != null && activeAnimation == null) { activeAnimation = checkAnimation; checkAnimation = null; } if (Application.isPlaying && activeSprite != null) { activeSprite.alpha = startsActive ? 1f : 0f; } if (radioButtonRoot != null && group == 0) { Debug.LogWarning(NGUITools.GetHierarchy(gameObject) + " uses a 'Radio Button Root'. You need to change it to use a 'group' instead.", this); } if (EventDelegate.IsValid(onChange)) { eventReceiver = null; functionName = null; } } else #endif { mIsActive = !startsActive; mStarted = true; Set(startsActive); } }
/// <summary> /// Refill the text label based on what's currently visible. /// </summary> protected void UpdateVisibleText() { if (isValid) { if (mTotalLines == 0) { textLabel.text = ""; return; } int maxLines = Mathf.FloorToInt((float)textLabel.height / lineHeight); int sh = Mathf.Max(0, mTotalLines - maxLines); int offset = Mathf.RoundToInt(mScroll * sh); if (offset < 0) { offset = 0; } StringBuilder final = new StringBuilder(); for (int i = 0, imax = paragraphs.size; maxLines > 0 && i < imax; ++i) { Paragraph p = mParagraphs.buffer[i]; for (int b = 0, bmax = p.lines.Length; maxLines > 0 && b < bmax; ++b) { string s = p.lines[b]; if (offset > 0) { --offset; } else { if (final.Length > 0) { final.Append("\n"); } final.Append(s); --maxLines; } } } textLabel.text = final.ToString(); if (EventDelegate.IsValid(onChange)) { EventDelegate.Execute(onChange); } } }
private void Awake() { UIButton component = base.GetComponent <UIButton>(); if (component != null) { this.dragHighlight = component.dragHighlight; } if (this.eventReceiver != null && EventDelegate.IsValid(this.onFinished)) { this.eventReceiver = null; this.callWhenFinished = null; } }
private void Awake() { UIButton component = GetComponent <UIButton>(); if (component != null) { dragHighlight = component.dragHighlight; } if (eventReceiver != null && EventDelegate.IsValid(onFinished)) { eventReceiver = null; callWhenFinished = null; } }
private void Awake() { UIButton component = base.GetComponent <UIButton>(); if (component != (UnityEngine.Object)null) { this.dragHighlight = component.dragHighlight; } if (this.eventReceiver != (UnityEngine.Object)null && EventDelegate.IsValid(this.onFinished)) { this.eventReceiver = (GameObject)null; this.callWhenFinished = (String)null; } }