public override void OnInspectorGUI() { ChipModule module = (ChipModule)target; //serializedObject. //ChipModule module = target as ChipModule; //EditorGUILayout.IntSlider() //TODO: Figure out how to manage creation of inputs and outputs showCore = EditorGUILayout.BeginFoldoutHeaderGroup(showCore, "Core"); if (showCore) { LogicNode node = module.core; GUILayout.Label("LOGIC-Node"); GUILayout.Label($"Cycle: {node.lastCycle} Index: {node.lastIndex}"); GUILayout.Label($"Inputs: {node.ConnectedInputs} ({node.Inputs})"); if (node is BasicNode basic) { GUILayout.Label("BASIC-Node"); GUILayout.Label($"Valid Inputs: {basic.validInputs} ({node.ConnectedInputs})"); } } EditorGUILayout.EndFoldoutHeaderGroup(); base.DrawDefaultInspector(); }
// Start is called before the first frame update void Start() { line = GetComponentInChildren <WireLine>(); visual = GetComponent <MeshRenderer>(); module = GetComponentInParent <ChipModule>(); line.SetColor(color); visual.material.color = color; }