예제 #1
0
    /// <summary>
    /// CCFunction
    ///
    /// Bezier 移动
    ///
    /// 注意 : 只是用于场景物体 如要UI使用 请使用 Text Image 或 MaskableGraphic
    /// </summary>
    public static CCAction BezierMove(this Transform t, Vector3[] pos, float time)
    {
        if (t == null)
        {
            Debug.LogError("传入 Transform 为空请检查 ");
            return(null);
        }
        CCBezier action = CCBezier.Create(time, new CCBezier.BezierConfig(pos));

        t.RunAction(action);
        return(action);
    }
예제 #2
0
    /// <summary>
    /// CCFunction
    ///
    ///  Bezier 移动
    ///
    /// 默认高度为1
    ///
    /// 注意 : 只是用于场景物体 如要UI使用 请使用 Text Image 或 RectTransform  MaskableGraphic
    /// </summary>
    public static CCAction BezierMove(this Transform t, Vector2 startPos, Vector2 endPos, bool isV2, float time)
    {
        if (t == null)
        {
            Debug.LogError("传入 Transform 为空请检查 ");
            return(null);
        }
        CCBezier action = CCBezier.Create(time, new CCBezier.BezierConfig(startPos, endPos, isV2));

        t.RunAction(action);
        return(action);
    }