Exemple #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);
    }
Exemple #2
0
 public override MtAction Reverse()
 {
     if (m_innerAction != null)
     {
         return(MtSpeed.Create(m_innerAction.Reverse() as MtActionInterval, m_speed));
     }
     return(null);
 }
Exemple #3
0
 public override MtICloneable Clone()
 {
     if (m_innerAction != null)
     {
         return(MtSpeed.Create(m_innerAction.Clone() as MtActionInterval, m_speed));
     }
     return(null);
 }
Exemple #4
0
    public static MtSpeed Create(MtActionInterval action, float speed)
    {
        MtSpeed _speed = new MtSpeed();

        if (_speed.InitWithAction(action, speed))
        {
            return(_speed);
        }
        return(null);
    }