예제 #1
0
        internal static CocosInfo CreateCustomInfo(string path = "", bool isAutoCheck = false)
        {
            CocosInfo codeInfo    = (CocosInfo)null;
            string    defaultPath = CocosInfo.GetDefaultPath();

            if (!string.IsNullOrEmpty(defaultPath))
            {
                if ((string.IsNullOrEmpty(path) || CocosInfo.CheckIsDefault(path)) && CocosInfo.TryCreateDefaultCodeInfo(defaultPath, out codeInfo))
                {
                    return(codeInfo);
                }
            }
            else if (string.IsNullOrEmpty(path))
            {
                return((CocosInfo)null);
            }
            if (CocosInfo.TryCreateCodeInfoV2(path, out codeInfo) || CocosInfo.TryCreateCodeInfoV3(path, out codeInfo) || (CocosInfo.TryCreateCodeInfoV3_JS(path, out codeInfo) || CocosInfo.TryCreateCodeInfoWithoutVersion(path, out codeInfo)))
            {
                return(codeInfo);
            }
            if (!isAutoCheck)
            {
                return((CocosInfo)null);
            }
            if (CocosInfo.TryCreateDefaultCodeInfo(defaultPath, out codeInfo))
            {
                return(codeInfo);
            }
            return((CocosInfo)null);
        }
예제 #2
0
 private static bool CheckIsDefault(string path)
 {
     return(Path.GetFullPath(CocosInfo.GetDefaultPath().ToLower()).Equals(Path.GetFullPath(path.ToLower())));
 }