private static void UpdateListOfSceneContainerAsset() { _listOfSceneContainerAsset = CoreEditorModule.GetAsset <SceneContainerAsset>(); if (_listOfSceneContainerAsset.Count == _numberOfSceneContainerAsset) { return; } _numberOfSceneContainerAsset = _listOfSceneContainerAsset.Count; _popUpOption = new int[_numberOfSceneContainerAsset]; _isFoldOut = new bool[_numberOfSceneContainerAsset]; _editorForSceneContainerAsset = new Editor[_numberOfSceneContainerAsset]; _serializedObjectOfSceneContainerAsset = new SerializedObject[_numberOfSceneContainerAsset]; _serializedPropertyOfSceneList = new SerializedProperty[_numberOfSceneContainerAsset]; _reorderableListOfSceneContainerAsset = new CoreEditorModule.ReorderableList[_numberOfSceneContainerAsset]; for (int i = 0; i < _numberOfSceneContainerAsset; i++) { _serializedObjectOfSceneContainerAsset[i] = new SerializedObject(_listOfSceneContainerAsset[i]); _serializedPropertyOfSceneList[i] = _serializedObjectOfSceneContainerAsset[i].FindProperty("listOfScene"); _reorderableListOfSceneContainerAsset[i] = new CoreEditorModule.ReorderableList(_serializedObjectOfSceneContainerAsset[i], _serializedPropertyOfSceneList[i], true); } }
public override void OnInspectorGUI() { base.OnInspectorGUI(); serializedObject.Update(); CoreEditorModule.DrawHorizontalLine(); InstanceViwerGUI(); serializedObject.ApplyModifiedProperties(); }
private void PositionGUI() { //Position _reference.isPositionAnimationEnabled = EditorGUILayout.Foldout( _reference.isPositionAnimationEnabled, (_reference.isPositionAnimationEnabled ? "[Enabled]" : "[Disabled]") + " : Position", true ); if (_reference.isPositionAnimationEnabled) { EditorGUILayout.BeginVertical(); { EditorGUI.indentLevel += 1; EditorGUILayout.PropertyField(_sp_transitionTypeForPosition); EditorGUILayout.PropertyField(_sp_animatedLocalPosition); EditorGUILayout.Space(); _reference.axisTypeForPositionAnimation = (CoreEnums.AxisType)EditorGUILayout.EnumPopup( "Curve Mode", _reference.axisTypeForPositionAnimation ); { EditorGUI.indentLevel += 1; switch (_reference.axisTypeForPositionAnimation) { case CoreEnums.AxisType.OneForAll: _reference.curveForPositionAnimation = EditorGUILayout.CurveField("Curve :(x,y,z)", _reference.curveForPositionAnimation); break; case CoreEnums.AxisType.Seperate: _reference.curveForPositionAnimationOnX = EditorGUILayout.CurveField("Curve : (x)", _reference.curveForPositionAnimationOnX); _reference.curveForPositionAnimationOnY = EditorGUILayout.CurveField("Curve : (y)", _reference.curveForPositionAnimationOnY); _reference.curveForPositionAnimationOnZ = EditorGUILayout.CurveField("Curve : (z)", _reference.curveForPositionAnimationOnZ); break; } EditorGUI.indentLevel -= 1; } EditorGUI.indentLevel -= 1; } EditorGUILayout.EndVertical(); CoreEditorModule.DrawHorizontalLine(); } }
private void DrawSceneContainerAddedInBuildSettingsGUI() { if (productionSceneContainer == null) { EditorGUILayout.HelpBox("No 'SceneContainer' has pushed to 'BuildSettings'", MessageType.Warning); } else { Color defaultBackgroundColor = GUI.backgroundColor; GUI.backgroundColor = Color.yellow; EditorGUILayout.LabelField(" SceneContainer : Production", HeighlightedBackgroundWithBoldStyle); GUI.backgroundColor = defaultBackgroundColor; CoreEditorModule.DrawSettingsEditor(productionSceneContainer, null, ref _isFoldOut[_productionSceneIndex], ref _editorForSceneContainerAsset[_productionSceneIndex]); } }
public override void OnInspectorGUI() { serializedObject.Update(); CoreEditorModule.ShowScriptReference(serializedObject); if (GUILayout.Button("PushToBuild")) { PushToBuild(); } _reorderableListOfScene.DoLayoutList(); serializedObject.ApplyModifiedProperties(); }
private static int IsThereAnySceneContainerWithTheGivenName(string name) { int _numberOfDuplicateName = 0; List <SceneContainerAsset> sceneContainerAssets = CoreEditorModule.GetAsset <SceneContainerAsset>(); foreach (SceneContainerAsset sceneContainerAsset in sceneContainerAssets) { if (sceneContainerAsset.name.Contains(name)) { _numberOfDuplicateName++; } } return(_numberOfDuplicateName); }
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(); }
private void DrawSceneContainerOtherThanBuildSettingsGUI() { if (_numberOfSceneContainerAsset > 0) { if (productionSceneContainer != null && _numberOfSceneContainerAsset == 1) { return; } EditorGUILayout.Space(); CoreEditorModule.DrawHorizontalLine(); Color defaultContentColor = GUI.contentColor; GUI.contentColor = Color.cyan; _isFoldoutOtherSceneContainer = EditorGUILayout.Foldout( _isFoldoutOtherSceneContainer, " SceneContainer : Others", true ); GUI.contentColor = defaultContentColor; if (_isFoldoutOtherSceneContainer) { EditorGUILayout.Space(); CoreEditorModule.DrawHorizontalLine(); EditorGUI.indentLevel += 1; for (int i = 0; i < _numberOfSceneContainerAsset; i++) { if (_listOfSceneContainerAsset[i] != productionSceneContainer) { CoreEditorModule.DrawSettingsEditor(_listOfSceneContainerAsset[i], null, ref _isFoldOut[i], ref _editorForSceneContainerAsset[i]); if (i < (_numberOfSceneContainerAsset - 1)) { EditorGUILayout.Space(); CoreEditorModule.DrawHorizontalLine(); } } else { _productionSceneIndex = i; } } EditorGUI.indentLevel -= 1; } } }
private void HeaderGUI() { EditorGUILayout.Space(); EditorGUILayout.Space(); EditorGUILayout.BeginHorizontal(); { EditorGUILayout.LabelField(productionSceneContainer == null ? "No Scene Container" : "Active SceneContainer : " + productionSceneContainer.name, EditorStyles.boldLabel); if (GUILayout.Button("+SceneContainer")) { AddSceneContainerAsset(); } } EditorGUILayout.EndHorizontal(); CoreEditorModule.DrawHorizontalLine(); }
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(); 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(); }
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(); }
private void ScalingGUI() { _reference.isScalingAnimationEnabled = EditorGUILayout.Foldout( _reference.isScalingAnimationEnabled, (_reference.isScalingAnimationEnabled ? "[Enabled]" : "[Disabled]") + " : Scaling", true ); if (_reference.isScalingAnimationEnabled) { EditorGUILayout.BeginVertical(); { EditorGUI.indentLevel += 1; EditorGUILayout.PropertyField(_sp_initialScalePoint); switch (_reference.initialScalePoint) { case CoreEnums.InitialScalePoint.Current: break; case CoreEnums.InitialScalePoint.New: EditorGUILayout.PropertyField(_sp_initialLocalScale); break; } EditorGUILayout.PropertyField(_sp_animatedLocalScale); EditorGUILayout.Space(); _reference.axisTypeForScalingAnimation = (CoreEnums.AxisType)EditorGUILayout.EnumPopup( "Curve Mode", _reference.axisTypeForScalingAnimation ); { EditorGUI.indentLevel += 1; switch (_reference.axisTypeForScalingAnimation) { case CoreEnums.AxisType.OneForAll: _reference.curveForLocalScaleAnimation = EditorGUILayout.CurveField("Curve :(x,y,z)", _reference.curveForLocalScaleAnimation); break; case CoreEnums.AxisType.Seperate: _reference.curveForLocalScaleAnimationOnX = EditorGUILayout.CurveField("Curve : (x)", _reference.curveForLocalScaleAnimationOnX); _reference.curveForLocalScaleAnimationOnY = EditorGUILayout.CurveField("Curve : (y)", _reference.curveForLocalScaleAnimationOnY); _reference.curveForLocalScaleAnimationOnZ = EditorGUILayout.CurveField("Curve : (z)", _reference.curveForLocalScaleAnimationOnZ); break; } EditorGUI.indentLevel -= 1; } EditorGUI.indentLevel -= 1; } EditorGUILayout.EndVertical(); CoreEditorModule.DrawHorizontalLine(); } }
private void OnGUI() { EditorGUILayout.Space(); EditorGUILayout.BeginHorizontal(); { m_SearchText = EditorGUILayout.TextField( "Search", m_SearchText ); } EditorGUILayout.EndHorizontal(); m_ScrollPosition = EditorGUILayout.BeginScrollView(m_ScrollPosition, false, false); { //SettingMenu CoreEditorModule.DrawHorizontalLine(); EditorGUILayout.BeginHorizontal(); { EditorGUILayout.LabelField("PrefKeys (" + PlayerPrefDataSettings.listOfUsedPlayerPrefEditorData.Count.ToString() + ")", EditorStyles.boldLabel); EditorGUILayout.LabelField("DataType", EditorStyles.boldLabel, GUILayout.Width(widthForDataType)); EditorGUILayout.LabelField("Value", EditorStyles.boldLabel, GUILayout.Width(widthForValue)); EditorGUILayout.LabelField("SetValue", EditorStyles.boldLabel, GUILayout.Width(widthForValueChange)); } EditorGUILayout.EndHorizontal(); CoreEditorModule.DrawHorizontalLine(); //Traversing List int t_Index = 1; foreach (PlayerPrefDataSettings.PlayerPrefEditorData t_PlayerPrefDataKey in PlayerPrefDataSettings.listOfUsedPlayerPrefEditorData) { if (m_SearchText == null || (m_SearchText != null && (m_SearchText.Length == 0 || (m_SearchText.Length > 0 && t_PlayerPrefDataKey.key.Contains(m_SearchText))))) { EditorGUILayout.BeginHorizontal(); { EditorGUILayout.LabelField(t_Index + " : " + t_PlayerPrefDataKey.key); if (t_PlayerPrefDataKey.type == typeof(bool)) { EditorGUILayout.LabelField("BOOLEAN", GUILayout.Width(widthForDataType)); EditorGUILayout.LabelField(t_PlayerPrefDataKey.value, GUILayout.Width(widthForValue)); bool t_BoolValue = (bool)System.Convert.ChangeType(t_PlayerPrefDataKey.value, typeof(bool)); EditorGUI.BeginChangeCheck(); { t_BoolValue = EditorGUILayout.Toggle( "", t_BoolValue, GUILayout.Width(widthForValueChange) ); } if (EditorGUI.EndChangeCheck()) { PlayerPrefDataSettings.SetData <bool>(t_PlayerPrefDataKey.key, t_BoolValue.ToString()); } } else if (t_PlayerPrefDataKey.type == typeof(int)) { EditorGUILayout.LabelField("INTEGER", GUILayout.Width(widthForDataType)); EditorGUILayout.LabelField(t_PlayerPrefDataKey.value, GUILayout.Width(widthForValue)); int t_IntValue = (int)System.Convert.ChangeType(t_PlayerPrefDataKey.value, typeof(int)); EditorGUI.BeginChangeCheck(); { t_IntValue = EditorGUILayout.IntField( "", t_IntValue, GUILayout.Width(widthForValueChange) ); } if (EditorGUI.EndChangeCheck()) { PlayerPrefDataSettings.SetData <int>(t_PlayerPrefDataKey.key, t_IntValue.ToString()); } } else if (t_PlayerPrefDataKey.type == typeof(float)) { EditorGUILayout.LabelField("FLOAT", GUILayout.Width(widthForDataType)); EditorGUILayout.LabelField(t_PlayerPrefDataKey.value, GUILayout.Width(widthForValue)); float t_FloatValue = (float)System.Convert.ChangeType(t_PlayerPrefDataKey.value, typeof(float)); EditorGUI.BeginChangeCheck(); { t_FloatValue = EditorGUILayout.FloatField( "", t_FloatValue, GUILayout.Width(widthForValueChange) ); } if (EditorGUI.EndChangeCheck()) { PlayerPrefDataSettings.SetData <float>(t_PlayerPrefDataKey.key, t_FloatValue.ToString()); } } else if (t_PlayerPrefDataKey.type == typeof(double)) { EditorGUILayout.LabelField("DOUBLE", GUILayout.Width(widthForDataType)); EditorGUILayout.LabelField(t_PlayerPrefDataKey.value, GUILayout.Width(widthForValue)); double t_DoubleValue = (double)System.Convert.ChangeType(t_PlayerPrefDataKey.value, typeof(double)); EditorGUI.BeginChangeCheck(); { t_DoubleValue = EditorGUILayout.DoubleField( "", t_DoubleValue, GUILayout.Width(widthForValueChange) ); } if (EditorGUI.EndChangeCheck()) { PlayerPrefDataSettings.SetData <double>(t_PlayerPrefDataKey.key, t_DoubleValue.ToString()); } } else if (t_PlayerPrefDataKey.type == typeof(string)) { EditorGUILayout.LabelField("STRING", GUILayout.Width(widthForDataType)); EditorGUILayout.LabelField(t_PlayerPrefDataKey.value, GUILayout.Width(widthForValue)); string t_StringValue = (string)System.Convert.ChangeType(t_PlayerPrefDataKey.value, typeof(string)); EditorGUI.BeginChangeCheck(); { t_StringValue = EditorGUILayout.TextField( "", t_StringValue, GUILayout.Width(widthForValueChange) ); } if (EditorGUI.EndChangeCheck()) { PlayerPrefDataSettings.SetData <string>(t_PlayerPrefDataKey.key, t_StringValue.ToString()); } } else if (t_PlayerPrefDataKey.type == typeof(System.DateTime)) { EditorGUILayout.LabelField("DATE_TIME", GUILayout.Width(widthForDataType)); EditorGUILayout.LabelField(t_PlayerPrefDataKey.value, GUILayout.Width(widthForValue)); System.DateTime dateTimeValue = (System.DateTime)System.Convert.ChangeType(t_PlayerPrefDataKey.value, typeof(System.DateTime)); EditorGUI.BeginChangeCheck(); { GUI.enabled = false; EditorGUILayout.TextField( "", dateTimeValue.ToString(), GUILayout.Width(widthForValueChange) ); GUI.enabled = true; } if (EditorGUI.EndChangeCheck()) { PlayerPrefDataSettings.SetData <System.DateTime>(t_PlayerPrefDataKey.key, dateTimeValue.ToString()); } } } EditorGUILayout.EndHorizontal(); } t_Index++; } } EditorGUILayout.EndScrollView(); }