public override void OnInspectorGUI() { serializedObject.Update(); CoreEditorModule.ShowScriptReference(serializedObject); if (GUILayout.Button("PushToBuild")) { PushToBuild(); } _reorderableListOfScene.DoLayoutList(); serializedObject.ApplyModifiedProperties(); }
public override void OnInspectorGUI() { CoreEditorModule.ShowScriptReference(serializedObject); serializedObject.Update(); EditorGUILayout.PropertyField(DeveloperDescription); CoreEditorModule.DrawHorizontalLine(); EditorGUILayout.HelpBox("In order get the return type from the following Range. use 'RangeReference' in your script, which will return the value from the given range from the 'ScriptableObject' based on your 'Property' configuretion", MessageType.Info); CoreEditorModule.DrawHorizontalLine(); MinMaxSliderGUI(); serializedObject.ApplyModifiedProperties(); }
public override void OnInspectorGUI() { CoreEditorModule.ShowScriptReference(serializedObject); serializedObject.Update(); EditorGUILayout.PropertyField(_sp_instanceBehaviour); EditorGUILayout.PropertyField(_sp_accountManagerSettings); if (_reference.accountManagerSettings != null) { CoreEditorModule.DrawSettingsEditor(_reference.accountManagerSettings, null, ref _reference.showAccountManagerSettings, ref _editorForAccountManagerSettings); if (EditorApplication.isPlaying) { CoreEditorModule.DrawHorizontalLine(); int numberOfCurrency = _reference.accountManagerSettings.GetNumberOfAvailableCurrency(); for (int i = 0; i < numberOfCurrency; i++) { AccountManagerCurrencyEnum currency = (AccountManagerCurrencyEnum)i; EditorGUILayout.BeginHorizontal(); { EditorGUILayout.LabelField(_reference.GetNameOfCurrency(currency) + " : " + _reference.GetCurrentBalance(currency)); if (GUILayout.Button("+1000", GUILayout.Width(100))) { _reference.AddBalance(1000, currency); } if (GUILayout.Button("-1000", GUILayout.Width(100))) { _reference.DeductBalance(1000, currency); } } EditorGUILayout.EndHorizontal(); } } } serializedObject.ApplyModifiedProperties(); }
public override void OnInspectorGUI() { CoreEditorModule.ShowScriptReference(serializedObject); serializedObject.Update(); EditorGUILayout.PropertyField(_sp_durationOfAnimation); if (_reference.showAnimationProperty) { CoreEditorModule.DrawHorizontalLine(); _reference.showAnimationProperty = EditorGUILayout.Foldout( _reference.showAnimationProperty, "Animation Property", true ); EditorGUI.indentLevel += 1; PositionGUI(); RotationGUI(); ScalingGUI(); EditorGUI.indentLevel -= 1; } else { _reference.showAnimationProperty = EditorGUILayout.Foldout( _reference.showAnimationProperty, "Animation Property", true ); } serializedObject.ApplyModifiedProperties(); }
public override void OnInspectorGUI() { CoreEditorModule.ShowScriptReference(serializedObject); serializedObject.Update(); EditorGUILayout.PropertyField(_DeveloperDescription); EditorGUI.BeginChangeCheck(); _layerIndex.intValue = EditorGUILayout.Popup( EditorGUIUtility.TrTextContent("Layer", "Select your layer. You can only pick one from the following option"), _layerIndex.intValue, _layersLabel); if (EditorGUI.EndChangeCheck()) { _layerIndex.serializedObject.ApplyModifiedProperties(); _layerName.stringValue = _layersLabel[_layerIndex.intValue]; _layerName.serializedObject.ApplyModifiedProperties(); } serializedObject.ApplyModifiedProperties(); }
public override void OnInspectorGUI() { CoreEditorModule.ShowScriptReference(serializedObject); serializedObject.Update(); EditorGUILayout.PropertyField(_DeveloperDescription); EditorGUI.BeginChangeCheck(); _tagIndex.intValue = EditorGUILayout.Popup( EditorGUIUtility.TrTextContent("Tag", "Select your tag"), _tagIndex.intValue, _tagsLabel); if (EditorGUI.EndChangeCheck()) { _tagIndex.serializedObject.ApplyModifiedProperties(); _Value.stringValue = _tagsLabel[_tagIndex.intValue]; _Value.serializedObject.ApplyModifiedProperties(); } serializedObject.ApplyModifiedProperties(); }
public override void OnInspectorGUI() { CoreEditorModule.ShowScriptReference(serializedObject); serializedObject.Update(); EditorGUILayout.BeginHorizontal(); { if (!EditorApplication.isCompiling) { _currencyName = EditorGUILayout.TextField(_currencyName); if (!_flagedForRegeneratingEnum && GUILayout.Button("+Add")) { AddNewCurrency(_currencyName); } if (_flagedForGeneratingEnum && GUILayout.Button("GenerateEnum", GUILayout.Width(125))) { _flagedForGeneratingEnum = false; GenerateEnum(); } } } EditorGUILayout.EndHorizontal(); //Section : Currency To Be Added if (_listOfCurrencyToBeAdded.Count > 0) { CoreEditorModule.DrawHorizontalLine(); EditorGUILayout.LabelField("Currency to be Added :", EditorStyles.boldLabel); EditorGUI.indentLevel += 1; foreach (AccountManagerSettings.CurrecnyInfo currencyInfo in _listOfCurrencyToBeAdded) { EditorGUILayout.LabelField(currencyInfo.enumName); } EditorGUI.indentLevel -= 1; } CoreEditorModule.DrawHorizontalLine(); //Section : Added Currency EditorGUILayout.BeginHorizontal(); { EditorGUILayout.LabelField("ListOfCurrencyInfo", EditorStyles.boldLabel); if (_flagedForRegeneratingEnum) { if (!EditorApplication.isCompiling && GUILayout.Button("RegenerateEnum", GUILayout.Width(125f))) { GenerateEnum(); } } } EditorGUILayout.EndHorizontal(); EditorGUI.indentLevel += 1; int numberOfCurrencyInfo = _reference.listOfCurrencyInfos.Count; for (int i = 0; i < numberOfCurrencyInfo; i++) { EditorGUILayout.BeginHorizontal(); { _reference.listOfCurrencyInfos[i].showOnEditor = EditorGUILayout.Foldout( _reference.listOfCurrencyInfos[i].showOnEditor, _reference.listOfCurrencyInfos[i].enumName, true ); if (!_reference.listOfCurrencyInfos[i].showOnEditor) { if (!EditorApplication.isCompiling && i > 0 && GUILayout.Button("Remove", GUILayout.Width(100f))) { _reference.listOfCurrencyInfos.RemoveAt(i); GenerateEnum(); return; } } } EditorGUILayout.EndHorizontal(); if (_reference.listOfCurrencyInfos[i].showOnEditor) { EditorGUI.indentLevel += 1; EditorGUILayout.PropertyField(_listOfCurrencyInfos.GetArrayElementAtIndex(i).FindPropertyRelative("currencyName")); EditorGUILayout.PropertyField(_listOfCurrencyInfos.GetArrayElementAtIndex(i).FindPropertyRelative("currencyIcon")); EditorGUILayout.PropertyField(_listOfCurrencyInfos.GetArrayElementAtIndex(i).FindPropertyRelative("currencydefaultAmount")); EditorGUILayout.PropertyField(_listOfCurrencyInfos.GetArrayElementAtIndex(i).FindPropertyRelative("currencyAnimationDuration")); EditorGUILayout.PropertyField(_listOfCurrencyInfos.GetArrayElementAtIndex(i).FindPropertyRelative("animationCurve")); EditorGUI.indentLevel -= 1; EditorGUILayout.Space(); } } EditorGUI.indentLevel -= 1; serializedObject.ApplyModifiedProperties(); }
public override void OnInspectorGUI() { CoreEditorModule.ShowScriptReference(serializedObject); serializedObject.Update(); SceneAsset oldScene = AssetDatabase.LoadAssetAtPath <SceneAsset>(scenePath.stringValue); EditorGUI.BeginChangeCheck(); SceneAsset newScene = EditorGUILayout.ObjectField( "Scene", oldScene, typeof(SceneAsset), false ) as SceneAsset; if (EditorGUI.EndChangeCheck()) { string newPath = AssetDatabase.GetAssetPath(newScene); scenePath.stringValue = newPath; scenePath.serializedObject.ApplyModifiedProperties(); sceneName.stringValue = CoreEditorModule.GetSceneNameFromPath(newPath); sceneName.serializedObject.ApplyModifiedProperties(); if (CoreEditorModule.IsSceneAlreadyInBuild(newPath)) { isEnabled.boolValue = CoreEditorModule.IsSceneEnabled(newPath); } } if (newScene != null) { CoreEditorModule.DrawHorizontalLine(); advanceOption.boolValue = EditorGUILayout.Foldout( advanceOption.boolValue, "Advance Option", true ); if (advanceOption.boolValue) { EditorGUI.indentLevel += 1; EditorGUI.BeginChangeCheck(); EditorGUILayout.PropertyField(animationSpeedForLoadingBar); if (EditorGUI.EndChangeCheck()) { animationSpeedForLoadingBar.serializedObject.ApplyModifiedProperties(); ClampAnimationValue(); } EditorGUILayout.PropertyField(loadSceneMode); EditorGUI.indentLevel -= 1; } CoreEditorModule.DrawHorizontalLine(); EditorGUILayout.BeginHorizontal(); { if (CoreEditorModule.IsSceneAlreadyInBuild(scenePath.stringValue)) { EditorGUI.BeginChangeCheck(); isEnabled.boolValue = EditorGUILayout.Toggle( "IsEnabled", isEnabled.boolValue ); if (EditorGUI.EndChangeCheck()) { isEnabled.serializedObject.ApplyModifiedProperties(); CoreEditorModule.EnableAndDisableScene(scenePath.stringValue, isEnabled.boolValue); } if (GUILayout.Button("LoadScene")) { _reference.LoadScene(); } if (GUILayout.Button("Remove", GUILayout.Width(100))) { CoreEditorModule.RemoveSceneFromBuild(scenePath.stringValue); } } else { EditorGUILayout.HelpBox("Please add scene to the build settings", MessageType.Info); if (GUILayout.Button("Add", GUILayout.Width(100))) { CoreEditorModule.AddSceneToBuild(scenePath.stringValue, isEnabled.boolValue); } } } EditorGUILayout.EndHorizontal(); } serializedObject.ApplyModifiedProperties(); }