public MonitorComponent(string path, ServerComponent component) : base(path, MonitorComponent.GetClosureComponent(component.component)) { this.component = component; this.gameObjectInstanceID = this.component.component.gameObject.GetInstanceID(); this.instanceID = this.component.instanceID; this.children = new List <MonitorData>(this.component.fields.Length); for (int i = 0; i < this.component.fields.Length; i++) { CustomMonitorData customMonitor = MonitorDataManager.CreateMonitorData(this.component.fields[i].Type, this.path + NGServerScene.ValuePathSeparator + i, getInstance, this.component.fields[i]); if (customMonitor != null) { this.children.Add(customMonitor); } else if (this.component.fields[i].Type.IsUnityArray() == true) { this.children.Add(new MonitorArray(this.path + NGServerScene.ValuePathSeparator + i, this.component.fields[i], getInstance)); } else if (this.component.fields[i] is FieldModifier) { this.children.Add(new MonitorField(this.path + NGServerScene.ValuePathSeparator + i, getInstance, (this.component.fields[i] as FieldModifier).fieldInfo)); } else if (this.component.fields[i] is PropertyModifier) { this.children.Add(new MonitorProperty(this.path + NGServerScene.ValuePathSeparator + i, getInstance, (this.component.fields[i] as PropertyModifier).propertyInfo)); } } }
public void DeleteComponent(int instanceID) { for (int i = 0; i < this.children.Count; i++) { MonitorComponent component = this.children[i] as MonitorComponent; if (component != null) { if (component.InstanceID == instanceID) { this.children.RemoveAt(i); break; } } } }