public long GetSymAddress(string SymName) { var AddrName = SymName + "Address"; if (SymbolStore.ContainsKey(AddrName)) { return(SymbolStore[AddrName]); } DebugHelp.SYMBOL_INFO symInfo = new DebugHelp.SYMBOL_INFO(); symInfo.SizeOfStruct = 0x58; symInfo.MaxNameLen = 1024; var rv = DebugHelp.SymFromName(ID.GetHashCode(), SymName, ref symInfo); if (!rv) { WriteColor(ConsoleColor.Red, $"GetSymValue: {new Win32Exception(Marshal.GetLastWin32Error()).Message }."); return(MagicNumbers.BAD_VALUE_READ); } SymbolStore.Add(AddrName, symInfo.Address); return(symInfo.Address); }
public void Dispose() { foreach (var addr in Sections) { DebugHelp.SymUnloadModule64(ID.GetHashCode(), (ulong)addr.Key); } }
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) { var attribute = (GetSetAttribute)base.attribute; EditorGUI.BeginChangeCheck(); EditorGUI.PropertyField(position, property, label); if (EditorGUI.EndChangeCheck()) { attribute.dirty = true; } else if (attribute.dirty) { var parent = ReflectionUtils.GetParentObject(property.propertyPath, property.serializedObject.targetObject); var type = parent.GetType(); var info = type.GetProperty(attribute.name); if (info == null) { DebugHelp.LogError("Invalid property name \"" + attribute.name + "\""); } else { info.SetValue(parent, fieldInfo.GetValue(parent), null); } attribute.dirty = false; } }
//-------------------------------------------------- // Overrided/Overloaded methods //-------------------------------------------------- #region OVERRIDED_OVERLOADED_METHODS public override BehaviorTree Add(BehaviorTreeNode btNode) { DebugHelp.Assert(ml_Nodes.Count < 2, "[ERROR] ConditionalBT only needs two children."); base.Add(btNode); return(this); }
public override string ToString() { string myType = GetType().Name; string anchor = Anchor?.ToString(); if (anchor == null) { anchor = "<null>"; } return($"[Type: {myType}|" + $"Name: {Name}|" + $"Position: {DebugHelp.Vector2_ToString(Position)}|" + $"Bounds: {DebugHelp.Rectangle_ToString(Bounds)}|" + $"Anchor: {anchor}|"); }
/// <summary> /// 在指定目录下,搜索对应pattern的资源,生成(资源路径——包路径的映射) /// </summary> /// <param name="inputPath"></param> /// <param name="outPath"></param> /// <param name="searchPattern"></param> /// <returns></returns> public static void GetResMap(Dictionary <string, string> res2bundle_dic, string inputPath, string outPath, string searchPattern, string prefix) { if (!Directory.Exists(StandardlizePath(inputPath))) { DebugHelp.LogWarning("input path not exist :{0}", inputPath); return; } //搜索目录下所有符合条件的资源文件 string[] files = Directory.GetFiles(inputPath, searchPattern, SearchOption.AllDirectories); foreach (string file in files) { string resPath = StandardlizePath(file); string resName = Path.GetFileNameWithoutExtension(resPath).ToLower(); string bundleName = string.Format("{0}{1}{2}", outPath, prefix, resName); res2bundle_dic.Add(resPath, bundleName); } }
public void Add(SerializedProperty curve, CurveState state) { // Make sure the property is in fact an AnimationCurve var animCurve = curve.animationCurveValue; if (animCurve == null) { throw new ArgumentException("curve"); } if (m_Curves.ContainsKey(curve)) { DebugHelp.LogWarning("Curve has already been added to the editor"); } m_Curves.Add(curve, state); }