AssetBundleGraph.FileUtility.PathCombine C# (CSharp) Method

PathCombine() public static method

public static PathCombine ( ) : string
return string
        public static string PathCombine(params string[] paths)
        {
            if (paths.Length < 2) {
                throw new ArgumentException("Argument must contain at least 2 strings to combine.");
            }

            var combinedPath = _PathCombine(paths[0], paths[1]);
            var restPaths = new string[paths.Length-2];

            Array.Copy(paths, 2, restPaths, 0, restPaths.Length);
            foreach (var path in restPaths) combinedPath = _PathCombine(combinedPath, path);

            return combinedPath;
        }

Usage Example

        public static void ValidateModifiyOperationData(
            string modifierNodeId,
            string targetPlatform,
            Action noAssetOperationDataFound,
            Action validAssetOperationDataFound
            )
        {
            var platformOpDataPath = FileUtility.PathCombine(AssetBundleGraphSettings.MODIFIER_OPERATOR_DATAS_PLACE, modifierNodeId, ModifierOperatiorDataName(targetPlatform));

            if (File.Exists(platformOpDataPath))
            {
                validAssetOperationDataFound();
                return;
            }

            // if platform data is not exist, search default one.
            var defaultPlatformOpDataPath = FileUtility.PathCombine(AssetBundleGraphSettings.MODIFIER_OPERATOR_DATAS_PLACE, modifierNodeId, ModifierOperatiorDataName(AssetBundleGraphSettings.PLATFORM_DEFAULT_NAME));

            if (File.Exists(defaultPlatformOpDataPath))
            {
                validAssetOperationDataFound();
                return;
            }

            noAssetOperationDataFound();
        }
All Usage Examples Of AssetBundleGraph.FileUtility::PathCombine