public static void OnPostprocessBuild(BuildTarget buildTarget, string pathToBuiltProject) { if (buildTarget != BuildTarget.iOS) { return; } TDDebugLogger.Log("OnPostprocessBuild - Path: " + pathToBuiltProject); EditorPrefs.SetString(BuildPathKey, pathToBuiltProject); var path = PBXProject.GetPBXProjectPath(pathToBuiltProject); if (!File.Exists(path)) { TDDebugLogger.LogError(string.Format("pbxproj '{0}' does not exists", path)); return; } var proj = new PBXProject(); proj.ReadFromString(File.ReadAllText(path)); var unityIPhoneTargetGuid = GetUnityIPhoneTargetGuid(path); SetPListProperties(pathToBuiltProject); proj.UpdateBuildProperty(unityIPhoneTargetGuid, "OTHER_LDFLAGS", new string [] { "-ObjC" }, new string [] {}); File.WriteAllText(path, proj.WriteToString()); }
public static T GetEnumFromString <T>(string enumString, T defaultValue = default(T)) { Array values = null; try { values = Enum.GetValues(typeof(T)); } catch (Exception e) { TDDebugLogger.LogError("Can't GetEnumFromString: " + enumString); return(defaultValue); } if (values == null) { return(defaultValue); } foreach (var val in values) { if (val.ToString().ToLower() == enumString.ToLower()) { return((T)val); } } return(defaultValue); }
private static T GetAndroidStatic <T>(string methodName, params object[] paramList) { LogUnsupportedPlatform(); if (Application.platform == RuntimePlatform.Android) { try { using (AndroidJavaClass tapdaqUnity = new AndroidJavaClass("com.tapdaq.unityplugin.TapdaqUnity")) { return(tapdaqUnity.CallStatic <T> (methodName, paramList)); } } catch (Exception e) { TDDebugLogger.LogException(e); } } TDDebugLogger.LogError("Error while call static method"); return(default(T)); }
public static void LogMessage(TDLogSeverity severity, string message) { string prefix = "Tapdaq Unity SDK: "; if (severity == TDLogSeverity.warning) { TDDebugLogger.LogWarning(prefix + message); } else if (severity == TDLogSeverity.error) { TDDebugLogger.LogError(prefix + message); } else { TDDebugLogger.Log(prefix + message); } }
private static void LogObsoleteWithTagMethod(string methodName) { TDDebugLogger.LogError("'" + methodName + "WithTag(string tag)' is Obsolete. Please, use '" + methodName + "(string tag)' instead"); }