Exemple #1
0
        public static AbstractNavPath Create(NavPathType pathType, NavPathData pathData, Vector3 offset, bool pathFlipOn, IPathTrigger triggerHandler)
        {
            AbstractNavPath navPath = null;

            if (pathData.WayPoints.Count == 2 && pathType != NavPathType.LinePosLineDir)
            {
                pathType = NavPathType.LinePosLineDir;
                DebugUtils.Warning("AbstractNavPath", "Create LineType, Not ", EnumUtils.EnumToString(pathType));
            }
            switch (pathType)
            {
            case NavPathType.CurvePosCurveDir:
                navPath = new NavCurvePosCurveDir(pathData, offset, pathFlipOn, triggerHandler);
                break;

            case NavPathType.LinePosLineDir:
                navPath = new NavCurvePosCurveDir(pathData, offset, pathFlipOn, triggerHandler);
                break;

            case NavPathType.LinePosLineAngle:
                navPath = new NavCurvePosCurveDir(pathData, offset, pathFlipOn, triggerHandler);
                break;

            case NavPathType.LinePosCurveDir:
                navPath = new NavCurvePosCurveDir(pathData, offset, pathFlipOn, triggerHandler);
                break;

            default:
                DebugUtils.Error("AbstractNavPath", "Create Not Supported ", EnumUtils.EnumToString(pathType));
                break;
            }
            return(navPath);
        }
Exemple #2
0
        public static AbstractNavPath Create(NavPathMoveType pathType, NavPathData pathData, Vector3 offset, NavPathFlipType flipType, IPathTrigger triggerHandler)
        {
            AbstractNavPath navPath = null;

            if (pathData.WayPoints.Count == 1)
            {
                pathType = NavPathMoveType.Fixed;
            }
            else if (pathData.WayPoints.Count == 2)
            {
                pathType = NavPathMoveType.LinePosLineDir;
                // DebugUtils.Log(InfoType.Warning, "AbstractNavPath Create LineType, Not " + EnumUtils.EnumToString(pathType));
            }
            switch (pathType)
            {
            case NavPathMoveType.Fixed:
                navPath = new NavPointFixed(pathData, offset, flipType, triggerHandler);
                break;

            case NavPathMoveType.CurvePosCurveDir:
                navPath = new NavCurvePosCurveDir(pathData, offset, flipType, triggerHandler);
                break;

            case NavPathMoveType.LinePosLineDir:
                navPath = new NavLinePosLineDir(pathData, offset, flipType, triggerHandler);
                break;

            case NavPathMoveType.LinePosLineAngle:
                navPath = new NavLinePosLineAngle(pathData, offset, flipType, triggerHandler, 10);
                break;

            case NavPathMoveType.LinePosCurveDir:
                navPath = new NavLinePosCurveDir(pathData, offset, flipType, triggerHandler);
                break;

            default:
                DebugUtils.Log(InfoType.Error, "AbstractNavPath Create Not Supported " + EnumUtils.EnumToString(pathType));
                break;
            }
            return(navPath);
        }