public override void DrawGUI(IntelligenceState parentState, Intelligence intelligence, CallbackCollection callbacks) { #if UNITY_EDITOR desiredDistance = UnityEditor.EditorGUILayout.FloatField("distance:", desiredDistance); fleeFrom = UnityEditor.EditorGUILayout.TextField("from:", fleeFrom); #endif }
public override void DrawGUI(IntelligenceState parentState, Intelligence intelligence, CallbackCollection callbacks) { #if UNITY_EDITOR int currentState = 0; List<string> stateNames = new List<string> (); stateNames.Add ("Select"); for (int i = 0; i < intelligence.states.Count; i++) { string newStateName = intelligence.states [i].name; if (newState != null) { if (newState.name.Equals (newStateName, System.StringComparison.OrdinalIgnoreCase)) { currentState = i + 1; } } stateNames.Add (newStateName); } EditorGUILayout.BeginHorizontal (); GUILayout.Label ("New State: "); int selectedState = EditorGUILayout.Popup (currentState, stateNames.ToArray ()); EditorGUILayout.EndHorizontal (); if (selectedState > 0) { if (!parentState.name.Equals (intelligence.states [selectedState - 1].name)) { newState = intelligence.states [selectedState - 1]; } else { Debug.LogWarning ("transitioning to self is useless."); } } #endif }
public override void DrawGUI(IntelligenceState parentState, Intelligence intelligence, CallbackCollection callbacks) { #if UNITY_EDITOR EditorGUILayout.BeginHorizontal(); GUILayout.Label("Var Name:", GUILayout.Width(64)); storeName = EditorGUILayout.TextField(storeName); EditorGUILayout.EndHorizontal(); #endif }
public override void DrawGUI(IntelligenceState parentState, Intelligence intelligence, CallbackCollection callbacks) { #if UNITY_EDITOR UnityEditor.EditorGUILayout.BeginHorizontal(); GUILayout.Label("Var name:"); varName = UnityEditor.EditorGUILayout.TextField(varName); UnityEditor.EditorGUILayout.EndHorizontal(); #endif }
public override void DrawGUI(IntelligenceState parentState, Intelligence intelligence, CallbackCollection callbacks) { #if UNITY_EDITOR EditorGUILayout.BeginHorizontal(); GUILayout.Label("target var name: "); entityVarName = EditorGUILayout.TextField(entityVarName); EditorGUILayout.EndHorizontal(); range = EditorGUILayout.FloatField("Range:", range); #endif }
public override void DrawGUI(IntelligenceState parentState, Intelligence intelligence, CallbackCollection callbacks) { #if UNITY_EDITOR target = (MessageTarget)EditorGUILayout.EnumPopup("Target:",target); type = (NotificationType)EditorGUILayout.EnumPopup("Type:", type); EditorGUILayout.BeginHorizontal(); GUILayout.Label("Position var:", GUILayout.Width(74)); positionVariableName = EditorGUILayout.TextField(positionVariableName); EditorGUILayout.EndHorizontal(); radius = EditorGUILayout.FloatField("Radius:", radius); #endif }
public override void DrawGUI(IntelligenceState parentState, Intelligence intelligence, CallbackCollection callbacks) { #if UNITY_EDITOR UnityEditor.EditorGUILayout.BeginHorizontal(); GUILayout.Label("Type:"); type = (SoundSet.ClipType)UnityEditor.EditorGUILayout.EnumPopup(type); UnityEditor.EditorGUILayout.EndHorizontal(); UnityEditor.EditorGUILayout.BeginHorizontal(); GUILayout.Label("Interval (if continuous):"); interval = UnityEditor.EditorGUILayout.FloatField(interval); UnityEditor.EditorGUILayout.EndHorizontal(); #endif }
public override void DrawGUI(IntelligenceState parentState, Intelligence intelligence, CallbackCollection callbacks) { #if UNITY_EDITOR EditorGUILayout.BeginHorizontal(); GUILayout.Label("Target var name:"); entityVarName = EditorGUILayout.TextField(entityVarName); EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginHorizontal(); GUILayout.Label("Interval:"); interval = EditorGUILayout.Slider(interval, 0.1f, 2f); EditorGUILayout.EndHorizontal(); damagePerAttack = EditorGUILayout.IntField(new GUIContent("Damage:", "per interval"), damagePerAttack); #endif }
public override void DrawGUI(IntelligenceState parentState, Intelligence intelligence, CallbackCollection callbacks) { #if UNITY_EDITOR Type = (TargetType)EditorGUILayout.EnumPopup("Type:", Type); targetClassification = (IntelligenceType) EditorGUILayout.EnumPopup("Classification:", targetClassification); range = EditorGUILayout.FloatField("Range:", range); checkLOS = EditorGUILayout.Toggle("Check LOS:", checkLOS); saveVar = EditorGUILayout.Toggle("Save", saveVar); if (saveVar) { EditorGUILayout.BeginHorizontal(); GUILayout.Label("Var name:"); storageVar = EditorGUILayout.TextField(storageVar); EditorGUILayout.EndHorizontal(); } #endif }
public override void DrawGUI(IntelligenceState parentState, Intelligence intelligence, CallbackCollection callbacks) { #if UNITY_EDITOR posVarSource = (PositionSource)UnityEditor.EditorGUILayout.EnumPopup("Position source:", posVarSource); if (posVarSource == PositionSource.VarValue) { UnityEditor.EditorGUILayout.BeginHorizontal(); GUILayout.Label("Postion var name:"); posVarName = UnityEditor.EditorGUILayout.TextField(posVarName); UnityEditor.EditorGUILayout.EndHorizontal(); } saveAsVar = UnityEditor.EditorGUILayout.Toggle("Save as var:", saveAsVar); if (saveAsVar) { UnityEditor.EditorGUILayout.BeginHorizontal(); GUILayout.Label("Save var name:"); saveVarName = UnityEditor.EditorGUILayout.TextField(saveVarName); UnityEditor.EditorGUILayout.EndHorizontal(); } #endif }
void SetState(System.Func<IntelligenceState, IntelligenceState> GetClonedState) { newState = GetClonedState (newState); }
public override void DrawGUI(IntelligenceState parentState, Intelligence intelligence, CallbackCollection callbacks) { #if UNITY_EDITOR varName = UnityEditor.EditorGUILayout.TextField("var name", varName); #endif }
public virtual void DrawGUI(IntelligenceState parentState, Intelligence intelligence, CallbackCollection callbacks) { }
public override void DrawGUI(IntelligenceState parentState, Intelligence intelligence, CallbackCollection callbacks) { #if UNITY_EDITOR color = UnityEditor.EditorGUILayout.ColorField("Color:", color); #endif }
public override void DrawGUI(IntelligenceState parentState, Intelligence intelligence, CallbackCollection callbacks) { GUILayout.Label("Text:"); debugString = GUILayout.TextField(debugString); }
public override void DrawGUI(IntelligenceState parentState, Intelligence intelligence, CallbackCollection callbacks) { #if UNITY_EDITOR GUILayout.Label("If:"); if (ifAction == null) { Type res = callbacks.ConditionalActionPopup(); if (res != null) { ifAction = CreateInstance(res) as AIAction; ifAction.name = res.Name; callbacks.AddAsset(ifAction); } } else { EditorGUILayout.BeginVertical(EditorStyles.helpBox); EditorGUILayout.BeginHorizontal(); GUILayout.Label(ifAction.name); if (GUILayout.Button("x", EditorStyles.miniButton, GUILayout.Width(20))) { callbacks.RemoveAsset(ifAction); } EditorGUILayout.EndHorizontal(); ifAction.DrawGUI(parentState, intelligence, callbacks); EditorGUILayout.EndVertical(); } GUILayout.Label("Then:"); if (thenAction == null) { Type res = callbacks.ContinuousActionPopup(); if (res != null) { thenAction = CreateInstance(res) as AIAction; thenAction.name = res.Name; callbacks.AddAsset(thenAction); } } else { EditorGUILayout.BeginVertical(EditorStyles.helpBox); EditorGUILayout.BeginHorizontal(); GUILayout.Label(thenAction.name); if (GUILayout.Button("x", EditorStyles.miniButton, GUILayout.Width(20))) { callbacks.RemoveAsset(thenAction); } EditorGUILayout.EndHorizontal(); thenAction.DrawGUI(parentState, intelligence, callbacks); EditorGUILayout.EndVertical(); } GUILayout.Label("Else:"); if (elseAction == null) { Type res = callbacks.ContinuousActionPopup(); if (res != null) { elseAction = CreateInstance(res) as AIAction; elseAction.name = res.Name; callbacks.AddAsset(elseAction); } } else { EditorGUILayout.BeginVertical(EditorStyles.helpBox); EditorGUILayout.BeginHorizontal(); GUILayout.Label(elseAction.name); if (GUILayout.Button("x", EditorStyles.miniButton, GUILayout.Width(20))) { callbacks.RemoveAsset(elseAction); } EditorGUILayout.EndHorizontal(); elseAction.DrawGUI(parentState, intelligence, callbacks); EditorGUILayout.EndVertical(); } #endif }