// Token: 0x06003FE7 RID: 16359 RVA: 0x00128604 File Offset: 0x00126804 private void OnRemove(IComponentBase component) { component.DeInit(); this.m_components.Remove(component.GetName()); this.m_type2Name.Remove(component.GetType()); this.m_tickableComponents.Remove(component.GetType()); }
public void Apply(ref IComponentBase component) { var fields = component.GetType().GetCachedFields(); for (int i = 0; i < this.boxVars.Length; ++i) { if (this.boxVars[i] != null) { var boxVarValue = this.boxVars[i].Load(); fields[i].SetValue(component, boxVarValue); } } }
public void Validate(IComponentBase component) { var fields = component.GetType().GetCachedFields(); if (this.data == null || this.data.Length != fields.Length) { this.data = new FieldData[fields.Length]; } if (this.captions == null || this.captions.Length != this.data.Length) { this.captions = new string[this.data.Length]; } if (this.boxVars == null) { this.boxVars = new BoxVariable[this.data.Length]; } if (this.boxVars.Length != this.data.Length) { System.Array.Resize(ref this.boxVars, this.data.Length); } for (int i = 0; i < this.data.Length; ++i) { this.captions[i] = fields[i].Name; var val = fields[i].GetValue(component); System.Type type = null; if (val == null) { type = fields[i].FieldType; } else { type = val.GetType(); } if (type.IsArray == true) { this.data[i].value = null; this.data[i].valueArr = ((System.Collections.IList)val).Cast <object>().ToArray(); this.data[i].isArray = true; } else { this.data[i].value = val; this.data[i].valueArr = null; this.data[i].isArray = false; } } }