public override void OnInspectorGUI() { serializedObject.Update(); EditorGUILayout.PropertyField(isEnabled); bool check = isEnabled.boolValue; if (check) { EditorGUILayout.PropertyField(InvokeType); EditorGUILayout.PropertyField(TargetPrefab); if (TargetPrefab.objectReferenceValue == null) { EditorGUILayout.HelpBox("Required Field(s) Null / None", MessageType.Error); } EditorGUILayout.PropertyField(TargetPosition); if (TargetPosition.objectReferenceValue == null) { EditorGUILayout.HelpBox("Required Field(s) Null / None", MessageType.Error); } EditorGUILayout.PropertyField(usingParent); if (usingParent.boolValue) { EditorGUILayout.PropertyField(AfterInstantiate); EditorGUILayout.PropertyField(TargetParent); if (TargetParent.objectReferenceValue == null) { EditorGUILayout.HelpBox("Required Field(s) Null / None", MessageType.Error); } } GlobalVariable.CInvokeType st = (GlobalVariable.CInvokeType)InvokeType.enumValueIndex; switch (st) { case GlobalVariable.CInvokeType.OnAwake: break; case GlobalVariable.CInvokeType.OnDelay: EditorGUILayout.PropertyField(usingDelay); EditorGUILayout.PropertyField(Delay); break; case GlobalVariable.CInvokeType.OnInterval: EditorGUILayout.PropertyField(usingInterval); EditorGUILayout.PropertyField(Interval); break; case GlobalVariable.CInvokeType.OnEvent: EditorGUILayout.PropertyField(usingDelay); EditorGUILayout.PropertyField(Delay); break; } } serializedObject.ApplyModifiedProperties(); }
public override void OnInspectorGUI() { serializedObject.Update(); EditorGUILayout.PropertyField(isEnabled); GlobalVariable.CInvokeType st = (GlobalVariable.CInvokeType)InvokeType.enumValueIndex; bool check = isEnabled.boolValue; if (check) { EditorGUILayout.PropertyField(TargetObject, true); EditorGUILayout.PropertyField(InvokeType, true); EditorGUILayout.PropertyField(usingPosition, true); if (usingPosition.boolValue) { EditorGUILayout.PropertyField(PositionValue, true); } EditorGUILayout.PropertyField(usingRotation, true); if (usingRotation.boolValue) { EditorGUILayout.PropertyField(RotationValue, true); } EditorGUILayout.PropertyField(usingScale, true); if (usingScale.boolValue) { EditorGUILayout.PropertyField(ScaleValue, true); } EditorGUILayout.PropertyField(usingTranslate, true); if (usingTranslate.boolValue) { EditorGUILayout.PropertyField(TranslateSpeed, true); EditorGUILayout.PropertyField(TranslateValue, true); } EditorGUILayout.PropertyField(usingPingPong, true); if (usingPingPong.boolValue) { EditorGUILayout.PropertyField(PingPongValue, true); EditorGUILayout.PropertyField(PingPongSpeed, true); } EditorGUILayout.PropertyField(usingPingPongDirection, true); if (usingPingPongDirection.boolValue) { EditorGUILayout.PropertyField(Distance, true); EditorGUILayout.PropertyField(StartDirection, true); EditorGUILayout.PropertyField(EndDirection, true); } EditorGUILayout.PropertyField(usingAdditionalSettings, true); if (usingAdditionalSettings.boolValue) { EditorGUILayout.PropertyField(AdditionalSettings, true); } //--Invoke type (3) if ((GlobalVariable.CInvokeType)InvokeType.enumValueIndex == GlobalVariable.CInvokeType.OnDelay) { EditorGUILayout.PropertyField(usingDelay, true); if (usingDelay.boolValue) { EditorGUILayout.PropertyField(Delay, true); } } if ((GlobalVariable.CInvokeType)InvokeType.enumValueIndex == GlobalVariable.CInvokeType.OnInterval) { EditorGUILayout.PropertyField(usingInterval, true); if (usingInterval.boolValue) { EditorGUILayout.PropertyField(Interval, true); } } } else { EditorGUILayout.HelpBox("Prefab Status: Disabled", MessageType.Error); } serializedObject.ApplyModifiedProperties(); }