private void Edit_ListOrArray_OnAdd(ReorderableList rol) { this.currRolList.Add(BloxMemberInfo.GetDefaultValue(this.currRolType)); GUI.changed = true; EditorWindow obj = this.ed; if ((object)obj != null) { obj.Repaint(); } }
private void Init_parVals() { if (this.b.mi != null) { if (this.b.mi.MemberType == MemberTypes.Field || this.b.mi.MemberType == MemberTypes.Property) { if (this.b.mi.CanSetValue) { this.parVals = new object[1]; this.parVals[0] = BloxMemberInfo.GetDefaultValue(this.b.mi.ReturnType); } } else { ParameterInfo[] parameters = this.b.mi.GetParameters(); if (parameters != null) { this.parVals = new object[parameters.Length]; for (int i = 0; i < parameters.Length; i++) { this.parVals[i] = BloxMemberInfo.GetDefaultValue(parameters[i].ParameterType); } } } } else { BloxBlockAttribute[] array = (BloxBlockAttribute[])this.b.GetType().GetCustomAttributes(typeof(BloxBlockAttribute), false); if (((array.Length != 0) ? ((array[0].ParamTypes != null) ? array[0].ParamTypes.Length : 0) : 0) != 0) { this.parVals = new object[array[0].ParamTypes.Length]; for (int j = 0; j < this.parVals.Length; j++) { this.parVals[j] = BloxMemberInfo.GetDefaultValue(array[0].ParamTypes[j]); } } } if (this.parVals == null) { this.parVals = new object[0]; } }
private void DrawProperties() { if (this.currBlock == null || this.selectedBlockDef != this.shownDef || this.currBlock.def == null) { this.DrawEventProperties(); } else if (this.currBlock.def.drawer != null) { EditorGUI.BeginChangeCheck(); this.currBlock.def.drawer.DrawProperties(BloxEditorWindow.Instance, this.currBlock); if (EditorGUI.EndChangeCheck()) { GUI.changed = false; BloxEditorWindow.Instance.SaveBlox(true); } EditorGUILayout.Space(); } else if (this.currBlock.b.blockType == BloxBlockType.Value && this.currBlock.b.returnType != null && this.currBlock.b.returnType != typeof(void) && this.currBlock.def.contextType == null && (this.currBlock.def.mi == null || this.currBlock.def.mi.CanSetValue)) { if (this.currBlock.b.returnValue == null) { this.currBlock.b.returnValue = BloxMemberInfo.GetDefaultValue(this.currBlock.b.returnType); if (this.currBlock.b.returnValue != null) { GUI.changed = true; } } EditorGUI.BeginChangeCheck(); this.currBlock.b.returnValue = this.Edit_Field(this.currBlock.b.returnType, this.currBlock.b.returnValue, this.currBlock); if (EditorGUI.EndChangeCheck()) { GUI.changed = false; BloxEditorWindow.Instance.SaveBlox(true); } EditorGUILayout.Space(); } }