Skip to content

Commit

Permalink
add excludeThisObject
Browse files Browse the repository at this point in the history
  • Loading branch information
benkuper committed Oct 4, 2024
1 parent f98a33e commit a74f5be
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions Runtime/OSCQuery.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ public enum FilterMode { All, Include, Exclude }
public FilterMode componentFilterMode = FilterMode.Exclude;
public List<String> 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" };
Expand Down Expand Up @@ -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));
}
Expand All @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
"repository": "github:benkper/Unity-OSCQuery",
"unity": "2023.2",
"unityRelease": "20f1",
"version": "1.1.6"
"version": "1.1.7"
}

0 comments on commit a74f5be

Please sign in to comment.