public static void showGeneralsArea(SimpleAIConfig gameConfig) { EditorGUILayout.BeginVertical("Box"); EditorGUILayout.HelpBox(Language.alertGeneralIsGlobal(gameConfig.selectedLanguage), MessageType.Warning); EditorGUILayout.Space(); Language.LangList tmpLang = (Language.LangList)EditorGUILayout.EnumPopup(Language.languageLabel(gameConfig.selectedLanguage), gameConfig.selectedLanguage); if (tmpLang != Language.LangList.select) { gameConfig.selectedLanguage = tmpLang; } //EditorUtility.DisplayDialog("Place Selection On Surface?", "Are you sure you want to place", "Place", "Do Not Place") AIBase.AIType AITypeTemp = (AIBase.AIType)EditorGUILayout.EnumPopup(Language.gameMovimentTypeLabel(gameConfig.selectedLanguage), gameConfig.AIType); if (AITypeTemp != AIBase.AIType.nothingSelected) { gameConfig.AIType = AITypeTemp; } gameConfig.groundingDistance = EditorGUILayout.Slider(new GUIContent(Language.groundVerifierLabel(gameConfig.selectedLanguage), iconLanding, Language.groundVerifierTooltip(gameConfig.selectedLanguage)), gameConfig.groundingDistance, 0.01f, 1); gameConfig.groundLayer = EditorTools.LayerMaskField(Language.groundLayerLabel(gameConfig.selectedLanguage), gameConfig.groundLayer); gameConfig.platformLayer = EditorTools.LayerMaskField(Language.platformLayerLabel(gameConfig.selectedLanguage), gameConfig.platformLayer); //TODO: Tradução EditorGUILayout.HelpBox("Layer onde pode estar qualquer objeto, parede e etc que pode interromper a visão do AI alem do chão.", MessageType.Info); gameConfig.obistacleLayer = EditorTools.LayerMaskField("Obstacles layer", gameConfig.obistacleLayer); EditorGUILayout.Space(); EditorGUILayout.EndVertical(); }
void OnEnable() { BorderLassButton = new GUIStyle(); BorderLassButton.border.top = 0; gameConfig = Resources.Load("Configs/GeneralConfigs") as SimpleAIConfig; secondScreenLayout = Resources.Load <GUISkin>("GUIStyle/FontsSkin"); }
public static void BehaviourButtons(AI _ai, SimpleAIConfig gameConfig) { EditorGUILayout.BeginVertical("Box"); //TODO: Tradução EditorGUILayout.LabelField(new GUIContent("Behaviours", iconAI), EditorStyles.boldLabel); showBehaviourArea(_ai, gameConfig); EditorGUILayout.EndVertical(); }
private void Awake() { if (!gameConfig) { gameConfig = Resources.Load("Configs/GeneralConfigs") as SimpleAIConfig; } spawnPoint = transform.position; spawned = true; }
public static void OpenWindow() { _ai = null; behaviour = -1; gameConfig = Resources.Load("Configs/GeneralConfigs") as SimpleAIConfig; SimpleAIWindow window = (SimpleAIWindow)GetWindow(typeof(SimpleAIWindow)); window.minSize = windowSize; window.Show(); }
public static void OpenWindow(AI ai, int behaviour_id) { _ai = ai; behaviour = behaviour_id; moment = windowMoments.main; gameConfig = Resources.Load("Configs/GeneralConfigs") as SimpleAIConfig; SimpleAIWindow window = (SimpleAIWindow)GetWindow(typeof(SimpleAIWindow)); window.minSize = windowSize; window.Show(); }
public static void DrawAIActions(AI _ai, SimpleAIConfig gameConfig) { for (int i = 0; i < _ai.actions.Length; i++) { try { EditorGUILayout.BeginVertical("box"); EditorGUILayout.BeginHorizontal(); Rect r = EditorGUILayout.GetControlRect(); r.height = 22; r.y += 1; GUIStyle style = new GUIStyle(GUI.skin.GetStyle("HelpBox")); style.richText = true; style.normal.textColor = _ai.actions[i].color; style.fontSize = 13; EditorGUI.LabelField(r, "<b>" + _ai.actions[i].name + "</b>", style); if (GUILayout.Button("Edit", new GUILayoutOption[] { GUILayout.Width(50), GUILayout.Height(21) })) { SimpleAIWindow.OpenWindow(_ai, i); } EditorGUILayout.EndHorizontal(); EditorGUILayout.Space(); _ai.actions[i].relevance = EditorGUILayout.IntSlider("Relevance", _ai.actions[i].relevance, 1, 10); EditorGUILayout.EndVertical(); } catch (Exception e) { Debug.LogError(e.Message); continue; } } }
public static void showBehaviourArea(AI _ai, SimpleAIConfig gameConfig) { EditorGUILayout.BeginVertical("Box"); switch (gameConfig.AIType) { case AIBase.AIType.platform: { AIDrawPlatformBehaviours(_ai, gameConfig); break; } case AIBase.AIType.topdown: { AIDrawTopdownBehaviours(_ai, gameConfig); break; } case AIBase.AIType.tactical: { AIDrawTacticalBehaviours(_ai, gameConfig); break; } default: { EditorGUILayout.HelpBox(Language.alertGameMovimentType(gameConfig.selectedLanguage), MessageType.Warning); EditorGUILayout.Space(); break; } } EditorGUILayout.Space(); EditorGUILayout.EndVertical(); }
public static void BehavioursTemplate(AI _ai, SimpleAIConfig gameConfig) { EditorGUILayout.LabelField(Language.numberOfBehaviours(gameConfig.selectedLanguage), EditorStyles.boldLabel); EditorGUILayout.BeginHorizontal(); if (GUILayout.Button("-")) { if (_ai.actions.Length > 0) { Array.Resize <AIAction>(ref _ai.actions, _ai.actions.Length - 1); _ai.save(); } } GUIStyle BoxNumberCenterStyle; BoxNumberCenterStyle = new GUIStyle(); BoxNumberCenterStyle.alignment = TextAnchor.MiddleCenter; BoxNumberCenterStyle.fontStyle = FontStyle.Bold; GUILayout.Box(_ai.actions.Length.ToString(), BoxNumberCenterStyle); if (GUILayout.Button("+")) { Array.Resize <AIAction>(ref _ai.actions, _ai.actions.Length + 1); _ai.actions[_ai.actions.Length - 1] = new AIAction(); _ai.save(); SimpleAIWindow.OpenWindow(_ai, _ai.actions.Length); } EditorGUILayout.EndHorizontal(); GUILayout.Space(2f); DrawAIActions(_ai, gameConfig); }
void OnEnable() { gameConfig = (SimpleAIConfig)target; }
public static void AIDrawTacticalBehaviours(AI _ai, SimpleAIConfig gameConfig) { EditorGUILayout.HelpBox(Language.alertNotImplementedYet(gameConfig.selectedLanguage), MessageType.Warning); EditorGUILayout.Space(); }
public static void AIDrawPlatformBehaviours(AI _ai, SimpleAIConfig gameConfig) { BehavioursTemplate(_ai, gameConfig); }