Ejemplo n.º 1
0
    public override void Enter()
    {
        base.Enter();

        MtSpeed speedCtrl = null;
        var     rotate    = MtRotateBy.Create(1f, new Vector3(0, 360, 0));
        var     func      = MtCallFunc.Create(() => {
            if (m_count > 0)
            {
                speedCtrl.Speed = 4f;
            }
            if (m_count > 6)
            {
                speedCtrl.Speed = 0.25f;
            }
            if (m_count > 7)
            {
                speedCtrl.Speed = 1;
                m_count         = -1;
            }
            m_count++;
        });
        var sequence      = MtSequence.Create(rotate, func);
        var repeatForever = MtRepeatForever.Create(sequence);

        speedCtrl = MtSpeed.Create(repeatForever, 1);
        m_tfCube.RunAction(speedCtrl);
    }
Ejemplo n.º 2
0
    public override void Enter()
    {
        base.Enter();
        var delayTime = MtDelayTime.Create(2);
        var func      = MtCallFunc.Create(() => {
            SetSubTitle("2秒时间到");
        });

        m_tfCube.RunAction(MtSequence.Create(delayTime, func));
    }
Ejemplo n.º 3
0
    public override void Enter()
    {
        base.Enter();
        var scale1   = MtScaleTo.Create(0.5f, new Vector3(1.5f, 1.5f, 1.5f));
        var scale2   = MtScaleTo.Create(0.5f, Vector3.one);
        var sequence = MtSequence.Create(scale1, scale2);
        var rotate   = MtRotateBy.Create(1, new Vector3(0, 360, 0));
        var spawn    = MtSpawn.Create(sequence, rotate);

        m_tfCube.RunAction(spawn);
    }
Ejemplo n.º 4
0
 public override MtAction Reverse()
 {
     if (m_actions[0] != null && m_actions[1] != null)
     {
         return(MtSequence.Create(m_actions[0].Reverse() as MtFiniteTimeAction, m_actions[1].Reverse() as MtFiniteTimeAction, null));
     }
     else
     {
         return(null);
     }
 }
Ejemplo n.º 5
0
    public override void Enter()
    {
        base.Enter();

        var move     = MtMoveBy.Create(1, new Vector3(3, 0, 0));
        var easeIn   = MtEaseExponentialIn.Create(move);
        var moveBack = MtMoveBy.Create(1, new Vector3(-3, 0, 0));
        var easeOut  = MtEaseExponentialOut.Create(moveBack);
        var sequence = MtSequence.Create(easeIn, easeOut);

        m_tfCube.RunAction(sequence);
    }
Ejemplo n.º 6
0
 public override MtICloneable Clone()
 {
     // no copy constructor
     if (m_actions[0] != null && m_actions[1] != null)
     {
         return(MtSequence.Create(m_actions[0].Clone() as MtFiniteTimeAction, m_actions[1].Clone() as MtFiniteTimeAction, null));
     }
     else
     {
         return(null);
     }
 }
Ejemplo n.º 7
0
    public override void Enter()
    {
        base.Enter();
        var move1 = MtMoveBy.Create(0.5f, new Vector3(3, 0, 0));
        var move2 = MtMoveBy.Create(0.5f, new Vector3(0, 3, 0));
        var func  = MtCallFunc.Create((Transform trans) => {
            SetSubTitle(string.Format("名字为{0}的GameObject走完一周...", trans.name));
        });
        var sequence1 = MtSequence.Create(move1, move2);
        var sequence2 = MtSequence.Create(sequence1, sequence1.Reverse() as MtSequence, func);

        m_tfCube.RunAction(sequence2);
    }