Exemple #1
0
    public static MtCallFunc Create(Action <Transform> func)
    {
        MtCallFunc ret = new MtCallFunc();

        if (ret.InitWithFunction(func))
        {
            return(ret);
        }
        return(null);
    }
Exemple #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));
    }
Exemple #3
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);
    }
Exemple #4
0
    public override MtICloneable Clone()
    {
        MtCallFunc func = new MtCallFunc();

        if (m_function != null)
        {
            func.InitWithFunction(m_function);
        }
        if (m_functionWithParam != null)
        {
            func.InitWithFunction(m_functionWithParam);
        }
        return(func);
    }