public override void EditorOverrideClassGUI() { Condition_Value_ValueCompare data = (Condition_Value_ValueCompare)target; data.internalValueName = LogicSystemAttributeEditorGUI.DrawInternalValueMenu("内部变量名", data.internalValueName, null).ToString(); if (string.IsNullOrEmpty(data.internalValueName)) { return; } object v = LogicSystemEditorWindow.GetInternalValue(data.internalValueName); List <string> compareNames = CompareValue.GetCompareType(v.GetType()); data.compareType = EditorDrawGUIUtil.DrawPopup("比较类型", data.compareType, compareNames); data.useInternalValue = (bool)EditorDrawGUIUtil.DrawBaseValue("使用内部变量", data.useInternalValue); if (data.useInternalValue) { data.compareInternalValueName = LogicSystemAttributeEditorGUI.DrawInternalValueMenu("相比较的内部变量名", data.compareInternalValueName, new string[] { v.GetType().FullName }).ToString(); } else { if (data.compareBaseValue == null) { data.compareBaseValue = new BaseValue("", v); } if (data.compareBaseValue.typeName != v.GetType().FullName) { data.compareBaseValue.SetValue("", v); } object temp = EditorDrawGUIUtil.DrawBaseValue("比较值(" + data.compareBaseValue.typeName + ")", data.compareBaseValue.GetValue()); data.compareBaseValue.SetValue("", temp); } }
public override void EditorOverrideClassGUI() { Event_Timer_Countdown ec = (Event_Timer_Countdown)target; ec.timerName = EditorDrawGUIUtil.DrawBaseValue("计时器名字", ec.timerName).ToString(); ec.timeCount = (float)EditorDrawGUIUtil.DrawBaseValue("总时间", ec.timeCount); ec.isIgnoreTimeScale = (bool)EditorDrawGUIUtil.DrawBaseValue("时间缩放", ec.isIgnoreTimeScale); GUILayout.Space(5); ec.isSetTimeValue2InternalValue = (bool)EditorDrawGUIUtil.DrawBaseValue("使用内部变量记录剩余时间", ec.isSetTimeValue2InternalValue); if (ec.isSetTimeValue2InternalValue) { ec.internalVariableName = LogicSystemAttributeEditorGUI.DrawInternalValueMenu("内部变量名", ec.internalVariableName, new string[] { typeof(int).FullName }).ToString(); } }
public override void EditorOverrideClassGUI() { Action_Debug_Log vClass = (Action_Debug_Log)target; GUILayout.BeginVertical("box"); vClass.isLogInternalVariable = (bool)EditorDrawGUIUtil.DrawBaseValue("是否使用内部变量", vClass.isLogInternalVariable); if (vClass.isLogInternalVariable) { vClass.internalVariableName = LogicSystemAttributeEditorGUI.DrawInternalValueMenu("内部变量", vClass.internalVariableName, null).ToString(); } else { vClass.message = EditorDrawGUIUtil.DrawBaseValue("打印内容", vClass.message).ToString(); } vClass.logType = (LogType)EditorDrawGUIUtil.DrawBaseValue("LogType", vClass.logType); GUILayout.EndVertical(); }
void OnGUI() { if (componetNameArr.Length == 0) { return; } GUILayout.Space(15); GUILayout.BeginHorizontal(); selectInt0 = EditorGUILayout.Popup(logicComponetType.ToString(), selectInt0, componetNameArr); GUILayout.EndHorizontal(); GUILayout.Space(15); ComponentNameAttribute tn = CompontNameAttributeUtils.GetCompontNameAttribute(logicComponetType, componetNameArr[selectInt0]); value = (LogicComponentBase)GetInstance(tn.className, value); Type extendEditorType = EditorExtendAttributeUtils.GetEditorExtendType(typeof(EditorExtendBase), value.GetType());// GetEditorExtendType(value.GetType()); if (extendEditorType != null) { if (editorExtendClassNameValue == null || editorExtendClassNameValue.GetType() != extendEditorType) { if (editorExtendClassNameValue != null) { editorExtendClassNameValue.OnClose(); } editorExtendClassNameValue = (EditorExtendBase)Activator.CreateInstance(extendEditorType); editorExtendClassNameValue.target = value; editorExtendClassNameValue.OnAwak(); } editorExtendClassNameValue.EditorOverrideClassGUI(); } else { if (editorExtendClassNameValue != null) { editorExtendClassNameValue.OnClose(); } LogicSystemAttributeEditorGUI.DrawInternalVariableGUI(value); } GUILayout.Space(15); if (value != null) { //Debug.Log(" ValueType :" + value.GetType() + " baseType:" + value.GetType().BaseType); GUILayout.Label(((LogicComponentBase)value).ToExplain()); } GUILayout.Space(15); GUILayout.BeginHorizontal(); if (GUILayout.Button("确定", GUILayout.Width(120))) { if (isNew) { components.GetLogicComs().Add(value); } components.SaveComponentDataToClassValue(); Close(); } GUILayout.FlexibleSpace(); if (GUILayout.Button("取消", GUILayout.Width(120))) { Close(); } GUILayout.EndHorizontal(); }