示例#1
0
    public ActionInterval OnClick12()
    {
        var action = CCActionSequence.Create(
            CCAction.CCDelay(0, () => { Reset(); SetTile("跳数字"); }),
            CCActionDelay.Create(0.2f),
            text.CCNumberTo(1.0f, "数字跳动,0-100,当前:{0:F2}", 0, 100, "数字跳动,0-100,当前:{0:F0}"),
            CCActionDelay.Create(0f)
            );

        return(action);
    }
示例#2
0
    public ActionInterval OnClick13()
    {
        var action = CCActionSequence.Create(
            CCAction.CCDelay(0, () => { Reset(); SetTile("打印机"); }),
            CCActionDelay.Create(0.2f),
            text.CCTextPrint(1.0f, "打印机:0123456789零一二三四五六七八九"),
            CCActionDelay.Create(0f)
            );

        return(action);
    }
示例#3
0
    public ActionInterval OnClick7()
    {
        var action = CCActionSequence.Create(
            CCAction.CCDelay(0, () => { Reset(); SetTile("重复测试:移动重复3次"); }),
            image.transform.CCMoveTo(duration * 0.7f, new Vector3(200, 100, 0)),
            image.transform.CCMoveTo(duration * 0.7f, new Vector3(0, 0, 0)),
            CCActionDelay.Create(0f)
            );

        return(CCAction.CCRepeat(action, 3));
    }
示例#4
0
    public ActionInterval OnClick3()
    {
        var action = CCActionSequence.Create(
            CCAction.CCDelay(0, () => { Reset(); SetTile("旋转"); }),
            image.transform.CCAnglesTo(duration * 0.3f, new Vector3(0, 0, 180)),
            image.transform.CCAnglesTo(duration * 0.3f, new Vector3(0, 0, 360)),
            CCActionDelay.Create(0f)
            );

        return(action);
    }
示例#5
0
    public ActionInterval OnClick2()
    {
        var action = CCActionSequence.Create(
            CCAction.CCDelay(0, () => { Reset(); SetTile("缩放3倍再缩放到1倍"); }),
            image.transform.CCScaleTo(duration * 0.5f, new Vector3(3, 3, 3)),
            image.transform.CCScaleTo(duration * 0.5f, new Vector3(1, 1, 1)),
            CCActionDelay.Create(0f)
            );

        return(action);
    }
示例#6
0
    public ActionInterval OnClick1()
    {
        var action = CCActionSequence.Create(
            CCAction.CCDelay(0, () => { Reset(); SetTile("移动返回"); }),
            image.transform.CCMoveTo(duration * 0.5f, new Vector3(200, 100, 0)),
            image.transform.CCMoveTo(duration * 0.5f, new Vector3(0, 0, 0)),
            CCActionDelay.Create(0f)
            );

        return(action);
    }
示例#7
0
    public ActionInterval OnClick10()
    {
        var action = CCActionSequence.Create(
            CCAction.CCDelay(0, () => { Reset(); SetTile("进度条"); }),
            image.CCFillAmout(duration * 0.7f, 0),
            CCActionDelay.Create(0.1f),
            image.CCFillAmout(duration * 0.7f, 1),
            CCActionDelay.Create(0f)
            );

        return(action);
    }
示例#8
0
    public ActionInterval OnClick6()
    {
        var action = CCActionSequence.Create(
            CCAction.CCDelay(0, () => { Reset(); SetTile("椭圆运动1.5圈,复位"); }),
            image.transform.CCEllipse2D(duration * 2, new Vector3(0, 0, 0), 180, 50, 0, 1.5f),
            CCActionDelay.Create(0.1f),
            image.transform.CCMoveTo(duration * 0.3f, new Vector3(0, 0, 0)),
            CCActionDelay.Create(0f)
            );

        return(action);
    }
示例#9
0
    public ActionInterval OnClick5()
    {
        var action = CCActionSequence.Create(
            CCAction.CCDelay(0, () => { Reset(); SetTile("三阶贝塞尔"); }),
            image.transform.CCCubicBezierTo(duration * 2, new Vector3(-200, 100, 0), new Vector3(600, -300, 0), new Vector3(400, 300, 0)),
            CCActionDelay.Create(0.1f),
            image.transform.CCMoveTo(duration * 0.3f, new Vector3(0, 0, 0)),
            CCActionDelay.Create(0f)
            );

        return(action);
    }
示例#10
0
        /// <summary>
        /// 闪烁
        /// </summary>
        /// <param name="obj"></param>
        /// <param name="duration">时间</param>
        /// <param name="time">闪烁次数</param>
        /// <returns></returns>
        public static ActionInterval CCBlink(this GameObject obj, float duration, uint time)
        {
            float oneTime = duration / time;
            var   action  = CCActionSequence.Create(
                obj.CCHide(),
                CCActionDelay.Create(oneTime * 0.5f),
                obj.CCShow(),
                CCActionDelay.Create(oneTime * 0.5f)
                );
            var repectAction = CCActionRepeat.Create(action, time);

            return(repectAction);
        }
示例#11
0
    public ActionInterval OnClick18()
    {
        var action = CCActionSequence.Create(
            CCAction.CCDelay(0, () => { Reset(); SetTile("变速Back"); }),
            image2.gameObject.CCShow(),
            CCAction.CCDelay(0, () => { SetTile("变速BackIn 上图先慢后快,下图正常"); }),
            CCAction.CCSpawn(
                CCAction.CCBackEaseIn(image.transform.CCMoveTo(duration * 0.5f * 0.5f, new Vector3(200, 0, 0))),
                image2.transform.CCMoveTo(duration * 0.5f * 0.5f, new Vector3(200, -100, 0)),
                CCActionDelay.Create(0f)
                ),
            CCActionDelay.Create(0.1f),
            CCAction.CCSpawn(
                CCAction.CCBackEaseIn(image.transform.CCMoveTo(duration * 0.5f * 0.5f, new Vector3(0, 0, 0))),
                image2.transform.CCMoveTo(duration * 0.5f * 0.5f, new Vector3(0, -100, 0)),
                CCActionDelay.Create(0f)
                ),

            CCAction.CCDelay(0.1f, () => { SetTile("变速BackOut 上图先快后慢,下图正常"); }),
            CCAction.CCSpawn(
                CCAction.CCBackEaseOut(image.transform.CCMoveTo(duration * 0.5f, new Vector3(200, 0, 0))),
                image2.transform.CCMoveTo(duration * 0.5f, new Vector3(200, -100, 0)),
                CCActionDelay.Create(0f)
                ),
            CCActionDelay.Create(0.1f),
            CCAction.CCSpawn(
                CCAction.CCBackEaseOut(image.transform.CCMoveTo(duration * 0.5f, new Vector3(0, 0, 0))),
                image2.transform.CCMoveTo(duration * 0.5f, new Vector3(0, -100, 0)),
                CCActionDelay.Create(0f)
                ),

            CCAction.CCDelay(0.1f, () => { SetTile("变速BackInOut 上图前后慢中间快,下图正常"); }),
            CCAction.CCSpawn(
                CCAction.CCBackEaseInOut(image.transform.CCMoveTo(duration * 0.5f, new Vector3(200, 0, 0))),
                image2.transform.CCMoveTo(duration * 0.5f, new Vector3(200, -100, 0)),
                CCActionDelay.Create(0f)
                ),
            CCActionDelay.Create(0.1f),
            CCAction.CCSpawn(
                CCAction.CCBackEaseInOut(image.transform.CCMoveTo(duration * 0.5f, new Vector3(0, 0, 0))),
                image2.transform.CCMoveTo(duration * 0.5f, new Vector3(0, -100, 0)),
                CCActionDelay.Create(0f)
                ),
            CCAction.CCDelay(0, () => { SetTile("完成"); }),
            CCActionDelay.Create(0f)
            );

        return(action);
    }
示例#12
0
    public ActionInterval OnClick11()
    {
        var action = CCActionSequence.Create(
            CCAction.CCDelay(0, () => { Reset(); SetTile("变色、淡入、淡出"); }),
            image.CCColorTo(duration * 0.5f, Color.red),
            CCActionDelay.Create(0.1f),
            image.CCColorTo(duration * 0.5f, Color.white),
            CCActionDelay.Create(0.1f),
            image.CCFadeOut(duration * 0.5f),
            image.CCFadeIn(duration * 0.5f),
            CCActionDelay.Create(0f)
            );

        return(action);
    }
示例#13
0
    public void D()
    {
        var action = CCAction.CCSequence(
            CCAction.CCDelay(0, () => { Debug.Log("HelloWorld"); }),                     //回调
            gameObject.CCShow(),                                                         //显示
            transform.CCMoveTo(1.0f, new Vector3(100, 100, 100)),                        //移动
            CCAction.CCSineEaseIn(image.transform.CCMoveTo(1.0f, new Vector3(0, 0, 0))), //变速(In先慢后快) 移动
            CCAction.CCSpawn(
                transform.CCAnglesTo(1.0f, new Vector3(0, 0, 360)),
                transform.CCScaleTo(0.8f, new Vector3(2, 2, 2))
                ),                                         // 并行执行 旋转和缩放,取最长时间作为结束时间
            transform.CCScaleTo(1f, new Vector3(1, 1, 1)), //缩放
            CCActionDelay.Create(0f)
            );

        CCAction.Do(action, transform, 3);  //执行Action,并且循环3次,小于0无限循环
    }
示例#14
0
    public ActionInterval OnClick8()
    {
        var action1 = CCActionSequence.Create(
            CCAction.CCDelay(0, () => { Reset(); SetTile("并行测试:移动缩放"); }),
            image.transform.CCMoveTo(duration, new Vector3(200, 100, 0)),
            image.transform.CCMoveTo(duration, new Vector3(0, 0, 0)),
            CCActionDelay.Create(0f)
            );
        var action2 = CCActionSequence.Create(
            image.transform.CCScaleTo(duration, new Vector3(2, 2, 2)),
            image.transform.CCScaleTo(duration, new Vector3(1, 1, 1)),
            CCActionDelay.Create(0f)
            );
        var action = CCActionSpawn.Create(action1, action2);

        return(action);
    }
示例#15
0
    public ActionInterval OnClick20()
    {
        var action1 = CCAction.CCSequence(
            CCAction.CCDelay(0, () => { Reset(); SetTile("图一浮动、图二震动"); }),
            image2.gameObject.CCShow(),
            CCAction.CCSineEaseIn(image.transform.CCMoveTo(duration * 0.5f, new Vector3(0, 100, 0))),
            CCAction.CCSineEaseOut(image.transform.CCMoveTo(duration * 0.5f, new Vector3(0, 0, 0))),
            CCActionDelay.Create(0f)
            );
        var action2 = CCAction.CCSequence(
            image2.transform.CCShake(duration, new Vector3(20, 20, 0)),
            image2.transform.CCMoveTo(0, new Vector3(0, -100, 0)),
            CCActionDelay.Create(0f)
            );
        var action = CCActionSpawn.Create(action1, action2);

        return(CCAction.CCRepeat(action, 3));
    }
示例#16
0
    public ActionInterval OnClick19()
    {
        var action1 = CCAction.CCSequence(
            CCAction.CCDelay(0, () => { Reset(); SetTile("获得奖励效果"); }),

            image.transform.CCMoveTo(0, new Vector3(0, 200, 0)),
            image.transform.CCMoveTo(duration * 0.3f, new Vector3(0, 0, 0)),
            CCActionDelay.Create(0f)
            );
        var action2 = CCAction.CCSequence(
            image.transform.CCScaleTo(0, new Vector3(3, 3, 3)),
            image.transform.CCScaleTo(duration * 0.3f, new Vector3(0.5f, 0.5f, 0.5f)),
            image.transform.CCScaleTo(duration * 0.2f, new Vector3(1.3f, 1.3f, 1.3f)),
            image.transform.CCScaleTo(duration * 0.15f, new Vector3(1, 1, 1)),
            CCActionDelay.Create(0.2f),
            CCActionDelay.Create(0f)
            );
        var action = CCActionSpawn.Create(action1, action2);

        return(CCAction.CCRepeat(action, 3));
    }