Beispiel #1
0
//	EventDelegate delegateFlame;
    public void GaugeUp(int gauge, float time)
    {
        transform.FindChild("Body").FindChild("Scroll View").FindChild("Board")
        .FindChild("BG").FindChild("Sprite").gameObject.SetActive(true);
        if (time > 0)
        {
            transform.FindChild("Body").FindChild("Scroll View").FindChild("Board")
            .FindChild("BG").FindChild("PtcFlames").gameObject.SetActive(true);
            transform.FindChild("Body").FindChild("Scroll View").FindChild("Board")
            .FindChild("BG").FindChild("PtcFlames").FindChild("PtcFlameLeft").GetComponent <ParticleSystem>().Play();
            transform.FindChild("Body").FindChild("Scroll View").FindChild("Board")
            .FindChild("BG").FindChild("PtcFlames").FindChild("PtcFlameRight").GetComponent <ParticleSystem>().Play();
        }

        delegateGauge = new EventDelegate(FinishGaugeUp);
        int height = (int)(GAUGE_HEIGHT * ((float)gauge / (float)MAX_GAUGE));

        TweenHeight.Begin(transform.FindChild("Body").FindChild("Scroll View").FindChild("Board")
                          .FindChild("BG").FindChild("Sprite").GetComponent <UISprite>(), time, height);
        transform.FindChild("Body").FindChild("Scroll View").FindChild("Board")
        .FindChild("BG").FindChild("Sprite").GetComponent <TweenHeight>().SetOnFinished(delegateGauge);
        mGaugeCnt = gauge;
        TweenPosition.Begin(transform.FindChild("Body").FindChild("Scroll View").FindChild("Board")
                            .FindChild("BG").FindChild("PtcFlames").gameObject, time,
                            new Vector3(0, (-280f + height)));
    }
    public void PlayReverse()
    {
        mSp             = transform.GetComponent <UISprite>();
        spriteHeight    = mSp.localSize.y;
        mSp.onPostFill += OnPostFill;
        TweenHeight tween = TweenHeight.Begin(mSp, duration * .9f, (int)spriteHeight);

        mSp.alpha            = 1;
        tween.from           = (int)spriteHeight;
        tween.to             = 0;
        tween.animationCurve = heightCurve;
        EventDelegate.Add(tween.onFinished, OnTweenFinish, true);

        tweenValue                = MUITweenValue.Begin(gameObject, duration * .9f, 1f);
        tweenValue.startValue     = 0f;
        tweenValue.endValue       = 1f;
        tweenValue.animationCurve = alphaCurve;
        tweenValue.PlayForward();

        timeCount = 0;
        isEnd     = false;
        isChange  = true;
        isReverse = true;
        //Invoke("ChangeAlphaAni", duration / 10f);
    }
Beispiel #3
0
 void ActivateNeighbors(WMG_Node fromNode)
 {
     for (int i = 0; i < fromNode.numLinks; i++)
     {
         WMG_Link aLink = fromNode.links[i].GetComponent <WMG_Link>();
         if (!theMap.activeInHierarchy(aLink.gameObject))
         {
             // Activate and animate links expanding from source node to end node
             activatingNodesStart = fromNode;
             theMap.SetActive(aLink.gameObject, true);
             UIWidget aLinkW    = aLink.objectToScale.GetComponent <UIWidget>();
             int      origScale = Mathf.RoundToInt(aLinkW.height);
             float    p1y       = fromNode.transform.localPosition.y + (fromNode.radius) * Mathf.Sin(Mathf.Deg2Rad * fromNode.linkAngles[i]);
             float    p1x       = fromNode.transform.localPosition.x + (fromNode.radius) * Mathf.Cos(Mathf.Deg2Rad * fromNode.linkAngles[i]);
             Vector3  origPos   = aLink.transform.localPosition;
             Vector3  newPos    = new Vector3(p1x, p1y, origPos.z);
             aLink.transform.localPosition = newPos;
             TweenPosition.Begin(aLink.gameObject, 1, origPos);
             aLinkW.height = 0;
             TweenHeight tSca = TweenHeight.Begin(aLinkW, 1, origScale);
             tSca.callWhenFinished = "endActivatingNeighbors";
             tSca.eventReceiver    = this.gameObject;
         }
     }
 }
Beispiel #4
0
    void OnClick()
    {
        mToggle = !mToggle;

        if (mToggle)
        {
            widget.cachedTransform.localPosition = Vector3.zero;
            NGUITools.SetActive(normalState.gameObject, false);
            NGUITools.SetActive(exitState.gameObject, true);
            //stretch.enabled = true;
            //stretch.style = UIStretch.Style.Both;
            TweenWidth tw = TweenWidth.Begin(widget, speed, Screen.width);
            tw.method = ease;
            EventDelegate.Add(tw.onFinished, OnFullScreen, true);

            TweenHeight th = TweenHeight.Begin(widget, speed, Screen.height);
            th.method = ease;

            if (drag != null)
            {
                NGUITools.SetActive(drag.gameObject, false);
            }
            if (resize != null)
            {
                NGUITools.SetActive(resize.gameObject, false);
            }
        }
        else
        {
            NGUITools.SetActive(normalState.gameObject, true);
            NGUITools.SetActive(exitState.gameObject, false);
            stretch.style   = UIStretch.Style.None;
            stretch.enabled = false;
            //widget.width = defaultWidth;
            //widget.height = defaultHeight;

            TweenWidth tw = TweenWidth.Begin(widget, speed, defaultWidth);
            tw.method = ease;

            TweenHeight th = TweenHeight.Begin(widget, speed, defaultHeight);
            th.method = ease;

            if (drag != null)
            {
                NGUITools.SetActive(drag.gameObject, true);
            }
            if (resize != null)
            {
                NGUITools.SetActive(resize.gameObject, true);
            }
        }
    }
Beispiel #5
0
 static int Begin(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 3);
         UIWidget    arg0 = (UIWidget)ToLua.CheckUnityObject(L, 1, typeof(UIWidget));
         float       arg1 = (float)LuaDLL.luaL_checknumber(L, 2);
         int         arg2 = (int)LuaDLL.luaL_checknumber(L, 3);
         TweenHeight o    = TweenHeight.Begin(arg0, arg1, arg2);
         ToLua.Push(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Beispiel #6
0
 static public int Begin_s(IntPtr l)
 {
     try {
         UIWidget a1;
         checkType(l, 1, out a1);
         System.Single a2;
         checkType(l, 2, out a2);
         System.Int32 a3;
         checkType(l, 3, out a3);
         var ret = TweenHeight.Begin(a1, a2, a3);
         pushValue(l, true);
         pushValue(l, ret);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Beispiel #7
0
    IEnumerator DragonEyeTwinke()
    {
        if (mLeftOrRigth)
        {
            TweenWidth.Begin(Dragon_EyeLeft, DragonEyeTime, Dragon_Left_Eye_Tar * 3);
            TweenHeight.Begin(Dragon_EyeLeft, DragonEyeTime, Dragon_Eye_Min_Height);
            yield return(new WaitForSeconds(DragonEyeTime));

            TweenWidth.Begin(Dragon_EyeLeft, DragonEyeTime, Dragon_Left_Eye_Src);
            TweenHeight.Begin(Dragon_EyeLeft, DragonEyeTime, Dragon_Eye_Max_Height);

            yield return(new WaitForSeconds(0.5f));

            for (int i = 0; i < 2; ++i)
            {
                TweenWidth.Begin(Dragon_EyeLeft, DragonEyeTwink, (int)(Dragon_Left_Eye_Src * 0.5f));
                yield return(new WaitForSeconds(DragonEyeTwink));

                TweenWidth.Begin(Dragon_EyeLeft, DragonEyeTwink, Dragon_Left_Eye_Src);
                yield return(new WaitForSeconds(DragonEyeTwink));
            }
        }
        else
        {
            TweenWidth.Begin(Dragon_EyeRight, DragonEyeTime, Dragon_Left_Eye_Tar * 3);
            TweenHeight.Begin(Dragon_EyeRight, DragonEyeTime, Dragon_Eye_Min_Height);
            yield return(new WaitForSeconds(DragonEyeTime));

            TweenWidth.Begin(Dragon_EyeRight, DragonEyeTime, Dragon_Left_Eye_Src);
            TweenHeight.Begin(Dragon_EyeRight, DragonEyeTime, Dragon_Eye_Max_Height);

            yield return(new WaitForSeconds(0.5f));

            for (int i = 0; i < 3; ++i)
            {
                TweenWidth.Begin(Dragon_EyeRight, DragonEyeTwink, (int)(Dragon_Left_Eye_Src * 0.5f));
                yield return(new WaitForSeconds(DragonEyeTwink));

                TweenWidth.Begin(Dragon_EyeRight, DragonEyeTwink, Dragon_Left_Eye_Src);
                yield return(new WaitForSeconds(DragonEyeTwink));
            }
        }
    }
Beispiel #8
0
    IEnumerator playLight()
    {
        UISprite sprite = mLeftOrRigth ? LightLeft : LightRight;

        sprite.width  = Light_Width;
        sprite.height = Light_Height;

        sprite.gameObject.SetActive(true);

        TweenWidth.Begin(sprite, LightTime, Target_Width);
        yield return(new WaitForSeconds(LightTime));

        TweenHeight.Begin(sprite, LightTime, Target_Height);
        yield return(new WaitForSeconds(LightTime));

        sprite.gameObject.SetActive(false);

        StartCoroutine(DragonAppear());
    }
Beispiel #9
0
    void startLetterBox(int targetScale, float motionTime)
    {
        _letterBoxCheckNum = 0;

        TweenHeight tp = TweenHeight.Begin(spLetterBoxTop, motionTime, targetScale);

        tp.from             = spLetterBoxTop.height;
        tp.to               = targetScale;
        tp.eventReceiver    = gameObject;
        tp.callWhenFinished = "onCompleteLatterBoxEffect";
        tp.method           = UITweener.Method.EaseIn;

        TweenHeight tp2 = TweenHeight.Begin(spLetterBoxBottom, motionTime, targetScale);

        tp2.from             = spLetterBoxBottom.height;
        tp2.to               = targetScale;
        tp2.callWhenFinished = "onCompleteLatterBoxEffect";
        tp2.method           = UITweener.Method.EaseIn;
    }
Beispiel #10
0
        static int _m_Begin_xlua_st_(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);



            try {
                {
                    UIWidget widget   = (UIWidget)translator.GetObject(L, 1, typeof(UIWidget));
                    float    duration = (float)LuaAPI.lua_tonumber(L, 2);
                    int      height   = LuaAPI.xlua_tointeger(L, 3);

                    TweenHeight __cl_gen_ret = TweenHeight.Begin(widget, duration, height);
                    translator.Push(L, __cl_gen_ret);



                    return(1);
                }
            } catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }
        }
Beispiel #11
0
    public static int Begin_s(IntPtr l)
    {
        int result;

        try
        {
            UIWidget widget;
            LuaObject.checkType <UIWidget>(l, 1, out widget);
            float duration;
            LuaObject.checkType(l, 2, out duration);
            int height;
            LuaObject.checkType(l, 3, out height);
            TweenHeight o = TweenHeight.Begin(widget, duration, height);
            LuaObject.pushValue(l, true);
            LuaObject.pushValue(l, o);
            result = 2;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }
Beispiel #12
0
    /// <summary>
    /// Resize the background to fit the specified height in pixels.
    /// </summary>

    void ResizeBackground(int height, bool instant)
    {
        mBackgroundHeight = height;

        if (height == 0)
        {
            if (instant)
            {
                background.height  = 2;
                background.enabled = false;
            }
            else
            {
                UITweener tween = TweenHeight.Begin(background, 0.2f, 2);
                EventDelegate.Add(tween.onFinished, DisableBackground, true);
            }
        }
        else
        {
            background.enabled = true;

            if (instant)
            {
                UITweener tween = background.GetComponent <TweenScale>();
                if (tween != null)
                {
                    tween.enabled = false;
                }
                background.height = height + backgroundPadding;
            }
            else
            {
                TweenHeight.Begin(background, 0.2f, height + backgroundPadding);
            }
        }
    }
Beispiel #13
0
        /// <summary>
        /// 选项卡按钮的默认状态
        /// </summary>
        /// <param name="current"></param>
        private void setTabDefaultState(UIToggle current)
        {
            if (disableTabTest(current))
            {
                return;
            }
            UIButton btn = current.GetComponent <UIButton>();

            btn.enabled = true;
            btn.SetState(UIButtonColor.State.Normal, true);
            int index = int.Parse(current.gameObject.name.Substring(current.name.Length - 1));

            current.GetComponent <UISprite>().depth = 12 - index;
            switch (activeState)
            {
            case TabType.TweenScale:
                TweenHeight.Begin(current.GetComponent <UIWidget>(), 0f, defHeight);      //改变选项卡高度/
                break;

            case TabType.TweenColor:
                //btn.transform.Find("Label").GetComponent<UILabel>().color = defTextColor;  //文字变成正常色/
                break;
            }
        }
Beispiel #14
0
        /// <summary>
        /// 选项卡按钮的激活状态
        /// </summary>
        /// <param name="current"></param>
        private void setTabActiveState(UIToggle current)
        {
            if (disableTabTest(current))
            {
                return;
            }
            UIButton btn = current.GetComponent <UIButton>();

            btn.enabled = false;
            btn.SetState(UIButtonColor.State.Pressed, true);
            current.GetComponent <UISprite>().depth = 15;
            currentActive = current;

            switch (activeState)
            {
            case TabType.TweenScale:
                TweenHeight.Begin(current.GetComponent <UIWidget>(), 0f, actHeight);      //改变选项卡高度/
                break;

            case TabType.TweenColor:
                //btn.transform.Find("Label").GetComponent<UILabel>().color = actTextColor;  //文字变成激活色/
                break;
            }
        }
Beispiel #15
0
    IEnumerator DropPaperScrollDown()
    {
        yield return(new WaitForSeconds(0.5f));

        TweenHeight tween = TweenHeight.Begin(paperScroll, 0.5f, 136);
    }
Beispiel #16
0
    /// <summary>
    /// Visibly highlight the specified transform by moving the highlight sprite to be over it.
    /// </summary>

    void Highlight(UILabel lbl, bool instant)
    {
        // Change the previous label color
        if (this.mHighlightedLabel != null)
        {
            if (instant || !this.animateHighlightLabel)
            {
                this.mHighlightedLabel.color = this.textColor;
            }
            else
            {
                TweenColor.Begin(this.mHighlightedLabel.gameObject, this.animateHighlightDuration, this.textColor).method = UITweener.Method.EaseOut;
            }
        }

        // Save the new highlighted label
        this.mHighlightedLabel = lbl;

        // Animate the new label highlight
        if (this.mHighlight != null)
        {
            // Don't allow highlighting while the label is animating to its intended position
            TweenPosition tp = lbl.GetComponent <TweenPosition>();
            if (tp != null && tp.enabled)
            {
                return;
            }

            // Calculate the height for the highlight based on the label
            int hlHeight = Mathf.RoundToInt(lbl.CalculateBounds().size.y + (this.padding.y * 2f) - (this.listHLMarginTop + this.listHLMarginBottom));

            if (instant || !this.animateHighlightPosition)
            {
                this.mHighlight.height = hlHeight;
            }
            else
            {
                TweenHeight.Begin(this.mHighlight, this.animateHighlightDuration, hlHeight).method = UITweener.Method.EaseOut;
            }

            // Calculate the highligh position
            Vector3 pos = lbl.cachedTransform.localPosition;
            pos -= new Vector3((this.listPaddingLeft + this.padding.x), 0f, 0f);
            pos += new Vector3(0f, this.padding.y, 0f);
            pos += new Vector3(this.listHLMarginLeft, -this.listHLMarginTop, 0f);

            if (instant || !this.animateHighlightPosition)
            {
                this.mHighlight.cachedTransform.localPosition = pos;
            }
            else
            {
                TweenPosition.Begin(this.mHighlight.gameObject, this.animateHighlightDuration, pos).method = UITweener.Method.EaseOut;
            }
        }

        // Change the label color
        if (instant || !this.animateHighlightLabel)
        {
            lbl.color = this.listHighlightLabelColor;
        }
        else
        {
            TweenColor.Begin(lbl.gameObject, this.animateHighlightDuration, this.listHighlightLabelColor).method = UITweener.Method.EaseOut;
        }
    }
Beispiel #17
0
 public unsafe static long $Invoke0(long instance, long *args)
 {
     return(GCHandledObjects.ObjectToGCHandle(TweenHeight.Begin((UIWidget)GCHandledObjects.GCHandleToObject(*args), *(float *)(args + 1), *(int *)(args + 2))));
 }