Begin() static public method

Start the tweening operation.
static public Begin ( GameObject go, float duration, float alpha ) : TweenAlpha
go GameObject
duration float
alpha float
return TweenAlpha
    protected override void Awake()
    {
        //IL_006c: Unknown result type (might be due to invalid IL or missing references)
        //IL_0071: Expected O, but got Unknown
        //IL_009e: Unknown result type (might be due to invalid IL or missing references)
        //IL_00ae: Expected O, but got Unknown
        //IL_00e1: Unknown result type (might be due to invalid IL or missing references)
        //IL_0101: Unknown result type (might be due to invalid IL or missing references)
        //IL_0106: Unknown result type (might be due to invalid IL or missing references)
        //IL_0114: Unknown result type (might be due to invalid IL or missing references)
        //IL_012d: Unknown result type (might be due to invalid IL or missing references)
        //IL_015d: Unknown result type (might be due to invalid IL or missing references)
        //IL_016d: Expected O, but got Unknown
        //IL_01a4: Unknown result type (might be due to invalid IL or missing references)
        //IL_01b9: Unknown result type (might be due to invalid IL or missing references)
        //IL_01be: Expected O, but got Unknown
        //IL_01cf: Unknown result type (might be due to invalid IL or missing references)
        //IL_01d4: Expected O, but got Unknown
        //IL_01ee: Unknown result type (might be due to invalid IL or missing references)
        //IL_01f3: Expected O, but got Unknown
        //IL_020f: Unknown result type (might be due to invalid IL or missing references)
        //IL_021f: Unknown result type (might be due to invalid IL or missing references)
        //IL_022f: Unknown result type (might be due to invalid IL or missing references)
        //IL_0241: Unknown result type (might be due to invalid IL or missing references)
        //IL_0255: Unknown result type (might be due to invalid IL or missing references)
        //IL_025a: Expected O, but got Unknown
        //IL_025f: Unknown result type (might be due to invalid IL or missing references)
        //IL_0264: Expected O, but got Unknown
        base.Awake();
        uiRoot = this.GetComponent <UIRoot>();
        UIVirtualScreen.InitUIRoot(uiRoot);
        uiCamera = uiRoot.GetComponentInChildren <Camera>();
        cameras  = (Camera[])new Camera[1]
        {
            uiCamera
        };
        nguiCamera      = uiCamera.GetComponent <UICamera>();
        uiRootPanel     = uiRoot.GetComponent <UIPanel>();
        uiRootTransform = uiRoot.get_transform();
        initUseMouse    = nguiCamera.useMouse;
        initUseTouch    = nguiCamera.useTouch;
        system          = CreatePrefabUI(Resources.Load("UI/SystemUI"), null, null, true, base._transform, 0, null);
        system.CreateCtrlsArray(typeof(SYSTEM));
        Transform ctrl = system.GetCtrl(SYSTEM.FADER);

        faderPanel       = ctrl.get_parent().GetComponent <UIPanel>();
        faderPanel.depth = 4000;
        Vector3 position = ctrl.get_position();

        position.z = -1f;
        ctrl.set_position(position);
        Transform ctrl2 = system.GetCtrl(SYSTEM.BLOCKER);

        ctrl2.get_gameObject().SetActive(false);
        Transform ctrl3 = system.GetCtrl(SYSTEM.DIALOG_BLOCKER);

        dialogBlockerAlpha       = ctrl3.GetComponent <UIRect>().alpha;
        dialogBlockerTween       = TweenAlpha.Begin(ctrl3.get_gameObject(), 0.2f, dialogBlockerAlpha);
        dialogBlockerTween.value = 0f;
        dialogBlockerTween.from  = 0f;
        dialogBlockerTween.set_enabled(false);
        ctrl3.get_gameObject().SetActive(false);
        string text = "InternalUI/UI_Common/LoadingUI";

        SetLoadingUI(Resources.Load(text));
        internalUI = true;
        GameObject val     = new GameObject("ButtonEffectTop");
        UIPanel    uIPanel = val.AddComponent <UIPanel>();

        uIPanel.depth   = 10000;
        buttonEffectTop = val.get_transform();
        buttonEffectTop.SetParent(uiRootTransform);
        buttonEffectTop.set_localPosition(Vector3.get_zero());
        buttonEffectTop.set_localRotation(Quaternion.get_identity());
        buttonEffectTop.set_localScale(Vector3.get_one());
        val.set_layer(uiRoot.get_gameObject().get_layer());
        GameObject val2 = new GameObject("AtlasTop");

        atlasTop = val2.get_transform();
        atlasTop.SetParent(buttonEffectTop);
        val2.SetActive(false);
        UIButtonEffect.CacheShaderPropertyId();
        enableShadow = false;
    }
Example #2
0
    //[ss] mergeme end
    /// <summary>
    /// Fade out or fade in the active sprite and notify the OnChange event listener.
    /// </summary>

    public void Set(bool state)
    {
        if (validator != null && !validator(state))
        {
            return;
        }

        if (!mStarted)
        {
            mIsActive    = state;
            startsActive = state;
            if (activeSprite != null)
            {
                activeSprite.alpha = state ? 1f : 0f;
            }
        }
        else if (mIsActive != state)
        {
            // Uncheck all other toggles
            if (group != 0 && state)
            {
                for (int i = 0, imax = list.size; i < imax;)
                {
                    UIToggle cb = list[i];
                    if (cb != this && cb.group == group)
                    {
                        cb.Set(false);
                    }

                    if (list.size != imax)
                    {
                        imax = list.size;
                        i    = 0;
                    }
                    else
                    {
                        ++i;
                    }
                }
            }

            // Remember the state
            mIsActive = state;

            // Tween the color of the active sprite
            if (activeSprite != null)
            {
                if (instantTween || !NGUITools.GetActive(this))
                {
                    //[ss] mergeme begin
                    activeSprite.gameObject.SetActive(mIsActive);
                    //[ss] hack to activate/deactivate sprite
                    //activeSprite.alpha = mIsActive ? 1f : 0f;
                    //[ss] mergeme end
                }
                else
                {
                    TweenAlpha.Begin(activeSprite.gameObject, 0.15f, mIsActive ? 1f : 0f);
                }
            }

            if (current == null)
            {
                UIToggle tog = current;
                current = this;

                if (EventDelegate.IsValid(onChange))
                {
                    EventDelegate.Execute(onChange);
                }
                else if (eventReceiver != null && !string.IsNullOrEmpty(functionName))
                {
                    // Legacy functionality support (for backwards compatibility)
                    eventReceiver.SendMessage(functionName, mIsActive, SendMessageOptions.DontRequireReceiver);
                }
                current = tog;
            }

            // Play the checkmark animation
            if (activeAnimation != null)
            {
                ActiveAnimation aa = ActiveAnimation.Play(activeAnimation, null,
                                                          state ? Direction.Forward : Direction.Reverse,
                                                          EnableCondition.IgnoreDisabledState,
                                                          DisableCondition.DoNotDisable);
                if (aa != null && (instantTween || !NGUITools.GetActive(this)))
                {
                    aa.Finish();
                }
            }
        }
    }
Example #3
0
    /// <summary>
    /// Fade out or fade in the active sprite and notify the OnChange event listener.
    /// </summary>

    void Set(bool state)
    {
        if (!mStarted)
        {
            mIsActive    = state;
            startsActive = state;
            if (activeSprite != null)
            {
                activeSprite.alpha = state ? 1f : 0f;
            }
        }
        else if (mIsActive != state)
        {
            // Uncheck all other toggles
            if (group != 0 && state)
            {
                for (int i = 0, imax = list.size; i < imax;)
                {
                    UIToggle cb = list[i];
                    if (cb != this && cb.group == group)
                    {
                        cb.Set(false);
                    }

                    if (list.size != imax)
                    {
                        imax = list.size;
                        i    = 0;
                    }
                    else
                    {
                        ++i;
                    }
                }
            }

            // Remember the state
            mIsActive = state;

            // Tween the color of the active sprite
            if (activeSprite != null)
            {
                if (instantTween)
                {
                    activeSprite.alpha = mIsActive ? 1f : 0f;
                }
                else
                {
                    TweenAlpha.Begin(activeSprite.gameObject, 0.15f, mIsActive ? 1f : 0f);
                }
            }

            current = null;

            if (current == null)
            {
                current = this;

                if (EventDelegate.IsValid(onChange))
                {
                    EventDelegate.Execute(onChange);
                }
                else if (eventReceiver != null && !string.IsNullOrEmpty(functionName))
                {
                    // Legacy functionality support (for backwards compatibility)
                    eventReceiver.SendMessage(functionName, mIsActive, SendMessageOptions.DontRequireReceiver);
                }
                current = null;
            }

            // Play the checkmark animation
            if (activeAnimation != null)
            {
                ActiveAnimation aa = ActiveAnimation.Play(activeAnimation, state ? Direction.Forward : Direction.Reverse);
                if (instantTween)
                {
                    aa.Finish();
                }
            }
        }
    }
Example #4
0
        private void Tween(bool open, float timeout, TweenDirection tweenDirection)
        {
            if (open && (State == TweenPanelState.Opened || State == TweenPanelState.Opening))
            {
                return;
            }
            if (!open && (State == TweenPanelState.Hidden || State == TweenPanelState.Hiding))
            {
                return;
            }

            TaskScheduler.Kill(Id);

            State = open ? TweenPanelState.Opening : TweenPanelState.Hiding;
            TaskScheduler.CreateTask(() => State = open ? TweenPanelState.Opened : TweenPanelState.Hidden, Id, timeout);

            Vector3 target;

            if (open && State != TweenPanelState.Hiding)
            {
                transform.localPosition = GetHiddenPosition(tweenDirection);

                if (Transparency)
                {
                    GetComponent <UIPanel>().alpha = 0;
                }
            }

            if (open)
            {
                target = Vector3.zero;
                gameObject.SetActive(true);
            }
            else
            {
                target = GetHiddenPosition(tweenDirection);

                if (timeout > 0)
                {
                    TaskScheduler.CreateTask(() => gameObject.SetActive(false), Id, timeout);
                }
                else
                {
                    gameObject.SetActive(true);
                }
            }

            if (timeout > 0)
            {
                TweenPosition.Begin(gameObject, timeout, target).animationCurve = AnimationCurve;

                if (Transparency)
                {
                    TaskScheduler.CreateTask(() => TweenAlpha.Begin(gameObject, timeout / 2, open ? 1 : 0), Id, open ? timeout / 2 : 0);
                }
            }
            else
            {
                transform.localPosition = target;

                if (Transparency)
                {
                    GetComponent <UIPanel>().alpha = open ? 1 : 0;
                }
            }
        }
        public void setVisibleHeader(bool isVisible)
        {
            float alpha = (float)((!isVisible) ? 0 : 1);

            TweenAlpha.Begin(this._uiHeader, 0.2f, alpha);
        }
Example #6
0
 public void TweenClose()
 {
     TweenAlpha.Begin(gameObject, animTime, 0);
     TweenPosition.Begin(gameObject, animTime, ClosePos);
 }
Example #7
0
 public void Set(bool state)
 {
     if (this.validator != null && !this.validator(state))
     {
         return;
     }
     if (!this.mStarted)
     {
         this.mIsActive    = state;
         this.startsActive = state;
         if (this.activeSprite != null)
         {
             this.activeSprite.alpha = ((!state) ? 0f : 1f);
         }
     }
     else if (this.mIsActive != state)
     {
         if (this.group != 0 && state)
         {
             int i    = 0;
             int size = UIToggle.list.size;
             while (i < size)
             {
                 UIToggle uIToggle = UIToggle.list[i];
                 if (uIToggle != this && uIToggle.group == this.group)
                 {
                     uIToggle.Set(false);
                 }
                 if (UIToggle.list.size != size)
                 {
                     size = UIToggle.list.size;
                     i    = 0;
                 }
                 else
                 {
                     i++;
                 }
             }
         }
         this.mIsActive = state;
         if (this.activeSprite != null)
         {
             if (this.instantTween || !NGUITools.GetActive(this))
             {
                 this.activeSprite.alpha = ((!this.mIsActive) ? 0f : 1f);
             }
             else
             {
                 TweenAlpha.Begin(this.activeSprite.gameObject, 0.15f, (!this.mIsActive) ? 0f : 1f);
             }
         }
         if (UIToggle.current == null)
         {
             UIToggle uIToggle2 = UIToggle.current;
             UIToggle.current = this;
             if (EventDelegate.IsValid(this.onChange))
             {
                 EventDelegate.Execute(this.onChange);
             }
             else if (this.eventReceiver != null && !string.IsNullOrEmpty(this.functionName))
             {
                 this.eventReceiver.SendMessage(this.functionName, this.mIsActive, SendMessageOptions.DontRequireReceiver);
             }
             UIToggle.current = uIToggle2;
         }
         if (this.animator != null)
         {
             ActiveAnimation activeAnimation = ActiveAnimation.Play(this.animator, null, (!state) ? Direction.Reverse : Direction.Forward, EnableCondition.IgnoreDisabledState, DisableCondition.DoNotDisable);
             if (activeAnimation != null && (this.instantTween || !NGUITools.GetActive(this)))
             {
                 activeAnimation.Finish();
             }
         }
         else if (this.activeAnimation != null)
         {
             ActiveAnimation activeAnimation2 = ActiveAnimation.Play(this.activeAnimation, null, (!state) ? Direction.Reverse : Direction.Forward, EnableCondition.IgnoreDisabledState, DisableCondition.DoNotDisable);
             if (activeAnimation2 != null && (this.instantTween || !NGUITools.GetActive(this)))
             {
                 activeAnimation2.Finish();
             }
         }
     }
 }
Example #8
0
    /// <summary>
    /// Fade out or fade in the active sprite and notify the OnChange event listener.
    /// If setting the initial value, call Start() first.
    /// </summary>

    public void Set(bool state, bool notify = true)
    {
        if (validator != null && !validator(state))
        {
            return;
        }

        if (!mStarted)
        {
            mIsActive    = state;
            startsActive = state;
            if (activeSprite != null)
            {
                activeSprite.alpha = invertSpriteState ? (state ? 0f : 1f) : (state ? 1f : 0f);
            }
        }
        else if (mIsActive != state)
        {
            // Uncheck all other toggles
            if (group != 0 && state)
            {
                for (int i = 0, imax = list.size; i < imax;)
                {
                    UIToggle cb = list[i];
                    if (cb != this && cb.group == group)
                    {
                        cb.Set(false);
                    }

                    if (list.size != imax)
                    {
                        imax = list.size;
                        i    = 0;
                    }
                    else
                    {
                        ++i;
                    }
                }
            }

            // Remember the state
            mIsActive = state;

            // Tween the color of the active sprite
            if (activeSprite != null)
            {
                if (instantTween || !NGUITools.GetActive(this))
                {
                    activeSprite.alpha = invertSpriteState ? (mIsActive ? 0f : 1f) : (mIsActive ? 1f : 0f);
                }
                else
                {
                    TweenAlpha.Begin(activeSprite.gameObject, 0.15f, invertSpriteState ? (mIsActive ? 0f : 1f) : (mIsActive ? 1f : 0f));
                }
            }

            if (notify && current == null)
            {
                UIToggle tog = current;
                current = this;

                if (EventDelegate.IsValid(onChange))
                {
                    EventDelegate.Execute(onChange);
                }
                else if (eventReceiver != null && !string.IsNullOrEmpty(functionName))
                {
                    // Legacy functionality support (for backwards compatibility)
                    eventReceiver.SendMessage(functionName, mIsActive, SendMessageOptions.DontRequireReceiver);
                }
                current = tog;
            }

            // Play the checkmark animation
            if (animator != null)
            {
                ActiveAnimation aa = ActiveAnimation.Play(animator, null,
                                                          state ? Direction.Forward : Direction.Reverse,
                                                          EnableCondition.IgnoreDisabledState,
                                                          DisableCondition.DoNotDisable);
                if (aa != null && (instantTween || !NGUITools.GetActive(this)))
                {
                    aa.Finish();
                }
            }
            else if (activeAnimation != null)
            {
                ActiveAnimation aa = ActiveAnimation.Play(activeAnimation, null,
                                                          state ? Direction.Forward : Direction.Reverse,
                                                          EnableCondition.IgnoreDisabledState,
                                                          DisableCondition.DoNotDisable);
                if (aa != null && (instantTween || !NGUITools.GetActive(this)))
                {
                    aa.Finish();
                }
            }
            else if (tween != null)
            {
                bool isActive = NGUITools.GetActive(this);

                if (tween.tweenGroup != 0)
                {
                    UITweener[] tws = tween.GetComponentsInChildren <UITweener>(true);

                    for (int i = 0, imax = tws.Length; i < imax; ++i)
                    {
                        UITweener t = tws[i];

                        if (t.tweenGroup == tween.tweenGroup)
                        {
                            t.Play(state);
                            if (instantTween || !isActive)
                            {
                                t.tweenFactor = state ? 1f : 0f;
                            }
                        }
                    }
                }
                else
                {
                    tween.Play(state);
                    if (instantTween || !isActive)
                    {
                        tween.tweenFactor = state ? 1f : 0f;
                    }
                }
            }
        }
    }
Example #9
0
 public void tweenClose()
 {
     TweenAlpha.Begin(gameObject, animTime, 0);
     TweenPosition.Begin(gameObject, animTime, HidePos);
     StartCoroutine(ShowIconLightFlash(false));
 }
Example #10
0
    IEnumerator PlayAnim(float delay, UIAnimData animData, System.Action onPlayEnd)
    {
        if (delay > 0)
        {
            yield return(new WaitForSeconds(delay));
        }

        for (int i = 0; i < animData.m_frames.Count; i++)
        {
            UIAnimFrame curFrame = animData.m_frames[i];
            switch (curFrame.m_type)
            {
            case E_UIAnimType.Empty:
            {
                yield return(new WaitForSeconds(animData.m_frames[i].m_duration));
            }
            break;

            case E_UIAnimType.Set:
            {
                GameObject[] targets = animData.GetTargets();
                for (int t = 0; t < targets.Length; t++)
                {
                    if (curFrame.HasTween(E_TweenType.Position))
                    {
                        SetPosition(targets[t], curFrame.m_position);
                    }
                    if (curFrame.HasTween(E_TweenType.Rotation))
                    {
                        SetRotation(targets[t], Quaternion.Euler(curFrame.m_rotation));
                    }
                    if (curFrame.HasTween(E_TweenType.Scale))
                    {
                        SetScale(targets[t], curFrame.m_scale);
                    }
                    if (curFrame.HasTween(E_TweenType.Color))
                    {
                        SetColor(targets[t], curFrame.m_color);
                    }
                    if (curFrame.HasTween(E_TweenType.Alpha))
                    {
                        SetAlpha(targets[t], curFrame.m_alpha);
                    }
                }
            }
            break;

            case E_UIAnimType.PlaySFX:
            {
                //AudioSource audioSrc = AudioManager.ins.PlaySFX(curFrame.m_audioName, Random.Range(curFrame.m_duration, curFrame.m_alpha), curFrame.m_particleParent);
                //if (audioSrc != null)
                //{
                //    float pitch = Random.Range(curFrame.m_scale.x, curFrame.m_scale.y);
                //    audioSrc.pitch = pitch;
                //}
//						if (curFrame.m_audioName != null)
//							SoundMgr.GetSingle().play_se(curFrame.m_audioName);
            }
            break;

            case E_UIAnimType.PlayBGM:
                //if (string.IsNullOrEmpty(curFrame.m_audioName))
                //{
                //    AudioManager.ins.StopBGM();
                //}
                //else
                //{
                //    AudioManager.ins.PlayBGM(curFrame.m_audioName);
                //}
                break;

            case E_UIAnimType.PlayVOX:
            {
                //AudioManager.ins.StopAllVOX();
                //AudioManager.ins.PlayVOX(curFrame.m_audioName);
            }
            break;

            case E_UIAnimType.AddParticle:
            {
                GameObject prefab        = Resources.Load(curFrame.m_particlePath) as GameObject;
                Transform  particleTrans = MonoUtil.CreatePrefab(prefab, "particle", curFrame.m_particleParent, curFrame.m_position);
                if (curFrame.m_particleDestroyAfterPlay)
                {
                    particleTrans.gameObject.AddComponent <OneShotParticle>();
                }
            }
            break;

            case E_UIAnimType.Tween:
            {
                bool isTweening                   = true;
                bool assignedOnTweenEnd           = false;
                EventDelegate.Callback onTweenEnd = () => {
                    isTweening = false;
                };
                UITweener    tw      = null;
                GameObject[] targets = animData.GetTargets();
                for (int t = 0; t < targets.Length; t++)
                {
                    if (curFrame.HasTween(E_TweenType.Position))
                    {
                        tw        = TweenPosition.Begin(targets[t], curFrame.m_duration, curFrame.m_position);
                        tw.method = curFrame.m_method;
                        if (!assignedOnTweenEnd)
                        {
                            assignedOnTweenEnd = true;
                            tw.SetOnFinished(onTweenEnd);
                        }
                    }
                    if (curFrame.HasTween(E_TweenType.Rotation))
                    {
                        tw        = TweenRotation.Begin(targets[t], curFrame.m_duration, Quaternion.Euler(curFrame.m_rotation));
                        tw.method = curFrame.m_method;
                        if (!assignedOnTweenEnd)
                        {
                            assignedOnTweenEnd = true;
                            tw.SetOnFinished(onTweenEnd);
                        }
                    }
                    if (curFrame.HasTween(E_TweenType.Scale))
                    {
                        tw        = TweenScale.Begin(targets[t], curFrame.m_duration, curFrame.m_scale);
                        tw.method = curFrame.m_method;
                        if (!assignedOnTweenEnd)
                        {
                            assignedOnTweenEnd = true;
                            tw.SetOnFinished(onTweenEnd);
                        }
                    }
                    if (curFrame.HasTween(E_TweenType.Color))
                    {
                        tw        = TweenColor.Begin(targets[t], curFrame.m_duration, curFrame.m_color);
                        tw.method = curFrame.m_method;
                        if (!assignedOnTweenEnd)
                        {
                            assignedOnTweenEnd = true;
                            tw.SetOnFinished(onTweenEnd);
                        }
                    }
                    if (curFrame.HasTween(E_TweenType.Alpha))
                    {
                        tw        = TweenAlpha.Begin(targets[t], curFrame.m_duration, curFrame.m_alpha);
                        tw.method = curFrame.m_method;
                        if (!assignedOnTweenEnd)
                        {
                            assignedOnTweenEnd = true;
                            tw.SetOnFinished(onTweenEnd);
                        }
                    }
                }
                while (assignedOnTweenEnd && isTweening)
                {
                    yield return(null);
                }
            }
            break;

            case E_UIAnimType.SubAnim:
                if (curFrame.m_animPlayer != null)
                {
                    bool isPlaying = true;
                    curFrame.m_animPlayer.Play(() => isPlaying = false, 0f);
                    while (curFrame.m_particleDestroyAfterPlay && isPlaying)
                    {
                        yield return(null);
                    }
                }
                break;

            case E_UIAnimType.SubAnimGroup:
            {
                if (curFrame.m_animPlayerGroup != null)
                {
                    BaseAnimPlayer[] players = curFrame.m_animPlayerGroup.GetComponentsInImmediateChildren <BaseAnimPlayer>(false, Mathf.FloorToInt(curFrame.m_alpha));
                    if (players != null && players.Length > 0)
                    {
                        if (curFrame.m_duration >= 0f)
                        {
                            float duration     = curFrame.m_duration;
                            bool  isPlaying    = true;
                            float maxLength    = 0f;
                            int   maxLengthIdx = -1;
                            for (int j = 0; j < players.Length; j++)
                            {
                                if (!players[j].gameObject.activeInHierarchy)
                                {
                                    continue;
                                }
                                float curLength = players[j].Length + duration * j;
                                if (curLength > maxLength)
                                {
                                    maxLength    = curLength;
                                    maxLengthIdx = j;
                                }
                            }
                            if (maxLengthIdx == -1)
                            {
                                isPlaying = false;
                            }
                            for (int j = 0; j < players.Length; j++)
                            {
                                if (j == maxLengthIdx)
                                {
                                    players[j].Play(() => isPlaying = false, duration * j);
                                }
                                else
                                {
                                    players[j].Play(null, duration * j);
                                }
                            }
                            while (curFrame.m_particleDestroyAfterPlay && isPlaying)
                            {
                                yield return(null);
                            }
                        }
                        else
                        {
                            for (int j = 0; j < players.Length; j++)
                            {
                                bool isPlaying = true;
                                players[j].Play(() => isPlaying = false, 0f);
                                while (isPlaying)
                                {
                                    yield return(null);
                                }
                            }
                        }
                    }
                }
            }
            break;

            case E_UIAnimType.EnableBehaviour:
                if (curFrame.m_behaviour != null)
                {
                    curFrame.m_behaviour.enabled = curFrame.m_particleDestroyAfterPlay;
                }
                else
                {
                    GameObject[] targets = animData.GetTargets();
                    for (int t = 0; t < targets.Length; t++)
                    {
                        targets[t].SetActive(curFrame.m_particleDestroyAfterPlay);
                    }
                }
                break;

            case E_UIAnimType.PlayAnimation:
                if (!string.IsNullOrEmpty(curFrame.m_audioName))
                {
                    var animation = animData.m_target.GetComponent <Animation>();
                    var animator  = animData.m_target.GetComponent <Animator>();
                    if (animation != null)
                    {
                        var clip = animation[curFrame.m_audioName];
                        clip.speed = 1;
                        if (clip != null && curFrame.m_duration > 0)
                        {
                            clip.speed = clip.length / curFrame.m_duration;
                        }
                        animation.Stop();
                        animation.Play(curFrame.m_audioName);
                        yield return(new WaitForSeconds(curFrame.m_duration));
                    }
                    if (animator != null)
                    {
                        animator.Play(curFrame.m_audioName);
                    }
                }
                break;

            case E_UIAnimType.SendEvent:
                if (!string.IsNullOrEmpty(curFrame.m_audioName))
                {
                    EventManager.Instance.SendEvent(curFrame.m_audioName);
                }
                break;

            default:
                break;
            }
        }
        if (onPlayEnd != null)
        {
            onPlayEnd();
        }
    }
Example #11
0
 // Token: 0x06000326 RID: 806 RVA: 0x0001EF30 File Offset: 0x0001D130
 public void Set(bool state, bool notify = true)
 {
     if (this.validator != null && !this.validator(state))
     {
         return;
     }
     if (!this.mStarted)
     {
         this.mIsActive    = state;
         this.startsActive = state;
         if (this.activeSprite != null)
         {
             this.activeSprite.alpha = (this.invertSpriteState ? (state ? 0f : 1f) : (state ? 1f : 0f));
             return;
         }
     }
     else if (this.mIsActive != state)
     {
         if (this.group != 0 && state)
         {
             int i    = 0;
             int size = UIToggle.list.size;
             while (i < size)
             {
                 UIToggle uitoggle = UIToggle.list.buffer[i];
                 if (uitoggle != this && uitoggle.group == this.group)
                 {
                     uitoggle.Set(false, true);
                 }
                 if (UIToggle.list.size != size)
                 {
                     size = UIToggle.list.size;
                     i    = 0;
                 }
                 else
                 {
                     i++;
                 }
             }
         }
         this.mIsActive = state;
         if (this.activeSprite != null)
         {
             if (this.instantTween || !NGUITools.GetActive(this))
             {
                 this.activeSprite.alpha = (this.invertSpriteState ? (this.mIsActive ? 0f : 1f) : (this.mIsActive ? 1f : 0f));
             }
             else
             {
                 TweenAlpha.Begin(this.activeSprite.gameObject, 0.15f, this.invertSpriteState ? (this.mIsActive ? 0f : 1f) : (this.mIsActive ? 1f : 0f), 0f);
             }
         }
         if (notify && UIToggle.current == null)
         {
             UIToggle uitoggle2 = UIToggle.current;
             UIToggle.current = this;
             if (EventDelegate.IsValid(this.onChange))
             {
                 EventDelegate.Execute(this.onChange);
             }
             else if (this.eventReceiver != null && !string.IsNullOrEmpty(this.functionName))
             {
                 this.eventReceiver.SendMessage(this.functionName, this.mIsActive, SendMessageOptions.DontRequireReceiver);
             }
             UIToggle.current = uitoggle2;
         }
         if (this.animator != null)
         {
             ActiveAnimation activeAnimation = ActiveAnimation.Play(this.animator, null, state ? AnimationOrTween.Direction.Forward : AnimationOrTween.Direction.Reverse, EnableCondition.IgnoreDisabledState, DisableCondition.DoNotDisable);
             if (activeAnimation != null && (this.instantTween || !NGUITools.GetActive(this)))
             {
                 activeAnimation.Finish();
                 return;
             }
         }
         else if (this.activeAnimation != null)
         {
             ActiveAnimation activeAnimation2 = ActiveAnimation.Play(this.activeAnimation, null, state ? AnimationOrTween.Direction.Forward : AnimationOrTween.Direction.Reverse, EnableCondition.IgnoreDisabledState, DisableCondition.DoNotDisable);
             if (activeAnimation2 != null && (this.instantTween || !NGUITools.GetActive(this)))
             {
                 activeAnimation2.Finish();
                 return;
             }
         }
         else if (this.tween != null)
         {
             bool active = NGUITools.GetActive(this);
             if (this.tween.tweenGroup != 0)
             {
                 UITweener[] componentsInChildren = this.tween.GetComponentsInChildren <UITweener>(true);
                 int         j   = 0;
                 int         num = componentsInChildren.Length;
                 while (j < num)
                 {
                     UITweener uitweener = componentsInChildren[j];
                     if (uitweener.tweenGroup == this.tween.tweenGroup)
                     {
                         uitweener.Play(state);
                         if (this.instantTween || !active)
                         {
                             uitweener.tweenFactor = (state ? 1f : 0f);
                         }
                     }
                     j++;
                 }
                 return;
             }
             this.tween.Play(state);
             if (this.instantTween || !active)
             {
                 this.tween.tweenFactor = (state ? 1f : 0f);
             }
         }
     }
 }
Example #12
0
    public void Show()
    {
        Time.timeScale = 1.0f;
        MissionControl.ResetAllItem();
        LoadingScene.HideLoadingScene();
        CommonObjectScript.isViewPoppup = true;
        //Debug.Log("Show result ----------------------------------");
        missionFail.localScale = new Vector3(8, 8, 1);
        missionFail.gameObject.SetActive(false);
        TweenAlpha.Begin(missionFail.gameObject, 0, 0);
        star = 0;
        if (DialogTask.complete)
        {
            star   = 1;
            reward = MissionData.starMission.reward[0];
            if (CommonObjectScript.dollar >= MissionData.starMission.twoStar)
            {
                reward = MissionData.starMission.reward[1];
                star   = 2;
            }
            if (CommonObjectScript.dollar >= MissionData.starMission.threeStar)
            {
                reward = MissionData.starMission.reward[2];
                star   = 3;
            }
            particleWin.gameObject.SetActive(true);
            ///////////------------------------------------------
            AudioControl.getMonoBehaviour().StartCoroutine(DHS.PostMeCurrentMission(VariableSystem.mission + 1));
            //Cong tim khi thang
            AudioControl.AddHeart(1);

            //Nhac thang
            AudioControl.DPlaySound("Thang");
        }
        else
        {
            //Nhac thua
            AudioControl.DPlaySound("Thua");
        }
        //star = 3;//////////////////////////////////////////////////////
        //particleWin.gameObject.SetActive(true);
        if (Application.loadedLevelName.Equals("Farm"))
        {
            GameObject.Find("UI Root").transform.FindChild("PanelPlant").GetComponent <PlantControlScript>().BG_Click();
        }
        lbReward.text = "0";
        //Test
        //VariableSystem.dollar = 1000;
        //Thay doi ngon ngu
        bgMain.FindChild("Target").GetComponent <UILabel>().text = "" + MissionControl.Language["Require"];
        bgMain.FindChild("Score").GetComponent <UILabel>().text  = "" + MissionControl.Language["Your_Score"];
        bgMain.FindChild("Reward").GetComponent <UILabel>().text = "" + MissionControl.Language["Reward"];
        bgMain.FindChild("Ok").FindChild("Label").GetComponent <UILabel>().text       = "" + MissionControl.Language["Ok"];
        bgMain.FindChild("TryAgain").FindChild("Label").GetComponent <UILabel>().text = "" + MissionControl.Language["Try_Again"];
        bgMain.FindChild("RewardCustomer").GetComponent <UILabel>().text = "" + MissionControl.Language["Bonus_customer_rate"];
        bgMain.FindChild("LbStar1").GetComponent <UILabel>().text        = "" + MissionControl.Language["All_target"];

        lbTitle.text = MissionControl.Language["MISSION"] + " " + VariableSystem.mission;
        bgMain.FindChild("LbStar2").GetComponent <UILabel>().text = DString.ConvertString(MissionData.starMission.twoStar);
        bgMain.FindChild("LbStar3").GetComponent <UILabel>().text = DString.ConvertString(MissionData.starMission.threeStar);
        bgMain.FindChild("Score").FindChild("Label").GetComponent <UILabel>().text = DString.ConvertString(CommonObjectScript.dollar);
        bgBlack.gameObject.SetActive(true);
        LeanTween.delayedCall(1.0f, () =>
        {
            Time.timeScale = 0;
        }).setUseEstimatedTime(true);
        bgMain.gameObject.SetActive(true);
        LeanTween.scale(bgMain.gameObject, new Vector3(1, 1, 1), 0.4f).setUseEstimatedTime(true).setEase(LeanTweenType.easeOutBack).setOnComplete(() =>
        {
            star1.localScale = new Vector3(8, 8, 8);
            star2.localScale = new Vector3(8, 8, 8);
            star3.localScale = new Vector3(8, 8, 8);
            //Dieu kien xet sao
            if (star > 0)
            {
                star1.gameObject.SetActive(true);
                LeanTween.scale(star1.gameObject, new Vector3(1, 1, 1), 0.5f).setUseEstimatedTime(true).setEase(LeanTweenType.easeOutExpo).setOnComplete(() =>
                {
                    //Check dieu kien de co sao thu 2
                    if (star > 1)
                    {
                        star2.gameObject.SetActive(true);
                        LeanTween.scale(star2.gameObject, new Vector3(1, 1, 1), 0.5f).setUseEstimatedTime(true).setEase(LeanTweenType.easeOutExpo).setOnComplete(() =>
                        {
                            //Check dieu kien de co sao thu 3
                            if (star > 2)
                            {
                                star3.gameObject.SetActive(true);
                                LeanTween.scale(star3.gameObject, new Vector3(1, 1, 1), 0.5f).setUseEstimatedTime(true).setEase(LeanTweenType.easeOutExpo);
                            }
                        });
                    }
                });
            }
            else
            {
                missionFail.gameObject.SetActive(true);
                LeanTween.scale(missionFail.gameObject, new Vector3(1, 1, 1), 0.5f).setUseEstimatedTime(true).setEase(LeanTweenType.easeInOutQuart);
                TweenAlpha.Begin(missionFail.gameObject, 0.5f, 1);
            }
        });
        //Them task nhiem vu
        //if (VariableSystem.mission == 1)
        //{
        //    AddItemResult("" + MissionControl.Language["Control_guide"], true, null, false);
        //}
        foreach (Transform tf in dialogTask.FindChild("Grid").GetComponent <UIGrid>().GetChildList())
        {
            AddItemResult(tf.GetComponent <ItemTask>().lbContent.text, tf.GetComponent <ItemTask>().togComplete.value, tf.GetComponent <ItemTask>().item, tf.GetComponent <ItemTask>().typeShow1);
        }
        grid.Reposition();
        transform.FindChild("SpriteBlack").gameObject.SetActive(true);

        //An bang task khi hien thi result
        GameObject task = GameObject.Find("DialogTask").gameObject;

        if (task != null)
        {
            task.GetComponent <DialogTask>().HideButton();
        }

        GameObject inapp = GameObject.Find("DialogInapp").gameObject;

        if (inapp != null)
        {
            inapp.GetComponent <DialogInapp>().HideDialog();
        }

        //Cap nhat lai phan thuong - Neu so sao moi  <= so sao hien tai => thuong 1 kim cuong
        if (star > 0 && star <= DataCache.dataMissionCache[VariableSystem.mission - 1].Star)
        {
            reward = 1;
        }

        VariableSystem.AddDiamond(reward);
        VariableSystem.AddDiamond(CommonObjectScript.rewardCustomerRate);
        Debug.Log("CONG KIM CUONG -------------------- reward " + reward + " CommonObjectScript.rewardCustomerRate " + CommonObjectScript.rewardCustomerRate);
        DataCache.UpdateMissionScore(CommonObjectScript.dollar, star, VariableSystem.mission, 1);
        bool sendToServer = false;

        if (star > 0)
        {
            if (VariableSystem.mission < DataMissionControlNew.MAX_MISSION)
            {
                DataCache.SetMeCurrentMission(VariableSystem.mission + 1);
            }
            sendToServer = true;
        }
        DataCache.SaveMissionDataCache(sendToServer);
        lbReward.text         = "" + reward;
        lbRewardCustomer.text = "" + CommonObjectScript.rewardCustomerRate;
    }
Example #13
0
    private void Move()
    {
        if (State == GameState.Running || State == GameState.Paused)
        {
            FindObjectOfType <TaskScheduler>().CreateTask(Move, DeltaTime);
        }

        if (State != GameState.Running)
        {
            return;
        }

        var direction = DirectionNext.Count > 0 ? DirectionNext[0] : DirectionPrev;

        if (direction + DirectionPrev == Vector2.zero)
        {
            direction = DirectionPrev;
        }

        var head = Snake[0] + direction;
        var tail = Snake[Snake.Count - 1];

        if (head.x < 0 || head.x >= (int)Engine.Field.Size.x || head.y < 0 ||
            head.y >= (int)Engine.Field.Size.y || Snake.Contains(head))
        {
            Snake.Add(tail);
            CompleteGame();

            for (var i = 0; i < Snake.Count; i++)
            {
                var index  = i;
                var sprite = Engine.Field.Sprites[(int)Snake[index].x, (int)Snake[index].y];

                Engine.TaskScheduler.CreateTask(() =>
                {
                    TweenAlpha.Begin(sprite.gameObject, 0.25f, 0.4f);
                    CreateSparks(Snake[index], SnakeColor);
                }, (i + 1) * 0.05f);
            }

            return;
        }

        Snake.Reverse();
        Snake.Add(head);
        Snake.Reverse();

        if (head != Apple)
        {
            Snake.Remove(tail);
        }

        TweenColor.Begin(Engine.Field.Sprites[(int)head.x, (int)head.y].gameObject, DeltaTime, SnakeColor);

        if (head != tail)
        {
            TweenColor.Begin(Engine.Field.Sprites[(int)tail.x, (int)tail.y].gameObject, DeltaTime,
                             Engine.Field.Color);
        }

        DirectionPrev = direction;

        if (DirectionNext.Count > 0)
        {
            DirectionNext.RemoveAt(0);
        }

        if (head == Apple)
        {
            CreateApple();
            Engine.Interface.UpdateScore();

            var up = false;

            for (var i = 0; i < Targets.Length; i++)
            {
                if (Snake.Count != Targets[i])
                {
                    continue;
                }

                DeltaTime = DeltaTimes[i];

                _fillAmount = Mathf.Max(0, 1 - Snake.Count / (float)PassTarget);

                up = true;
            }

            if (up)
            {
                Engine.AudioPlayer.PlayUp();
            }
            else
            {
                Engine.AudioPlayer.PlayAppleEaten();
            }

            CreateSparks(head, up ? GreenAppleColor : AppleColor);
            AchivementsManager.AppleEaten(Snake.Count);

            if (Snake.Count == Targets[Targets.Length - 3])
            {
                Engine.TaskScheduler.CreateTask(Engine.AudioPlayer.PlayStageCompleted, 0.5f);
            }
        }
    }
Example #14
0
    internal void FadeOut()
    {
        TweenAlpha tAlpha = TweenAlpha.Begin(_bg.gameObject, _fadeOutTime, 0f);

        tAlpha.AddOnFinished(FadeOutFinish);
    }
    private void EventFilterBet()
    {
        betFilterLabel.SetCurrentSelection();
        string crtSelect = UIPopupList.current.value;

        Debug.Log("EventFilterBet " + crtSelect);
        if (crtSelect == crtBetFilter)
        {
            return;
        }
        crtBetFilter = crtSelect;
        switch (crtSelect)
        {
        case "Bet_Filter_All":
            InitScrollViewData();
            break;

        case "Bet_Filter_under_50k":
            filteredRoomList = new JSONArray();
            for (int i = 0; i < roomList.Length; i++)
            {
                if (roomList[i].Obj.GetInt("minBet") <= 50000)
                {
                    filteredRoomList.Add(roomList[i].Obj);
                }
            }
            InitScrollViewData(true);
            break;

        case "Bet_Filter_over_100k":
            filteredRoomList = new JSONArray();
            for (int i = 0; i < roomList.Length; i++)
            {
                if (roomList[i].Obj.GetInt("minBet") >= 100000)
                {
                    filteredRoomList.Add(roomList[i].Obj);
                }
            }
            InitScrollViewData(true);
            break;

        case "Bet_Filter_over_500k":
            filteredRoomList = new JSONArray();
            for (int i = 0; i < roomList.Length; i++)
            {
                if (roomList[i].Obj.GetInt("minBet") >= 500000)
                {
                    filteredRoomList.Add(roomList[i].Obj);
                }
            }
            InitScrollViewData(true);
            break;

        case "Bet_Filter_over_1m":
            filteredRoomList = new JSONArray();
            for (int i = 0; i < roomList.Length; i++)
            {
                if (roomList[i].Obj.GetInt("minBet") >= 1000000)
                {
                    filteredRoomList.Add(roomList[i].Obj);
                }
            }
            InitScrollViewData(true);
            break;
        }
        scrollview.panel.alpha = 0.1f;
        TweenAlpha tween = TweenAlpha.Begin(scrollview.gameObject, 0.8f, 1.0f);
    }
Example #16
0
 public void Display()
 {
     TweenAlpha.Begin(gameObject, 0.2f, 1);
 }
Example #17
0
 public void Hide()
 {
     isShowing = false;
     TweenAlpha.Begin(gameObject, 0.1f, 0);
 }
Example #18
0
 public void Hide()
 {
     TweenAlpha.Begin(gameObject, 0.2f, 0);
 }
Example #19
0
 public void Close()
 {
     TweenAlpha.Begin(gameObject, 0, 0);
     transform.localPosition = ClosePos;
 }
Example #20
0
 void Start()
 {
     TweenAlpha.Begin(gameObject, 0, 0);
 }
Example #21
0
        /// <summary>
        /// 需要展示详细属性的调这个,比如在背包里
        /// </summary>
        /// <param name="itemFielInfo">Item fiel info.</param>
        /// <param name="myParent">My parent.</param>
        public void Show(ItemFielInfo itemFielInfo, PackInfoPanel myParent)
        {
            m_PackRightBtnManager.gameObject.SetActive(true);
            HasClik = false;
            bool ShowPathLinkBtn = false;

            this.MyParent = myParent;
            CurrentItem   = itemFielInfo;
            TweenAlpha.Begin(m_PackRightBtnManager.gameObject, 0.1f, 0, 1, null);
            TweenPosition.Begin(m_PackRightBtnManager.gameObject, 0.1f, m_PackRightBtnManager.transform.localPosition, RightBtnShowPos);
            transform.localPosition = new Vector3(0, 0, -150);
            InitButton(itemFielInfo);
            switch (itemFielInfo.LocalItemData._GoodsClass)
            {
            case 1:            //装备显示
                bool isEquiptItem = ContainerInfomanager.Instance.GetEquiptItemList().FirstOrDefault(P => P == itemFielInfo) != null;
                if (isEquiptItem)
                {
                    if (EquiptItemTips_equipt == null)
                    {
                        EquiptItemTips_equipt = CreatObjectToNGUI.InstantiateObj(EquiptItemTipsPrefab, transform).GetComponent <ItemInfoTips_Equipment>();
                    }

                    EquiptItemTips_equipt.Show(itemFielInfo, true, true, ShowPathLinkBtn);
                }
                else
                {
                    if (EquiptItemTips_normal == null)
                    {
                        EquiptItemTips_normal = CreatObjectToNGUI.InstantiateObj(EquiptItemTipsPrefab, transform).GetComponent <ItemInfoTips_Equipment>();
                    }
                    EquiptItemTips_normal.Show(itemFielInfo, false, false, ShowPathLinkBtn);
                    ItemFielInfo equiptPairItem = ContainerInfomanager.Instance.GetEquiptItemList().FirstOrDefault
                                                      (P => (P.LocalItemData as EquipmentData)._vectEquipLoc == (itemFielInfo.LocalItemData as EquipmentData)._vectEquipLoc);
                    if (equiptPairItem != null)
                    {
                        if (EquiptItemTips_equipt == null)
                        {
                            EquiptItemTips_equipt = CreatObjectToNGUI.InstantiateObj(EquiptItemTipsPrefab, transform).GetComponent <ItemInfoTips_Equipment>();
                        }
                        EquiptItemTips_equipt.Show(equiptPairItem, true, true, ShowPathLinkBtn);
                    }
                }
                break;

            case 2:
                if (itemFielInfo.LocalItemData._GoodsSubClass == 4)
                {
                    //if(GiftPanelItemtips!=null){Destroy(GiftPanelItemtips);}
                    if (GiftPanelItemtips == null)
                    {
                        GiftPanelItemtips = CreatObjectToNGUI.InstantiateObj(GiftItemTipsPrefab, transform).GetComponent <GiftPanel>();
                    }
                    GiftPanelItemtips.Show(itemFielInfo);
                    GiftPanelItemtips.CallBackOnSellClick   = OnButtonClick;
                    GiftPanelItemtips.CallBackOnCloseHandle = Close;
                }
                else
                {
                    if (MedicineItemtips == null)
                    {
                        MedicineItemtips = CreatObjectToNGUI.InstantiateObj(MedicineItemTipsPrefab, transform).GetComponent <ItemInfoTips_Medicine>();
                    }
                    MedicineItemtips.Show(itemFielInfo);
                }
                break;

            case 3:
                if (itemFielInfo.LocalItemData._GoodsSubClass == 3)
                {
                    if (EquiptItemTips_Jewel == null)
                    {
                        EquiptItemTips_Jewel = CreatObjectToNGUI.InstantiateObj(JewelItemTipsPrefab, transform).GetComponent <ItemInfoTips_Jewel>();
                    }
                    EquiptItemTips_Jewel.Show(itemFielInfo, true, true);
                }
                else
                {
                    if (MedicineItemtips == null)
                    {
                        MedicineItemtips = CreatObjectToNGUI.InstantiateObj(MedicineItemTipsPrefab, transform).GetComponent <ItemInfoTips_Medicine>();
                    }
                    MedicineItemtips.Show(itemFielInfo);
                }
                break;

            default:
                break;
            }
        }
Example #22
0
 private void FadeIn()
 {
     TweenAlpha.Begin(this.uxRoot, this.durations[this.state], 1f, 0f);
     this.source.Play();
 }
Example #23
0
        private void ShowCostLabelInButton()
        {
            if (IsShowCostLabel)
            {
                return;
            }
            var currentEctype = TeamManager.Instance.CurrentEctypeData;
            //Todo:onSelectEctypeData协议已经取消dwEctypeID和byDiff难度,如果使用需要从新更改
//            var ectypeSelect = EctypeConfigManager.Instance.EctypeSelectConfigList[(int)currentEctype.dwEctypeID];
//            var ectypeID = ectypeSelect._vectContainer[currentEctype.byDiff - 1];
            EctypeContainerData SelectContainerData = null;            // = EctypeConfigManager.Instance.EctypeContainerConfigList[ectypeID];
            bool isShowCostType  = true;
            int  localCostNumber = int.Parse(SelectContainerData.lCostEnergy);
            int  costNumber      = 0;

            switch (SelectContainerData.lCostType)
            {
            case 1:
                costNumber     = PlayerManager.Instance.FindHeroDataModel().PlayerValues.PLAYER_FIELD_CURRENCY_ACTIVELIFE;
                isShowCostType = costNumber > 0;
                break;

            case 2:
                costNumber     = PlayerManager.Instance.FindHeroDataModel().PlayerValues.PLAYER_FIELD_BINDPAY;
                isShowCostType = costNumber >= localCostNumber;
                break;

            case 3:
                costNumber     = PlayerManager.Instance.FindHeroDataModel().PlayerValues.PLAYER_FIELD_HOLDMONEY;
                isShowCostType = costNumber >= localCostNumber;
                break;

            default:
                break;
            }
            //if (isShowCostType)
            //{
            //    LocalButtonCallBack Tips = CreatObjectToNGUI.InstantiateObj(CostLabelPreafab, CaptainStartButton.transform).GetComponent<LocalButtonCallBack>();
            //    Vector3 fromPoint = new Vector3(0, 50, -30);
            //    Vector3 toPoint = new Vector3(0, 0, -30);
            //    TweenPosition.Begin(Tips.gameObject, 0.5f, fromPoint, toPoint, SpecialEctypeStart);
            //    TweenAlpha.Begin(Tips.gameObject, 0.5f, 1, 0, null);
            //    Tips.SetButtonBackground(SelectContainerData.lCostType);
            //    Tips.SetButtonText(string.Format("-{0}", costNumber>localCostNumber?localCostNumber:costNumber));
            //}
            //else
            //{
            //    SpecialEctypeStart(null);
            //}
            //GameObject Tips = CreatObjectToNGUI.InstantiateObj(CostLabelPreafab, CostLabelPreafab.transform.parent);
            //Vector3 curPoint = CostLabelPreafab.transform.localPosition;
            //Vector3 fromPoint = curPoint + new Vector3(0, 30, -30);
            //Vector3 toPoint = curPoint + new Vector3(0, 0, -30);

            //回调
            var teamProp = TeamManager.Instance.MyTeamProp;

            TeamManager.Instance.RegisteTeam(teamProp);
            //队长
            var playerData = PlayerManager.Instance.FindHeroDataModel();

            if (teamProp.TeamContext.dwCaptainId == playerData.ActorID)
            {
                if (isShowCostType)
                {
                    SoundManager.Instance.PlaySoundEffect("Sound_Button_Fight");
                    GameObject Tips      = CreatObjectToNGUI.InstantiateObj(CostLabelPreafab, CostLabelPreafab.transform.parent);
                    Vector3    curPoint  = CostLabelPreafab.transform.localPosition;
                    Vector3    fromPoint = curPoint + new Vector3(0, 30, -30);
                    Vector3    toPoint   = curPoint + new Vector3(0, 0, -30);
                    TweenPosition.Begin(Tips, 0.5f, fromPoint, toPoint, null);
                    TweenAlpha.Begin(Tips, 0.5f, 1, 0, null);
                    StartCoroutine(SetShowCostLabelFalseForTime(1));
                    StartCoroutine(LaterSpecialEctypeStart());
                }
                else
                {
                    SpecialEctypeStart(null);
                }
            }
            else
            {
                if (isShowCostType)
                {
                    SoundManager.Instance.PlaySoundEffect("Sound_Button_Fight");
                    GameObject Tips      = CreatObjectToNGUI.InstantiateObj(CostLabelPreafab, CostLabelPreafab.transform.parent);
                    Vector3    curPoint  = CostLabelPreafab.transform.localPosition;
                    Vector3    fromPoint = curPoint + new Vector3(0, 30, -30);
                    Vector3    toPoint   = curPoint + new Vector3(0, 0, -30);
                    TweenPosition.Begin(Tips, 0.5f, fromPoint, toPoint, null);
                    TweenAlpha.Begin(Tips, 0.5f, 1, 0, null);
                    StartCoroutine(SetShowCostLabelFalseForTime(1));
                }
            }
        }
Example #24
0
 private void FadeOut()
 {
     TweenAlpha.Begin(this.uxRoot, this.durations[this.state], 0f, 0f);
 }
 public void fadeOutCircleButtonLabel()
 {
     TweenAlpha.Begin(this._clsCircles.circleLabel.get_gameObject(), 0.4f, 0f);
     TweenAlpha.Begin(this._clsCircles.circleLabelBlur.get_gameObject(), 0.4f, 0f);
 }
Example #26
0
 void TweenShowBackground(object obj)
 {
     TweenAlpha.Begin(Background.gameObject, 0.3f, 0, 1, null);
 }
Example #27
0
    /// <summary>
    /// Fade out or fade in the checkmark and notify the target of OnChecked event.
    /// </summary>

    protected virtual void Set(bool state)
    {
        if (!mStarted)
        {
            mChecked      = state;
            startsChecked = state;
            if (checkSprite != null)
            {
                checkSprite.alpha = state ? 1f : 0f;
            }
        }
        else if (mChecked != state)
        {
            // Uncheck all other checkboxes
            if (radioButtonRoot != null && state)
            {
                UICheckbox[] cbs = radioButtonRoot.GetComponentsInChildren <UICheckbox>(true);

                for (int i = 0, imax = cbs.Length; i < imax; ++i)
                {
                    UICheckbox cb = cbs[i];
                    if (cb != this && cb.radioButtonRoot == radioButtonRoot)
                    {
                        cb.Set(false);
                    }
                }
            }

            // Remember the state
            mChecked = state;

            // Tween the color of the checkmark
            if (checkSprite != null)
            {
                if (instantTween)
                {
                    checkSprite.alpha = mChecked ? 1f : 0f;
                }
                else
                {
                    TweenAlpha.Begin(checkSprite.gameObject, 0.15f, mChecked ? 1f : 0f);
                }
            }

            current = this;

            // Notify the delegate
            if (onStateChange != null)
            {
                onStateChange(mChecked);
            }

            // Send out the event notification
            if (eventReceiver != null && !string.IsNullOrEmpty(functionName))
            {
                eventReceiver.SendMessage(functionName, mChecked, SendMessageOptions.DontRequireReceiver);
            }
            current = null;

            // Play the checkmark animation
            if (checkAnimation != null)
            {
                ActiveAnimation.Play(checkAnimation, state ? Direction.Forward : Direction.Reverse);
            }
        }
    }
Example #28
0
 public void ShowSelMode()
 {
     TweenAlpha.Begin(SelModeRoot, 0.2f, 1f);
 }
Example #29
0
 private void Set(bool state)
 {
     if (!this.mStarted)
     {
         this.mIsActive    = state;
         this.startsActive = state;
         if (this.activeSprite != null)
         {
             this.activeSprite.alpha = ((!state) ? 0f : 1f);
         }
     }
     else if (this.mIsActive != state)
     {
         if (this.group != 0 && state)
         {
             int i    = 0;
             int size = UIToggle.list.size;
             while (i < size)
             {
                 UIToggle uIToggle = UIToggle.list[i];
                 if (uIToggle != this && uIToggle.group == this.group)
                 {
                     uIToggle.Set(false);
                 }
                 if (UIToggle.list.size != size)
                 {
                     size = UIToggle.list.size;
                     i    = 0;
                 }
                 else
                 {
                     i++;
                 }
             }
         }
         this.mIsActive = state;
         if (this.activeSprite != null)
         {
             if (this.instantTween)
             {
                 this.activeSprite.alpha = ((!this.mIsActive) ? 0f : 1f);
             }
             else
             {
                 TweenAlpha.Begin(this.activeSprite.gameObject, 0.1f, (!this.mIsActive) ? 0f : 1f);
             }
         }
         if (UIToggle.current == null)
         {
             UIToggle.current = this;
             if (EventDelegate.IsValid(this.onChange))
             {
                 EventDelegate.Execute(this.onChange);
             }
             else if (this.eventReceiver != null && !string.IsNullOrEmpty(this.functionName))
             {
                 this.eventReceiver.SendMessage(this.functionName, this.mIsActive, SendMessageOptions.DontRequireReceiver);
             }
             UIToggle.current = null;
         }
         if (this.activeAnimation != null)
         {
             ActiveAnimation activeAnimation = ActiveAnimation.Play(this.activeAnimation, (!state) ? Direction.Reverse : Direction.Forward);
             if (this.instantTween)
             {
                 activeAnimation.Finish();
             }
         }
     }
 }
Example #30
0
    private void FadeOutGlow()
    {
        TweenAlpha tween = TweenAlpha.Begin(glowBackground, 0.5f, 0);

        EventDelegate.Add(tween.onFinished, HideGlow, true);
    }