示例#1
0
    /// <summary>
    /// Remove the selection.
    /// </summary>

    void OnDisable()
    {
        if (NGUICamera.IsHighlighted(gameObject))
        {
            OnSelect(false);
        }
    }
示例#2
0
 void OnEnable()
 {
     if (mStarted && mHighlighted)
     {
         OnHover(NGUICamera.IsHighlighted(gameObject));
     }
 }
示例#3
0
    /// <summary>
    /// If the object is currently highlighted, it should also be selected.
    /// </summary>

    void OnEnable()
    {
        if (NGUICamera.IsHighlighted(gameObject))
        {
            OnSelect(true);
        }
    }
示例#4
0
 public virtual void OnPress(bool isPressed)
 {
     if (enabled)
     {
         if (!mStarted)
         {
             Start();
         }
         TweenColor.Begin(tweenTarget, duration, isPressed ? pressed : (NGUICamera.IsHighlighted(gameObject) ? hover : mColor));
     }
 }
示例#5
0
 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;
     }
 }
示例#8
0
 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;
     }
 }
示例#9
0
    protected override void ProcessActive()
    {
        if (!mStarted)
        {
            Start();
        }

        defaultColor = m_isActive ? pressed : mDefaultColor;

        if (enabled)
        {
            TweenColor.Begin(tweenTarget, duration, (NGUICamera.IsHighlighted(gameObject) ? hover : mColor));
        }
    }
示例#10
0
 void OnEnable()
 {
     if (target != null)
     {
         if (isEnabled)
         {
             target.spriteName = NGUICamera.IsHighlighted(gameObject) ? hoverSprite : normalSprite;
             ProcessActive();
         }
         else
         {
             UpdateImageState(false);
         }
     }
 }
示例#11
0
    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;
        }
    }