/// <summary> /// Remove the selection. /// </summary> void OnDisable() { if (NGUICamera.IsHighlighted(gameObject)) { OnSelect(false); } }
void OnEnable() { if (mStarted && mHighlighted) { OnHover(NGUICamera.IsHighlighted(gameObject)); } }
/// <summary> /// If the object is currently highlighted, it should also be selected. /// </summary> void OnEnable() { if (NGUICamera.IsHighlighted(gameObject)) { OnSelect(true); } }
public virtual void OnPress(bool isPressed) { if (enabled) { if (!mStarted) { Start(); } TweenColor.Begin(tweenTarget, duration, isPressed ? pressed : (NGUICamera.IsHighlighted(gameObject) ? hover : mColor)); } }
void OnPress(bool isPressed) { if (enabled) { if (!mStarted) { Start(); } TweenRotation.Begin(tweenTarget.gameObject, duration, isPressed ? mRot * Quaternion.Euler(pressed) : (NGUICamera.IsHighlighted(gameObject) ? mRot * Quaternion.Euler(hover) : mRot)).method = NGUITweener.Method.EaseInOut; } }
protected override void ProcessActive() { if (!mStarted) { Start(); } mPos = m_isActive ? mDefaultPos + pressed : mDefaultPos; pressed = m_isActive ? Vector3.zero : mDefaultPressed; TweenPosition.Begin(tweenTarget.gameObject, duration, (NGUICamera.IsHighlighted(gameObject) ? mPos + hover : mPos)).method = NGUITweener.Method.EaseInOut; }
void OnPress(bool isPressed) { if (enabled) { if (!mStarted) { Start(); } TweenPosition.Begin(tweenTarget.gameObject, duration, isPressed ? mPos + pressed : (NGUICamera.IsHighlighted(gameObject) ? mPos + hover : mPos)).method = NGUITweener.Method.EaseInOut; } }
void OnPress(bool isPressed) { if (enabled) { if (!mStarted) { Start(); } TweenScale.Begin(tweenTarget.gameObject, duration, isPressed ? Vector3.Scale(mScale, pressed) : (NGUICamera.IsHighlighted(gameObject) ? Vector3.Scale(mScale, hover) : mScale)).method = NGUITweener.Method.EaseInOut; } }
protected override void ProcessActive() { if (!mStarted) { Start(); } defaultColor = m_isActive ? pressed : mDefaultColor; if (enabled) { TweenColor.Begin(tweenTarget, duration, (NGUICamera.IsHighlighted(gameObject) ? hover : mColor)); } }
void OnEnable() { if (target != null) { if (isEnabled) { target.spriteName = NGUICamera.IsHighlighted(gameObject) ? hoverSprite : normalSprite; ProcessActive(); } else { UpdateImageState(false); } } }
protected override void ProcessActive() { //LogManager.Log_Error(logObjName(this) + "ProccACT: " + m_isActive + " isEnable: " + isEnabled + " colors: " + pressed + defaultColor + mDefaultColor + disabledColor); if (tweenTarget) { if (!mStarted) { mStarted = true; Init(); } defaultColor = m_isActive ? pressed : (isEnabled ? mDefaultColor : disabledColor); //Color c = isEnabled ? (NGUICamera.IsHighlighted(gameObject) ? hover : defaultColor) : disabledColor; Color c = isEnabled ? (NGUICamera.IsHighlighted(gameObject) ? hover : defaultColor) : (m_isActive? defaultColor : disabledColor); TweenColor tc = TweenColor.Begin(tweenTarget, duration, c); //LogManager.Log_Error(logObjName(this) + "ProccACT: " + m_isActive + " isEnable: " + isEnabled + " colors: "+ c + pressed + defaultColor + mDefaultColor + disabledColor); tc.color = c; tc.enabled = false; } }