diff --git a/Runtime/OSCQuery.cs b/Runtime/OSCQuery.cs index 76344e3..45ef967 100644 --- a/Runtime/OSCQuery.cs +++ b/Runtime/OSCQuery.cs @@ -93,6 +93,8 @@ public enum FilterMode { All, Include, Exclude } public FilterMode componentFilterMode = FilterMode.Exclude; public List filteredComponentNames; public bool excludeInternalUnityParams; + public bool excludeThisObject = true; + String[] internalUnityParamsNames = { "name", "tag", "useGUILayout", "runInEditMode", "enabled", "hideFlags" }; String[] internalUnityTransformNames = { "localEulerAngles", "right", "up", "forward", "hasChanged", "hierarchyCapacity" }; String[] acceptedParamTypes = { "System.String", "System.Char", "System.Boolean", "System.Int32", "System.Int64", "System.Int16", "System.UInt16", "System.Byte", "System.SByte", "System.Double", "System.Single", "UnityEngine.Vector2", "UnityEngine.Vector3", "UnityEngine.Quaternion", "UnityEngine.Color" }; @@ -318,6 +320,7 @@ void rebuildDataTree() foreach (GameObject go in rootObjects) { if (!checkFilteredObject(go)) continue; + if(excludeThisObject && go == this.gameObject) continue; string goName = SanitizeName(go.name); if (!co.HasField(goName)) co.SetField(goName, getObjectData(go, "/" + goName)); } @@ -342,6 +345,8 @@ JSONObject getObjectData(GameObject go, string baseAddress = "") int dotIndex = comp.GetType().ToString().LastIndexOf("."); string compType = comp.GetType().ToString().Substring(Mathf.Max(dotIndex + 1, 0)); + if (comp == this) continue; + //Debug.Log(go.name+" > Comp : " + compType); if (!checkFilteredComp(compType)) continue; diff --git a/package.json b/package.json index 887a20b..62efef0 100644 --- a/package.json +++ b/package.json @@ -10,5 +10,5 @@ "repository": "github:benkper/Unity-OSCQuery", "unity": "2023.2", "unityRelease": "20f1", - "version": "1.1.6" + "version": "1.1.7" }