public static void Print(ICECreatureControl _control) { if (!_control.Display.ShowMissions) { return; } ICEEditorStyle.SplitterByIndent(0); _control.Display.FoldoutMissions = ICEEditorLayout.Foldout(_control.Display.FoldoutMissions, "Missions", Info.MISSIONS); if (!_control.Display.FoldoutMissions) { return; } EditorGUI.indentLevel++; DrawMissionOutpost(_control); DrawMissionEscort(_control); DrawMissionPatrol(_control); EditorGUI.indentLevel--; EditorGUILayout.Separator(); }
private static void DrawMissionOutpost(ICECreatureControl _control) { if (_control.Display.ShowMissionsHome == false) { return; } ICEEditorStyle.SplitterByIndent(EditorGUI.indentLevel); _control.Display.FoldoutMissionOutpost = ICEEditorLayout.Foldout(_control.Display.FoldoutMissionOutpost, "Outpost Mission", Info.MISSION_OUTPOST); if (!_control.Display.FoldoutMissionOutpost) { return; } _control.Creature.Missions.Outpost.Enabled = ICEEditorLayout.Toggle("Mission Enabled", "", _control.Creature.Missions.Outpost.Enabled, Info.MISSION_ENABLED); EditorGUILayout.Separator(); EditorGUI.BeginDisabledGroup(_control.Creature.Missions.Outpost.Enabled == false); _control.Creature.Missions.Outpost.Target = EditorSharedTools.DrawTarget(_control, _control.Creature.Missions.Outpost.Target, "Target", Info.MISSION_OUTPOST_TARGET); EditorGUILayout.Separator(); EditorGUILayout.LabelField("Behaviour", ICEEditorStyle.LabelBold); EditorGUI.indentLevel++; _control.Creature.Missions.Outpost.BehaviourModeTravel = EditorBehaviour.BehaviourSelect(_control, "Travel", "Move behaviour to reach the Outpost", _control.Creature.Missions.Outpost.BehaviourModeTravel, "TRAVEL"); _control.Creature.Missions.Outpost.BehaviourModeRendezvous = EditorBehaviour.BehaviourSelect(_control, "Rendezvous", "Idle behaviour after reaching the current target move position.", _control.Creature.Missions.Outpost.BehaviourModeRendezvous, "RENDEZVOUS"); EditorGUI.BeginDisabledGroup(_control.Creature.Missions.Outpost.Target.TargetRandomRange == 0); _control.Creature.Missions.Outpost.BehaviourModeLeisure = EditorBehaviour.BehaviourSelect(_control, "Leisure", "Randomized leisure activities around the Outpost", _control.Creature.Missions.Outpost.BehaviourModeLeisure, "STANDBY"); EditorGUI.EndDisabledGroup(); EditorGUI.indentLevel--; EditorGUI.EndDisabledGroup(); EditorGUILayout.Separator(); }
private static void DrawReferenceGroupList(ICECreatureRegister _register, List <ReferenceGroupObject> _list) { for (int _index = 0; _index < _list.Count; _index++) { ReferenceGroupObject _group = _list[_index]; UpdateStatus(_group); if (_group != null && _group.ReferenceGameObject != null) { ICEEditorStyle.SplitterByIndent(EditorGUI.indentLevel); ICEEditorLayout.BeginHorizontal(); EditorGUI.BeginDisabledGroup(_group.Enabled == false); _group.Foldout = EditorGUILayout.Foldout(_group.Foldout, GetTitleText(_group), ICEEditorStyle.Foldout); GUILayout.FlexibleSpace(); DrawEntityType(_group); EditorGUI.EndDisabledGroup(); if (ICEEditorLayout.ListUpDownButtons <ReferenceGroupObject>(_list, _index)) { return; } GUILayout.Space(5); EditorGUI.BeginDisabledGroup(_group.Enabled == false); EditorGUI.BeginDisabledGroup(_group.EntityComponent == null); _group.Break = ICEEditorLayout.CheckButtonMiddle("BREAK", "Deactivates all entity components", _group.Break); EditorGUI.EndDisabledGroup(); _group.UseSoftRespawn = ICEEditorLayout.CheckButtonMiddle("RECYCLE", "Allows the reuse of suspended objects without new instantiations", _group.UseSoftRespawn); EditorGUI.BeginDisabledGroup(_register.UsePoolManagement == false); _group.PoolManagementEnabled = ICEEditorLayout.CheckButtonMiddle("POOL", "Activates Pool Management", _group.PoolManagementEnabled); EditorGUI.EndDisabledGroup(); EditorGUI.EndDisabledGroup(); _group.Enabled = ICEEditorLayout.EnableButton("Enables/Disables the group", _group.Enabled); if (ICEEditorLayout.ListDeleteButtonMini <ReferenceGroupObject>(_list, _group, "Removes this reference group.")) { return; } ICEEditorLayout.EndHorizontal(Info.REGISTER_REFERENCE_OBJECT_GROUP); DrawReferenceGroup(_register, _group); } else { _list.RemoveAt(_index); --_index; } } }
private static void DrawMissionEscort(ICECreatureControl _control) { if (_control.Display.ShowMissionsEscort == false) { return; } ICEEditorStyle.SplitterByIndent(EditorGUI.indentLevel); ICEEditorLayout.BeginHorizontal(); _control.Display.FoldoutMissionEscort = ICEEditorLayout.Foldout(_control.Display.FoldoutMissionEscort, "Escort Mission"); if (GUILayout.Button("SAVE", ICEEditorStyle.ButtonMiddle)) { CreatureIO.SaveMissionEscortToFile(_control.Creature.Missions.Escort, _control.gameObject.name); } if (GUILayout.Button("LOAD", ICEEditorStyle.ButtonMiddle)) { _control.Creature.Missions.Escort = CreatureIO.LoadMissionEscortFromFile(_control.Creature.Missions.Escort); } ICEEditorLayout.EndHorizontal(Info.MISSION_ESCORT); if (!_control.Display.FoldoutMissionEscort) { return; } _control.Creature.Missions.Escort.Enabled = ICEEditorLayout.Toggle("Mission Enabled", "", _control.Creature.Missions.Escort.Enabled, Info.MISSION_ENABLED); EditorGUILayout.Separator(); EditorGUI.BeginDisabledGroup(_control.Creature.Missions.Escort.Enabled == false); _control.Creature.Missions.Escort.Target = EditorSharedTools.DrawTarget(_control, _control.Creature.Missions.Escort.Target, "Target", Info.MISSION_ESCORT_TARGET); EditorGUILayout.Separator(); ICEEditorLayout.Label("Behaviour", true, Info.MISSION_ESCORT_BEHAVIOUR); EditorGUI.indentLevel++; _control.Creature.Missions.Escort.BehaviourModeFollow = EditorBehaviour.BehaviourSelect(_control, "Follow", "Move behaviour to follow and reach the leader", _control.Creature.Missions.Escort.BehaviourModeFollow, "FOLLOW"); _control.Creature.Missions.Escort.BehaviourModeEscort = EditorBehaviour.BehaviourSelect(_control, "Escort", "Move behaviour to escort the leader", _control.Creature.Missions.Escort.BehaviourModeEscort, "ESCORT"); _control.Creature.Missions.Escort.BehaviourModeStandby = EditorBehaviour.BehaviourSelect(_control, "Standby", "Idle behaviour if the leader stops", _control.Creature.Missions.Escort.BehaviourModeStandby, "STANDBY"); EditorGUI.indentLevel++; _control.Creature.Missions.Escort.DurationStandby = ICEEditorLayout.Slider("Duration (until IDLE)", "", _control.Creature.Missions.Escort.DurationStandby, 1, 0, 60); EditorGUI.indentLevel--; _control.Creature.Missions.Escort.BehaviourModeIdle = EditorBehaviour.BehaviourSelect(_control, "Idle", "Idle behaviour if the leader breaks for a longer time-span", _control.Creature.Missions.Escort.BehaviourModeIdle, "IDLE"); EditorGUI.indentLevel--; EditorGUILayout.Separator(); EditorGUI.EndDisabledGroup(); }
/// <summary> /// Draws the content of the behaviour mode. /// </summary> /// <param name="_control">Control.</param> /// <param name="_mode">Mode.</param> public static void DrawBehaviourModeContent(ICECreatureControl _control, BehaviourModeObject _mode) { if (_mode == null) { return; } EditorHeaderType _header = EditorHeaderType.FOLDOUT_ENABLED_BOLD; EditorGUI.indentLevel++; CreatureObjectEditor.DrawBehaviourModeFavouredObject(_control, _mode.Favoured, _header, Info.BEHAVIOUR_MODE_FAVOURED); EditorGUI.indentLevel--; if (_mode.Rules.Count > 1) { ICEEditorLayout.Label("Rules", true, Info.BEHAVIOUR_MODE_RULE); EditorGUI.indentLevel++; ICEEditorLayout.BeginHorizontal(); _mode.RulesOrderType = (SequenceOrderType)ICEEditorLayout.EnumPopup("Order Type", "", _mode.RulesOrderType); EditorGUI.BeginDisabledGroup(_mode.RulesOrderType != SequenceOrderType.CYCLE); _mode.RulesOrderInverse = ICEEditorLayout.CheckButtonMiddle("INVERSE", "", _mode.RulesOrderInverse); EditorGUI.EndDisabledGroup(); ICEEditorLayout.EndHorizontal(Info.BEHAVIOUR_MODE_RULES_ORDER); EditorGUI.indentLevel--; } for (int i = 0; i < _mode.Rules.Count; i++) { DrawBehaviourModeRule(_control, _mode, i, _mode.Rules, _mode.Key); } if (_mode.Rules.Count == 1) { ICEEditorStyle.SplitterByIndent(EditorGUI.indentLevel + 1); ICEEditorLayout.BeginHorizontal(); EditorGUILayout.LabelField("Add or Copy Behaviour Rule", EditorStyles.miniLabel); if (ICEEditorLayout.AddButton("Add Behaviour Rule")) { _mode.Rules.Add(new BehaviourModeRuleObject()); } if (ICEEditorLayout.CopyButtonMiddle("Copy Behaviour Rule")) { _mode.Rules.Add(new BehaviourModeRuleObject(_mode.Rules[0])); } ICEEditorLayout.EndHorizontal("Add or Copy Behaviour Rule"); } else { ICEEditorLayout.DrawListAddLine <BehaviourModeRuleObject>(_mode.Rules, new BehaviourModeRuleObject(), true, "Add Behaviour Rule", Info.BEHAVIOUR_MODE_RULE_ADD); } //EditorGUILayout.Separator(); }
private static void DrawMissionOutpost(ICECreatureControl _control) { ICEEditorStyle.SplitterByIndent(EditorGUI.indentLevel); //HEADER BEGIN ICEEditorLayout.BeginHorizontal(); _control.Creature.Missions.Outpost.Foldout = ICEEditorLayout.Foldout(_control.Creature.Missions.Outpost.Foldout, "Outpost Mission"); if (ICEEditorLayout.SaveButton()) { CreatureEditorIO.SaveMissionOutpostToFile(_control.Creature.Missions.Outpost, _control.gameObject.name); } if (ICEEditorLayout.LoadButton()) { _control.Creature.Missions.Outpost = CreatureEditorIO.LoadMissionOutpostFromFile(_control.Creature.Missions.Outpost); } if (ICEEditorLayout.ResetButton()) { _control.Creature.Missions.Outpost = new OutpostObject(); } _control.Creature.Missions.Outpost.Enabled = ICEEditorLayout.EnableButton(_control.Creature.Missions.Outpost.Enabled); ICEEditorLayout.EndHorizontal(Info.MISSION_OUTPOST); //HEADER END if (!_control.Creature.Missions.Outpost.Foldout) { return; } EditorGUI.BeginDisabledGroup(_control.Creature.Missions.Outpost.Enabled == false); EditorGUI.indentLevel++; TargetEditor.DrawMissionTarget(_control, _control.Creature.Missions.Outpost.Target, "Target", Info.MISSION_OUTPOST_TARGET); EditorGUI.BeginDisabledGroup(_control.Creature.Missions.Outpost.Target.TargetGameObject == null); _control.Creature.Missions.Outpost.BehaviourFoldout = ICEEditorLayout.Foldout(_control.Creature.Missions.Outpost.BehaviourFoldout, "Behaviour", Info.MISSION_OUTPOST_BEHAVIOR, true); if (_control.Creature.Missions.Outpost.BehaviourFoldout) { _control.Creature.Missions.Outpost.BehaviourModeTravel = BehaviourEditor.BehaviourSelect(_control, "Travel", "Move behaviour to reach the Outpost", _control.Creature.Missions.Outpost.BehaviourModeTravel, "OUTPOST_TRAVEL"); _control.Creature.Missions.Outpost.BehaviourModeRendezvous = BehaviourEditor.BehaviourSelect(_control, "Rendezvous", "Idle behaviour after reaching the current target move position.", _control.Creature.Missions.Outpost.BehaviourModeRendezvous, "OUTPOST_RENDEZVOUS"); if (_control.Creature.Missions.Outpost.Target.Move.HasRandomRange) { _control.Creature.Missions.Outpost.BehaviourModeLeisure = BehaviourEditor.BehaviourSelect(_control, "Leisure", "Randomized leisure activities around the Outpost", _control.Creature.Missions.Outpost.BehaviourModeLeisure, "OUTPOST_LEISURE"); } } EditorGUI.EndDisabledGroup(); EditorGUI.indentLevel--; EditorGUI.EndDisabledGroup(); EditorGUILayout.Separator(); }
private static void DrawMissionEscort(ICECreatureControl _control) { ICEEditorStyle.SplitterByIndent(EditorGUI.indentLevel); //HEADER BEGIN ICEEditorLayout.BeginHorizontal(); _control.Creature.Missions.Escort.Foldout = ICEEditorLayout.Foldout(_control.Creature.Missions.Escort.Foldout, "Escort Mission"); if (ICEEditorLayout.SaveButton()) { CreatureEditorIO.SaveMissionEscortToFile(_control.Creature.Missions.Escort, _control.gameObject.name); } if (ICEEditorLayout.LoadButton()) { _control.Creature.Missions.Escort = CreatureEditorIO.LoadMissionEscortFromFile(_control.Creature.Missions.Escort); } if (ICEEditorLayout.ResetButton()) { _control.Creature.Missions.Escort = new EscortObject(); } _control.Creature.Missions.Escort.Enabled = ICEEditorLayout.EnableButton(_control.Creature.Missions.Escort.Enabled); ICEEditorLayout.EndHorizontal(Info.MISSION_ESCORT); //HEADER END if (!_control.Creature.Missions.Escort.Foldout) { return; } EditorGUI.BeginDisabledGroup(_control.Creature.Missions.Escort.Enabled == false); EditorGUI.indentLevel++; TargetEditor.DrawMissionTarget(_control, _control.Creature.Missions.Escort.Target, "Target", Info.MISSION_ESCORT_TARGET); EditorGUI.BeginDisabledGroup(_control.Creature.Missions.Escort.Target.TargetGameObject == null); _control.Creature.Missions.Escort.BehaviourFoldout = ICEEditorLayout.Foldout(_control.Creature.Missions.Escort.BehaviourFoldout, "Behaviour", Info.MISSION_ESCORT_BEHAVIOUR, true); if (_control.Creature.Missions.Escort.BehaviourFoldout) { _control.Creature.Missions.Escort.BehaviourModeFollow = BehaviourEditor.BehaviourSelect(_control, "Follow", "Move behaviour to follow and reach the leader", _control.Creature.Missions.Escort.BehaviourModeFollow, "ESCORT_FOLLOW"); _control.Creature.Missions.Escort.BehaviourModeEscort = BehaviourEditor.BehaviourSelect(_control, "Escort", "Move behaviour to escort the leader", _control.Creature.Missions.Escort.BehaviourModeEscort, "ESCORT"); _control.Creature.Missions.Escort.BehaviourModeStandby = BehaviourEditor.BehaviourSelect(_control, "Standby", "Idle behaviour if the leader stops", _control.Creature.Missions.Escort.BehaviourModeStandby, "ESCORT_STANDBY"); EditorGUI.indentLevel++; _control.Creature.Missions.Escort.DurationStandby = ICEEditorLayout.Slider("Duration (until IDLE)", "", _control.Creature.Missions.Escort.DurationStandby, 1, 0, 60); EditorGUI.indentLevel--; _control.Creature.Missions.Escort.BehaviourModeIdle = BehaviourEditor.BehaviourSelect(_control, "Idle", "Idle behaviour if the leader breaks for a longer time-span", _control.Creature.Missions.Escort.BehaviourModeIdle, "ESCORT_IDLE"); } EditorGUI.EndDisabledGroup(); EditorGUI.indentLevel--; EditorGUI.EndDisabledGroup(); EditorGUILayout.Separator(); }
/// <summary> /// Handles the behaviour settings. /// </summary> public static void Print(ICECreatureControl _control) { if (!_control.Display.ShowBehaviour) { return; } ICEEditorStyle.SplitterByIndent(0); ICEEditorLayout.BeginHorizontal(); _control.Display.FoldoutBehaviours = ICEEditorLayout.Foldout(_control.Display.FoldoutBehaviours, "Behaviours"); if (ICEEditorLayout.SaveButton("Saves behaviours to file")) { CreatureEditorIO.SaveBehaviourToFile(_control.Creature.Behaviour, _control.gameObject.name); } if (ICEEditorLayout.LoadButton("Loads behavious form file")) { _control.Creature.Behaviour = CreatureEditorIO.LoadBehaviourFromFile(_control.Creature.Behaviour); } if (ICEEditorLayout.ResetButton("Removes all behaviours")) { _control.Creature.Behaviour.Reset(); } ICEEditorLayout.ListFoldoutButtons(_control.Creature.Behaviour.BehaviourModes); ICEEditorLayout.EndHorizontal(Info.BEHAVIOUR); if (_control.Display.FoldoutBehaviours == false) { return; } EditorGUI.indentLevel++; for (int i = 0; i < _control.Creature.Behaviour.BehaviourModes.Count; i++) { if (DrawBehaviourMode(_control, _control.Creature.Behaviour.BehaviourModes[i])) { return; } } EditorGUI.indentLevel--; m_BehaviourKey = (!SystemTools.IsValid(m_BehaviourKey) ? "NEW" : m_BehaviourKey); if (ICEEditorLayout.DrawListAddLine("Add behaviour mode by key", ref m_BehaviourKey)) { _control.Creature.Behaviour.AddBehaviourModeNumbered(m_BehaviourKey); m_BehaviourKey = ""; } }
public static void Print(ICECreatureControl _creature_control) { if (!_creature_control.Display.ShowEssentials) { return; } ICEEditorStyle.SplitterByIndent(0); _creature_control.Display.FoldoutEssentials = ICEEditorLayout.Foldout(_creature_control.Display.FoldoutEssentials, "Essentials", Info.ESSENTIALS); if (!_creature_control.Display.FoldoutEssentials) { return; } HandleEssentialSettings(_creature_control); HandleSystemSettings(_creature_control); }
public static void Print(ICECreatureControl _control) { if (!_control.Display.ShowEnvironment) { return; } string _surfaces = _control.Creature.Environment.SurfaceHandler.Surfaces.Count.ToString(); string _impacts = _control.Creature.Environment.CollisionHandler.Collisions.Count.ToString(); ICEEditorStyle.SplitterByIndent(0); ICEEditorLayout.BeginHorizontal(); _control.Display.FoldoutEnvironment = ICEEditorLayout.Foldout(_control.Display.FoldoutEnvironment, "Environment (" + _surfaces + "/" + _impacts + ")"); if (ICEEditorLayout.SaveButton("")) { CreatureEditorIO.SaveEnvironmentToFile(_control.Creature.Environment, _control.gameObject.name); } if (ICEEditorLayout.LoadButton("")) { _control.Creature.Environment = CreatureEditorIO.LoadEnvironmentFromFile(_control.Creature.Environment); } if (ICEEditorLayout.ResetButton("")) { _control.Creature.Environment.Reset(); } ICEEditorLayout.EndHorizontal(Info.ENVIROMENT); if (!_control.Display.FoldoutEnvironment) { return; } EditorGUILayout.Separator(); EditorGUI.indentLevel++; DrawEnvironmentSurfaceSettings(_control); DrawEnvironmentCollisionSettings(_control); EditorGUI.indentLevel--; EditorGUILayout.Separator(); }
public static void Print(ICECreatureRegister _register) { EditorGUILayout.Separator(); m_foldout = ICEEditorLayout.Foldout(m_foldout, "Options", Info.REGISTER_OPTIONS); if (!m_foldout) { return; } EditorGUILayout.Separator(); EditorGUI.indentLevel++; _register.Options.Enabled = true; CreatureObjectEditor.DrawRegisterDefaultSettings(_register, _register.Options, EditorHeaderType.FOLDOUT_BOLD); CreatureObjectEditor.DrawHierarchyManagementObject(_register, _register.HierarchyManagement, EditorHeaderType.FOLDOUT_ENABLED_BOLD); CreatureObjectEditor.DrawRegisterDebugObject(_register, _register.RegisterDebug, EditorHeaderType.FOLDOUT_ENABLED_BOLD); EditorGUILayout.Separator(); _register.UseDontDestroyOnLoad = ICEEditorLayout.Toggle("Don't Destroy On Load", "", _register.UseDontDestroyOnLoad, Info.REGISTER_OPTIONS_DONTDESTROYONLOAD); _register.UsePoolManagementCoroutine = ICEEditorLayout.Toggle("Use Pool Management Coroutine", "Use coroutine for pool management", _register.UsePoolManagementCoroutine, Info.REGISTER_OPTIONS_POOL_MANAGEMENT_COROUTINE); _register.UseGarbageCollection = ICEEditorLayout.Toggle("Custom Garbage Collection", "", _register.UseGarbageCollection, Info.REGISTER_OPTIONS_CUSTOM_GARBAGE_COLLECTION); if (_register.UseGarbageCollection) { EditorGUI.indentLevel++; _register.GarbageCollectionInterval = ICEEditorLayout.DefaultSlider("Interval", "", _register.GarbageCollectionInterval, Init.DECIMAL_PRECISION_TIMER, 0, 10, 3, ""); EditorGUI.indentLevel--; } _register.RandomSeed = (RandomSeedType)ICEEditorLayout.EnumPopup("Random Seed", "Sets the seed for the random number generator.", _register.RandomSeed, Info.REGISTER_OPTIONS_RANDOMSEED); if (_register.RandomSeed == RandomSeedType.CUSTOM) { EditorGUI.indentLevel++; _register.CustomRandomSeed = ICEEditorLayout.IntField("Seed Value", "Custom RandomSeed Integer Value", _register.CustomRandomSeed, Info.REGISTER_OPTIONS_RANDOMSEED_CUSTOM); EditorGUI.indentLevel--; EditorGUILayout.Separator(); } EditorGUI.indentLevel--; EditorGUILayout.Separator(); ICEEditorStyle.SplitterByIndent(0); }
public static void Print(ICECreatureControl _control) { if (!_control.Display.ShowStatus) { return; } ICEEditorStyle.SplitterByIndent(0); ICEEditorLayout.BeginHorizontal(); _control.Display.FoldoutStatus = ICEEditorLayout.Foldout(_control.Display.FoldoutStatus, "Status"); if (ICEEditorLayout.SaveButton()) { CreatureEditorIO.SaveStatusToFile(_control.Creature.Status, _control.gameObject.name); } if (ICEEditorLayout.LoadButton()) { _control.Creature.Status = CreatureEditorIO.LoadStatusFromFile(_control.Creature.Status); } if (ICEEditorLayout.ResetButton()) { _control.Creature.Status.ResetDefaultValues(); } ICEEditorLayout.EndHorizontal(Info.STATUS); if (_control.Display.FoldoutStatus) { EditorGUILayout.Separator(); DrawStatus(_control); DrawStatusBasics(_control); DrawStatusAdvanced(_control); DrawStatusCorpse(_control); DrawStatusSensoria(_control); DrawStatusMemory(_control); DrawStatusInventory(_control); EditorGUILayout.Separator(); } }
public static void Print(ICECreatureControl _control) { if (!_control.Display.ShowEnvironmentSettings) { return; } string _surfaces = _control.Creature.Environment.SurfaceHandler.Surfaces.Count.ToString(); string _impacts = _control.Creature.Environment.CollisionHandler.Collisions.Count.ToString(); ICEEditorStyle.SplitterByIndent(0); _control.Display.FoldoutEnvironment = ICEEditorLayout.Foldout(_control.Display.FoldoutEnvironment, "Environment (" + _surfaces + "/" + _impacts + ")", Info.ENVIROMENT); if (!_control.Display.FoldoutEnvironment) { return; } EditorGUILayout.Separator(); DrawEnvironmentSurfaceSettings(_control); DrawEnvironmentCollisionSettings(_control); EditorGUILayout.Separator(); }
public static void Print(ICECreatureControl _control) { if (!_control.Display.ShowStatus) { return; } ICEEditorStyle.SplitterByIndent(0); ICEEditorLayout.BeginHorizontal(); _control.Display.FoldoutStatus = ICEEditorLayout.Foldout(_control.Display.FoldoutStatus, "Status"); if (GUILayout.Button("SAVE", ICEEditorStyle.ButtonMiddle)) { CreatureIO.SaveStatusToFile(_control.Creature.Status, _control.gameObject.name); } if (GUILayout.Button("LOAD", ICEEditorStyle.ButtonMiddle)) { _control.Creature.Status = CreatureIO.LoadStatusFromFile(_control.Creature.Status); } if (GUILayout.Button("RESET", ICEEditorStyle.ButtonMiddle)) { ResetValues(_control); } ICEEditorLayout.EndHorizontal(Info.STATUS); if (_control.Display.FoldoutStatus) { EditorGUILayout.Separator(); DrawStatus(_control); DrawStatusBasics(_control); DrawStatusAdvanced(_control); DrawStatusInfluences(_control); EditorGUILayout.Separator(); } }
public static void Print(ICECreatureControl _control) { if (m_creature_register == null) { m_creature_register = ICECreatureRegister.Instance; } if (m_creature_register == null) { return; } if (!_control.Display.ShowInteraction) { return; } ICEEditorStyle.SplitterByIndent(0); ICEEditorLayout.BeginHorizontal(); _control.Display.FoldoutInteraction = ICEEditorLayout.Foldout(_control.Display.FoldoutInteraction, "Interaction"); if (ICEEditorLayout.SaveButton("Saves the complete interaction settings to file")) { CreatureEditorIO.SaveInteractionToFile(_control.Creature.Interaction, _control.gameObject.name); } if (ICEEditorLayout.LoadButton("Loads existing interaction settings form file")) { _control.Creature.Interaction = CreatureEditorIO.LoadInteractionFromFile(_control.Creature.Interaction); } if (ICEEditorLayout.ResetButton("Removes all interaction settings")) { _control.Creature.Interaction.Reset(); } // GUILayout.Space( 5 ); //if( ICEEditorLayout.ListDeleteButton<InteractorObject>( _control.Creature.Interaction.Interactors, _waypoint ) ) // return true; GUILayout.Space(5); InteractorFoldoutButtons(_control.Creature.Interaction.Interactors); ICEEditorLayout.EndHorizontal(Info.INTERACTION); if (!_control.Display.FoldoutInteraction) { return; } EditorGUILayout.Separator(); EditorGUI.indentLevel++; for (int _interactor_index = 0; _interactor_index < _control.Creature.Interaction.Interactors.Count; ++_interactor_index) { if (DrawInteractor(_control, _control.Creature.Interaction, _interactor_index)) { return; } } EditorGUI.indentLevel--; string _tmp_title = "Add Interactor"; ICEEditorLayout.DrawListAddLine <InteractorObject>(_control.Creature.Interaction.Interactors, new InteractorObject(), _tmp_title); }
/// <summary> /// /// </summary> void OnGUI() { if (m_ICECCLogo == null) { m_ICECCLogo = (Texture2D)Resources.Load("ICECC_LOGO", typeof(Texture2D)); } if (m_ICELogo == null) { m_ICELogo = (Texture2D)Resources.Load("ICE_LOGO", typeof(Texture2D)); } if (m_ICECCLogo != null) { GUI.DrawTexture(new Rect(10, 10, m_ICECCLogo.width, m_ICECCLogo.height), m_ICECCLogo); } GUILayout.BeginArea(new Rect(20, 150, Screen.width - 40, Screen.height - 40)); GUILayout.Label("3RD PARTY ASSETS", EditorStyles.boldLabel); GUILayout.Label("To provide nice looking and helpful demo scenes your ICE package contains additional " + "content of external parties, according to the given licence regulations and/or the explicit permission " + "of the author. Here I would like to thanks all these creative people for their contribution and want " + "point you to their original sources.\n", EditorStyles.wordWrappedLabel); if (ICEEditorLayout.Button("3D Models/Characters/Animals - Cute Kitten by leshiy3d", "", ICEEditorStyle.LinkStyle)) { Application.OpenURL("https://www.assetstore.unity3d.com/en/#!/content/33121"); } //if( ICEEditorLayout.Button( "3D Models/Characters/Humanoids - Overlord and more by 3DMaesen", "", ICEEditorStyle.LinkStyle)) { Application.OpenURL("https://www.assetstore.unity3d.com/en/#!/content/48768"); } if (ICEEditorLayout.Button("3D Models/Vegetation/Trees - Mobile Tree Package by Laxer", "", ICEEditorStyle.LinkStyle)) { Application.OpenURL("https://www.assetstore.unity3d.com/en/#!/content/18866"); } if (ICEEditorLayout.Button("3D Models/Environments - Campfire by David Stenfors", "", ICEEditorStyle.LinkStyle)) { Application.OpenURL("https://www.assetstore.unity3d.com/en/#!/content/45038"); } if (ICEEditorLayout.Button("Unity Essentials/Sample Projects - Teddy and more by UNITY", "", ICEEditorStyle.LinkStyle)) { Application.OpenURL("https://www.assetstore.unity3d.com/en/#!/content/5328"); } if (ICEEditorLayout.Button("Opengameart.org - MuzzleFlash by Julius Krischan", "", ICEEditorStyle.LinkStyle)) { Application.OpenURL("http://opengameart.org/content/muzzle-flash-with-model"); } if (ICEEditorLayout.Button("Textures.com - Diverse ground and nature textures", "", ICEEditorStyle.LinkStyle)) { Application.OpenURL("www.textures.com"); } if (ICEEditorLayout.Button("Freesound.org - Footsteps by OwlStorm", "", ICEEditorStyle.LinkStyle)) { Application.OpenURL("https://www.freesound.org/people/OwlStorm/packs/9344/"); } GUILayout.Label("\nAlso I would like to thanks all the countless authors who supports all of us with their " + "experience, helpful code snippets and practical approaches, without such unselfish inputs the internet " + "would be significantly poorer.", EditorStyles.wordWrappedLabel); GUILayout.Label("\nLast but not least, I would like to mention also the ICE community which supports and inspires " + "me with great suggestions and ideas. Thanks so much!\n", EditorStyles.wordWrappedLabel); if (ICEEditorLayout.Button("ICE Creature Control - Forum", "", ICEEditorStyle.LinkStyle)) { Application.OpenURL("http://forum.unity3d.com/threads/347147/"); } GUILayout.EndArea(); GUILayout.BeginArea(new Rect(20, m_DialogSize.y - 85, Screen.width - 40, Screen.height - 40)); GUI.backgroundColor = Color.clear; if (ICEEditorLayout.Button("Contact Pit Vetterick (Skype:pit.vetterick)", "", ICEEditorStyle.GetLinkStyle(Color.grey))) { Application.OpenURL("skype:pit.vetterick?add"); } if (ICEEditorLayout.Button("https://twitter.com/CreatureAI", "", ICEEditorStyle.GetLinkStyle(Color.grey))) { Application.OpenURL("https://twitter.com/CreatureAI"); } if (ICEEditorLayout.Button("http://www.icecreaturecontrol.com", "", ICEEditorStyle.GetLinkStyle(Color.grey))) { Application.OpenURL("http://www.icecreaturecontrol.com"); } GUI.color = ICEEditorLayout.DefaultGUIColor; GUI.backgroundColor = ICEEditorLayout.DefaultBackgroundColor; EditorGUILayout.Separator(); GUILayout.Label(m_Copyright + " - " + m_Version, EditorStyles.centeredGreyMiniLabel); GUILayout.EndArea(); if (m_ICELogo != null) { GUI.DrawTexture(new Rect(270, m_DialogSize.y - 90, m_ICELogo.width, m_ICELogo.height), m_ICELogo); } }
public override void OnInspectorGUI() { GUI.changed = false; EditorGUILayout.Separator(); EditorGUI.indentLevel++; m_foldout_options = EditorGUILayout.Foldout(m_foldout_options, "Options", ICEEditorStyle.Foldout); if (m_foldout_options) { EditorGUI.indentLevel++; m_creature_register.UsePoolManagenent = ICEEditorLayout.Toggle("Use Pool Managenent", "", m_creature_register.UsePoolManagenent); EditorGUI.BeginDisabledGroup(m_creature_register.UsePoolManagenent == false); m_creature_register.GroundCheck = (GroundCheckType)ICEEditorLayout.EnumPopup("Spawn Ground Check", "", m_creature_register.GroundCheck); if (m_creature_register.GroundCheck == GroundCheckType.RAYCAST) { EditorGUI.indentLevel++; m_creature_register.GroundLayerMask = EditorGUILayout.LayerField("Ground Layer", m_creature_register.GroundLayerMask); EditorGUI.indentLevel--; } EditorGUI.EndDisabledGroup(); EditorGUILayout.Separator(); m_creature_register.RandomSeed = (RandomSeedType)ICEEditorLayout.EnumPopup("Random Seed", "", m_creature_register.RandomSeed); if (m_creature_register.RandomSeed == RandomSeedType.CUSTOM) { EditorGUI.indentLevel++; m_creature_register.CustomRandomSeed = ICEEditorLayout.IntField("Seed Value", "Custom RandomSeed Integer Value", m_creature_register.CustomRandomSeed); EditorGUI.indentLevel--; EditorGUILayout.Separator(); } m_creature_register.UseEnvironmentManagenent = ICEEditorLayout.Toggle("Handle Environment", "", m_creature_register.UseEnvironmentManagenent); if (m_creature_register.UseEnvironmentManagenent) { EditorGUI.indentLevel++; m_creature_register.EnvironmentInfos.UpdateTemperatureScale((TemperatureScaleType)ICEEditorLayout.EnumPopup("Temperature Scale", "", m_creature_register.EnvironmentInfos.TemperatureScale)); EditorGUI.indentLevel++; m_creature_register.EnvironmentInfos.MinTemperature = EditorGUILayout.FloatField("Min. Temperature", m_creature_register.EnvironmentInfos.MinTemperature); m_creature_register.EnvironmentInfos.MaxTemperature = EditorGUILayout.FloatField("Max. Temperature", m_creature_register.EnvironmentInfos.MaxTemperature); EditorGUI.indentLevel--; m_creature_register.EnvironmentInfos.Temperature = ICEEditorLayout.Slider("Temperature", "", m_creature_register.EnvironmentInfos.Temperature, 1, m_creature_register.EnvironmentInfos.MinTemperature, m_creature_register.EnvironmentInfos.MaxTemperature); EditorGUI.indentLevel--; EditorGUILayout.Separator(); } m_creature_register.UseDontDestroyOnLoad = ICEEditorLayout.Toggle("Dont Destroy On Load", "", m_creature_register.UseDontDestroyOnLoad); EditorGUI.indentLevel--; EditorGUILayout.Separator(); } ICEEditorLayout.BeginHorizontal(); m_foldout_register = EditorGUILayout.Foldout(m_foldout_register, "Reference Creatures", ICEEditorStyle.Foldout); if (m_foldout_register) { if (GUILayout.Button("SCAN", ICEEditorStyle.ButtonMiddle)) { m_creature_register.Scan(); } } ICEEditorLayout.EndHorizontal(); if (m_foldout_register) { EditorGUILayout.Separator(); for (int i = 0; i < m_creature_register.ReferenceCreatures.Count; i++) { CreatureReferenceObject _obj = m_creature_register.ReferenceCreatures[i]; UpdateCreatureStatus(_obj); if (_obj != null && _obj.Creature != null) { string _title = _obj.Name; if (m_creature_register.UsePoolManagenent) { ICEEditorLayout.Label(_title, true); _title = "Reference Object"; EditorGUI.indentLevel++; EditorGUILayout.Separator(); } ICEEditorLayout.BeginHorizontal(); _obj.Creature = (GameObject)EditorGUILayout.ObjectField(_title, _obj.Creature, typeof(GameObject), true); if (_obj.Controller != null) { if (GUILayout.Button("SELECT", ICEEditorStyle.ButtonMiddle)) { Selection.activeGameObject = _obj.Creature; } } else { if (GUILayout.Button("ADD CC", ICEEditorStyle.ButtonMiddle)) { _obj.Creature.AddComponent <ICECreatureControl>(); } } if (m_creature_register.UsePoolManagenent) { if (_obj.PoolManagementEnabled) { GUI.backgroundColor = Color.yellow; } if (GUILayout.Button("POOL", ICEEditorStyle.ButtonMiddle)) { _obj.PoolManagementEnabled = !_obj.PoolManagementEnabled; } GUI.backgroundColor = ICEEditorLayout.DefaultBackgroundColor; } if (GUILayout.Button("x", ICEEditorStyle.CMDButton)) { m_creature_register.ReferenceCreatures.Remove(_obj); i--; } ICEEditorLayout.EndHorizontal(); string[] _flags = new string[10]; // CC controlled if (_obj.Status.HasCreatureController) { _flags[0] = "icons/cc_1"; } else if (_obj.Status.HasCreatureAdapter) { _flags[0] = "icons/failed"; } else { _flags[0] = "icons/failed"; } if (_obj.Status.HasHome) { _flags[1] = "icons/home_ready"; } else { _flags[1] = "icons/home_failed"; } if (_obj.Status.HasMissionOutpost) { _flags[2] = "icons/cc_1"; } else { _flags[2] = "icons/failed"; } if (_obj.Status.HasMissionEscort) { _flags[3] = "icons/cc_1"; } else { _flags[3] = "icons/failed"; } if (_obj.Status.HasMissionPatrol) { _flags[4] = "icons/cc_1"; } else { _flags[4] = "icons/failed"; } if (_obj.Status.isActiveAndEnabled) { _flags[5] = "icons/cc_1"; } else { _flags[5] = "icons/failed"; } if (_obj.Status.isActiveInHierarchy) { _flags[6] = "icons/cc_1"; } else { _flags[6] = "icons/failed"; } if (_obj.Status.isPrefab) { _flags[7] = "icons/cc_1"; } else { _flags[7] = "icons/failed"; } if (m_creature_register.UsePoolManagenent) { //EditorGUILayout.Separator(); //ICEEditorLayout.DrawLabelIconBar( "Status", _flags, 16, 16, 0,0,5); //EditorGUILayout.Separator(); EditorGUI.BeginDisabledGroup(_obj.PoolManagementEnabled == false); _obj.MaxCreatures = (int)ICEEditorLayout.Slider("Max. Creatures (" + _obj.CreaturesCount + ")", "", _obj.MaxCreatures, 1, 0, 250); //EditorGUILayout.Separator(); ICEEditorLayout.Label("Spawn Interval (cur. " + ((int)(_obj.RespawnInterval / 0.25f + 0.5f) * 0.25f) + " secs.)", false); EditorGUI.indentLevel++; _obj.MinRespawnInterval = (int)ICEEditorLayout.Slider("Min. Spawn Interval", "", _obj.MinRespawnInterval, 1, 1, _obj.MaxRespawnInterval); _obj.MaxRespawnInterval = (int)ICEEditorLayout.Slider("Max. Spawn Interval", "", _obj.MaxRespawnInterval, 1, _obj.MinRespawnInterval, 360); EditorGUI.indentLevel--; EditorGUILayout.Separator(); _obj.UseRandomScale = EditorGUILayout.Toggle("Random Scale", _obj.UseRandomScale); EditorGUI.BeginDisabledGroup(_obj.UseRandomScale == false); EditorGUI.indentLevel++; bool _auto = false; _obj.UseRandomScaleMultiplier = ICEEditorLayout.AutoSlider("Scale Multiplier", "", _obj.UseRandomScaleMultiplier, 0.01f, 0, 1, ref _auto, 0.5f); if (_auto) { _obj.UseRandomScaleMultiplier = (float)Random.Range(0, 100) / 100; } /* * _obj.RandomScaleMin = EditorGUILayout.FloatField( "Min. Scale", _obj.RandomScaleMin ) ; * _obj.RandomScaleMax = EditorGUILayout.FloatField( "Min. Scale", _obj.RandomScaleMax ) ;*/ EditorGUI.indentLevel--; EditorGUI.EndDisabledGroup(); EditorGUILayout.Separator(); _obj.UseSoftRespawn = EditorGUILayout.Toggle("Soft Respawn", _obj.UseSoftRespawn); _obj.UseGroupObject = EditorGUILayout.Toggle("Use Group", _obj.UseGroupObject); EditorGUI.EndDisabledGroup(); EditorGUI.indentLevel--; EditorGUILayout.Separator(); } } else { m_creature_register.ReferenceCreatures.RemoveAt(i); i--; } } } EditorGUILayout.Separator(); ICEEditorStyle.SplitterByIndent(EditorGUI.indentLevel); ICEEditorLayout.BeginHorizontal(); GameObject _new = (GameObject)EditorGUILayout.ObjectField("Add Creature", null, typeof(GameObject), true); if (_new != null) { m_creature_register.AddReferenceCreature(_new); } ICEEditorLayout.EndHorizontal(); EditorGUI.indentLevel--; EditorGUILayout.Separator(); if (GUI.changed) { EditorUtility.SetDirty(m_creature_register); } }
private static void DrawEnvironmentCollisionSettings(ICECreatureControl _control) { // IMPACT HEADER BEGIN ICEEditorLayout.BeginHorizontal(); EditorGUI.BeginDisabledGroup(_control.Creature.Environment.CollisionHandler.Enabled == false); WorldObjectEditor.DrawObjectHeaderLine(ref _control.Creature.Environment.CollisionHandler.Enabled, ref _control.Creature.Environment.CollisionHandler.Foldout, EditorHeaderType.FOLDOUT_BOLD, "Collisions", ""); _control.Creature.Environment.CollisionHandler.AllowChildCollisions = ICEEditorLayout.CheckButtonSmall("ACC", "Allow Child Collisions", _control.Creature.Environment.CollisionHandler.AllowChildCollisions); _control.Creature.Environment.CollisionHandler.UseCollider = ICEEditorLayout.CheckButtonSmall("COL", "Use Collider events", _control.Creature.Environment.CollisionHandler.UseCollider); _control.Creature.Environment.CollisionHandler.UseTrigger = ICEEditorLayout.CheckButtonSmall("TRI", "Use Trigger events", _control.Creature.Environment.CollisionHandler.UseTrigger); EditorGUI.BeginDisabledGroup(_control.GetComponent <CharacterController>() == null); _control.Creature.Environment.CollisionHandler.UseCharacterController = ICEEditorLayout.CheckButtonSmall("CON", "Use CharacterController events", _control.Creature.Environment.CollisionHandler.UseCharacterController); EditorGUI.EndDisabledGroup(); GUILayout.Space(5); EditorGUI.EndDisabledGroup(); if (ICEEditorLayout.AddButton("Adds a new collision rule")) { _control.Creature.Environment.CollisionHandler.Collisions.Add(new CollisionDataObject()); _control.Creature.Environment.CollisionHandler.Enabled = true; } if (ICEEditorLayout.SaveButton("Saves collision data to file")) { CreatureEditorIO.SaveEnvironmentCollisionToFile(_control.Creature.Environment.CollisionHandler, _control.gameObject.name); } if (ICEEditorLayout.LoadButton("Loads collision data to file")) { _control.Creature.Environment.CollisionHandler = CreatureEditorIO.LoadEnvironmentCollisionFromFile(_control.Creature.Environment.CollisionHandler); } if (ICEEditorLayout.ResetButton("Resets the collision data")) { _control.Creature.Environment.CollisionHandler.Reset(); } _control.Creature.Environment.CollisionHandler.Enabled = ICEEditorLayout.EnableButton(_control.Creature.Environment.CollisionHandler.Enabled); ICEEditorLayout.EndHorizontal(Info.ENVIROMENT_COLLISION); // IMPACT HEADER END if (_control.Creature.Environment.CollisionHandler.Enabled == true && _control.Creature.Environment.CollisionHandler.Collisions.Count == 0) { _control.Creature.Environment.CollisionHandler.Collisions.Add(new CollisionDataObject()); _control.Creature.Environment.CollisionHandler.Foldout = true; } // CONTENT BEGIN if (WorldObjectEditor.BeginObjectContentOrReturn(EditorHeaderType.FOLDOUT_BOLD, _control.Creature.Environment.CollisionHandler)) { return; } for (int i = 0; i < _control.Creature.Environment.CollisionHandler.Collisions.Count; i++) { CollisionDataObject _collision = _control.Creature.Environment.CollisionHandler.Collisions[i]; if (_collision != null) { if (_collision.Name.Trim() == "") { _collision.Name = "Collision Rule #" + (i + 1); } // IMPACT RULE HEADER BEGIN ICEEditorLayout.BeginHorizontal(); EditorGUI.BeginDisabledGroup(_collision.Enabled == false); _collision.Foldout = ICEEditorLayout.Foldout(_collision.Foldout, _collision.Name); EditorGUI.EndDisabledGroup(); if (ICEEditorLayout.ListDeleteButton <CollisionDataObject>(_control.Creature.Environment.CollisionHandler.Collisions, _collision, "Removes the selected collision rule")) { if (_control.Creature.Environment.CollisionHandler.Collisions.Count == 0) { _control.Creature.Environment.CollisionHandler.Enabled = false; } return; } GUILayout.Space(5); if (ICEEditorLayout.ListUpDownButtons <CollisionDataObject>(_control.Creature.Environment.CollisionHandler.Collisions, i)) { return; } _collision.Enabled = ICEEditorLayout.EnableButton("Activates/deactivates the selected collision rule", _collision.Enabled); ICEEditorLayout.EndHorizontal(Info.ENVIROMENT_COLLISION_RULE); // IMPACT RULE HEADER END // IMPACT RULE CONTENT BEGIN if (_collision.Foldout) { EditorGUI.BeginDisabledGroup(_collision.Enabled == false); ICEEditorLayout.BeginHorizontal(); _collision.Name = ICEEditorLayout.Text("Name", "", _collision.Name); if (ICEEditorLayout.ResetButtonSmall()) { _collision.Name = ""; } ICEEditorLayout.EndHorizontal(Info.ENVIROMENT_COLLISION_RULE_NAME); EditorGUILayout.Separator(); ICEEditorLayout.BeginHorizontal(); ICEEditorLayout.Label("Conditions", true); _collision.UseTag = ICEEditorLayout.CheckButtonMiddle("TAG", "", _collision.UseTag); _collision.UseLayer = ICEEditorLayout.CheckButtonMiddle("LAYER", "", _collision.UseLayer); _collision.UseBodyPart = ICEEditorLayout.CheckButtonMiddle("COLLIDER", "", _collision.UseBodyPart); ICEEditorLayout.EndHorizontal(Info.ENVIROMENT_COLLISION_RULE_CONDITIONS); EditorGUI.indentLevel++; if (_collision.UseLayer) { _collision.Layer = ICEEditorLayout.Layer("Layer", "Desired collision layer", _collision.Layer, Info.ENVIROMENT_COLLISION_RULE_LAYER); } if (_collision.UseTag) { _collision.Tag = ICEEditorLayout.Tag("Tag", "Desired collision tag", _collision.Tag, Info.ENVIROMENT_COLLISION_RULE_TAG); } if (_collision.UseBodyPart) { _collision.BodyPart = ICEEditorLayout.ColliderPopup(_control.gameObject, "Body Part", "Desired body part", _collision.BodyPart, Info.ENVIROMENT_COLLISION_RULE_BODYPART); } EditorGUI.indentLevel--; EditorGUILayout.Separator(); ICEEditorLayout.Label("Procedures", true, Info.ENVIROMENT_COLLISION_RULE_PROCEDURES); EditorGUI.indentLevel++; _collision.UseBehaviourModeKey = ICEEditorLayout.Toggle("Behaviour", "", _collision.UseBehaviourModeKey, Info.ENVIROMENT_COLLISION_BEHAVIOUR); if (_collision.UseBehaviourModeKey) { EditorGUI.indentLevel++; _collision.BehaviourModeKey = BehaviourEditor.BehaviourSelect(_control, "Behaviour", "Reaction to this impact", _collision.BehaviourModeKey, "COLLISION_" + _collision.Name.ToUpper(), Info.ENVIROMENT_COLLISION_BEHAVIOUR); EditorGUI.indentLevel--; } EditorHeaderType _header = EditorHeaderType.TOGGLE; CreatureObjectEditor.DrawInfluenceObject(_collision.Influences, _header, _control.Creature.Status.UseAdvanced, _control.Creature.Status.InitialDurabilityMax, Info.ENVIROMENT_COLLISION_INFLUENCES); //CreatureObjectEditor.DrawAudioObject( _collision.Audio, _header, Info.ENVIROMENT_COLLISION_AUDIO ); //CreatureObjectEditor.DrawEffectObject( _control, _collision.Effect, _header, Info.ENVIROMENT_COLLISION_EFFECT ); //_impact.ForceInteraction = EditorGUILayout.Toggle("Force Interaction", _impact.ForceInteraction ); EditorGUI.indentLevel--; EditorGUILayout.Separator(); EditorGUI.EndDisabledGroup(); ICEEditorStyle.SplitterByIndent(EditorGUI.indentLevel + 1); } // IMPACT RULE CONTENT END } } ICEEditorLayout.DrawListAddLine <CollisionDataObject>(_control.Creature.Environment.CollisionHandler.Collisions, new CollisionDataObject(), false, "Add Collision Rule"); WorldObjectEditor.EndObjectContent(); // CONTENT END }
private static void DrawEnvironmentSurfaceSettings(ICECreatureControl _control) { ICEEditorLayout.BeginHorizontal(); EditorGUI.BeginDisabledGroup(_control.Creature.Environment.SurfaceHandler.Enabled == false); WorldObjectEditor.DrawObjectHeaderLine(ref _control.Creature.Environment.SurfaceHandler.Enabled, ref _control.Creature.Environment.SurfaceHandler.Foldout, EditorHeaderType.FOLDOUT_BOLD, "Surfaces", ""); EditorGUI.EndDisabledGroup(); if (ICEEditorLayout.AddButton("Adds a new surface rule")) { _control.Creature.Environment.SurfaceHandler.Surfaces.Add(new SurfaceDataObject()); _control.Creature.Environment.SurfaceHandler.Enabled = true; } if (ICEEditorLayout.SaveButton("Saves surface data to file")) { CreatureEditorIO.SaveEnvironmentSurfaceToFile(_control.Creature.Environment.SurfaceHandler, _control.gameObject.name); } if (ICEEditorLayout.LoadButton("Loads surface data to file")) { _control.Creature.Environment.SurfaceHandler = CreatureEditorIO.LoadEnvironmentSurfaceFromFile(_control.Creature.Environment.SurfaceHandler); } if (ICEEditorLayout.ResetButton("Resets the surface data")) { _control.Creature.Environment.SurfaceHandler.Reset(); } _control.Creature.Environment.SurfaceHandler.Enabled = ICEEditorLayout.EnableButton(_control.Creature.Environment.SurfaceHandler.Enabled); ICEEditorLayout.EndHorizontal(Info.ENVIROMENT_SURFACE); if (_control.Creature.Environment.SurfaceHandler.Enabled == true && _control.Creature.Environment.SurfaceHandler.Surfaces.Count == 0) { _control.Creature.Environment.SurfaceHandler.Surfaces.Add(new SurfaceDataObject()); _control.Creature.Environment.SurfaceHandler.Foldout = true; } // CONTENT BEGIN if (WorldObjectEditor.BeginObjectContentOrReturn(EditorHeaderType.FOLDOUT_BOLD, _control.Creature.Environment.SurfaceHandler)) { return; } _control.Creature.Environment.SurfaceHandler.GroundScanInterval = ICEEditorLayout.MaxDefaultSlider("Ground Scan Interval (secs.)", "Defines the interval for the ground check", _control.Creature.Environment.SurfaceHandler.GroundScanInterval, 0.25f, 0, ref _control.Creature.Environment.SurfaceHandler.GroundScanIntervalMaximum, 1, Info.ENVIROMENT_SURFACE_SCAN_INTERVAL); for (int i = 0; i < _control.Creature.Environment.SurfaceHandler.Surfaces.Count; ++i) { // HEADER BEGIN SurfaceDataObject _surface = _control.Creature.Environment.SurfaceHandler.Surfaces[i]; if (_surface.Name == "") { _surface.Name = "Surface Rule #" + (i + 1); } ICEEditorLayout.BeginHorizontal(); EditorGUI.BeginDisabledGroup(_surface.Enabled == false); _surface.Foldout = ICEEditorLayout.Foldout(_surface.Foldout, _surface.Name); EditorGUI.EndDisabledGroup(); if (ICEEditorLayout.ListDeleteButton <SurfaceDataObject>(_control.Creature.Environment.SurfaceHandler.Surfaces, _surface, "Removes the selected surface rule")) { if (_control.Creature.Environment.SurfaceHandler.Surfaces.Count == 0) { _control.Creature.Environment.SurfaceHandler.Enabled = false; } return; } GUILayout.Space(5); if (ICEEditorLayout.ListUpDownButtons <SurfaceDataObject>(_control.Creature.Environment.SurfaceHandler.Surfaces, i)) { return; } _surface.Enabled = ICEEditorLayout.EnableButton("Activates/deactivates the the selected surfaces rule", _surface.Enabled); ICEEditorLayout.EndHorizontal(Info.ENVIROMENT_SURFACE_RULE); // HEADER END if (_surface.Foldout) { EditorGUI.BeginDisabledGroup(_surface.Enabled == false); ICEEditorLayout.BeginHorizontal(); _surface.Name = ICEEditorLayout.Text("Name", "", _surface.Name); if (ICEEditorLayout.ResetButtonSmall()) { _surface.Name = ""; } ICEEditorLayout.EndHorizontal(Info.ENVIROMENT_SURFACE_RULE_NAME); //_surface.Interval = ICEEditorLayout.DefaultSlider( "Interval", "", _surface.Interval, 0.005f, 0, 30, 1, Info.ENVIROMENT_SURFACE_RULE_INTERVAL ); //ICEEditorStyle.SplitterByIndent( EditorGUI.indentLevel + 1 ); DrawEnvironmentTextures(_surface); ICEEditorLayout.Label("Procedures", true, Info.ENVIROMENT_SURFACE_RULE_PROCEDURES); EditorGUI.indentLevel++; EditorGUI.BeginDisabledGroup(_surface.Textures.Count == 0); _surface.UseBehaviourModeKey = ICEEditorLayout.Toggle("Behaviour", "", _surface.UseBehaviourModeKey, Info.ENVIROMENT_SURFACE_BEHAVIOUR); if (_surface.UseBehaviourModeKey) { EditorGUI.indentLevel++; _surface.BehaviourModeKey = BehaviourEditor.BehaviourSelect(_control, "Behaviour", "Reaction to this impact", _surface.BehaviourModeKey, "SURFACE_" + _surface.Name.ToUpper(), Info.ENVIROMENT_SURFACE_BEHAVIOUR); EditorGUI.indentLevel--; } EditorHeaderType _header = EditorHeaderType.TOGGLE; CreatureObjectEditor.DrawInfluenceObject(_surface.Influences, _header, _control.Creature.Status.UseAdvanced, _control.Creature.Status.InitialDurabilityMax, Info.ENVIROMENT_SURFACE_INFLUENCES); CreatureObjectEditor.DrawFootstepAudioObject(_surface.Footsteps, _header, Info.ENVIROMENT_SURFACE_AUDIO); CreatureObjectEditor.DrawAudioObject(_surface.Audio, _header, Info.ENVIROMENT_SURFACE_AUDIO); CreatureObjectEditor.DrawEffectObject(_control, _surface.Effect, _header, Info.ENVIROMENT_SURFACE_EFFECT); EditorGUI.EndDisabledGroup(); EditorGUI.indentLevel--; EditorGUILayout.Separator(); EditorGUI.EndDisabledGroup(); ICEEditorStyle.SplitterByIndent(EditorGUI.indentLevel + 1); } } ICEEditorLayout.DrawListAddLine <SurfaceDataObject>(_control.Creature.Environment.SurfaceHandler.Surfaces, new SurfaceDataObject(), false, "Add Surface Rule"); WorldObjectEditor.EndObjectContent(); // CONTENT END }
public static void Print(ICECreatureRegister _register) { // HEADER BEGIN ICEEditorLayout.BeginHorizontal(); /*if( _register.UseReferenceCategories ) * ICEEditorLayout.Label( "Reference Objects", true ); * else*/ m_foldout = ICEEditorLayout.Foldout(m_foldout, "Reference Objects"); if (_register.UseReferenceCategories) { int _res_foldout = ICEEditorLayout.ListFoldoutButtons <ReferenceGroupCategory>(_register.ReferenceGroupCategories); if (_res_foldout == 0 || _res_foldout == 1) { foreach (ReferenceGroupCategory _cat in _register.ReferenceGroupCategories) { foreach (ReferenceGroupObject _group in _cat.ReferenceGroupObjects) { _group.Foldout = (_res_foldout == 1 ? true : _res_foldout == 0 ? false : _group.Foldout); } } } } else { ICEEditorLayout.ListFoldoutButtons <ReferenceGroupObject>(_register.ReferenceGroupObjects); } GUILayout.Space(5); _register.BreakAll = ICEEditorLayout.CheckButtonMiddle("BREAK", "Forces an interruption to all objects during runtime", _register.BreakAll); _register.UseReferenceCategories = ICEEditorLayout.CheckButtonMiddle("GROUPS", "Displays all reference objects in their respective entity groups.", _register.UseReferenceCategories); _register.UsePoolManagement = ICEEditorLayout.CheckButtonMiddle("POOL", "Activates/deactivates the Pool Management", _register.UsePoolManagement); // REFRESH REFERENCE OBJECTS BEGIN ICECreatureEntity[] _entities = GameObject.FindObjectsOfType <ICECreatureEntity>(); EditorGUI.BeginDisabledGroup(_entities == null); if (_entities != null) { GUI.backgroundColor = (_entities.Length != _register.ReferenceGameObjects.Count ? Color.yellow : Color.green); } if (ICEEditorLayout.Button("UPDATE", "Updates the list of reference objects")) { _register.UpdateReferences(); } GUI.backgroundColor = ICEEditorLayout.DefaultBackgroundColor; EditorGUI.EndDisabledGroup(); // REFRESH REFERENCE OBJECTS END ICEEditorLayout.EndHorizontal(ref _register.ShowReferencesInfo, ref _register.ReferencesInfo, Info.REGISTER_REFERENCE_OBJECTS); // HEADER END if (!m_foldout) // && ! _register.UseReferenceCategories ) { return; } EditorGUI.indentLevel++; if (_register.UseReferenceCategories) { foreach (ReferenceGroupCategory _cat in _register.ReferenceGroupCategories) { if (_cat.ReferenceGroupObjects.Count > 0) { DrawReferenceGroupListCat(_register, _cat.Type.ToString(), _cat, ref _cat.Foldout); } } } else { DrawReferenceGroupList(_register, _register.ReferenceGroupObjects); } EditorGUILayout.Separator(); ICEEditorStyle.SplitterByIndent(EditorGUI.indentLevel); ICEEditorLayout.BeginHorizontal(); GameObject _new = (GameObject)EditorGUILayout.ObjectField("Add Reference Object", null, typeof(GameObject), true); if (_new != null) { _register.AddReference(_new); } ICEEditorLayout.EndHorizontal(Info.REGISTER_REFERENCE_OBJECTS_ADD); EditorGUI.indentLevel--; EditorGUILayout.Separator(); ICEEditorStyle.SplitterByIndent(0); // REFRESH REFERENCE OBJECTS BEGIN EditorGUI.BeginDisabledGroup(_entities == null); if (_entities != null) { GUI.backgroundColor = (_entities.Length > _register.ReferenceGameObjects.Count ? Color.yellow : Color.green); } if (ICEEditorLayout.ButtonExtraLarge("UPDATE REFERENCE OBJECTS", "Updates the list of reference objects")) { _register.UpdateReferences(); } GUI.backgroundColor = ICEEditorLayout.DefaultBackgroundColor; EditorGUI.EndDisabledGroup(); // REFRESH REFERENCE OBJECTS END }
private static void DrawMissionPatrol(ICECreatureControl _control) { ICEEditorStyle.SplitterByIndent(EditorGUI.indentLevel); //HEADER BEGIN ICEEditorLayout.BeginHorizontal(); _control.Creature.Missions.Patrol.Foldout = ICEEditorLayout.Foldout(_control.Creature.Missions.Patrol.Foldout, "Patrol Mission"); if (ICEEditorLayout.SaveButton()) { CreatureEditorIO.SaveMissionPatrolToFile(_control.Creature.Missions.Patrol, _control.gameObject.name); } if (ICEEditorLayout.LoadButton()) { _control.Creature.Missions.Patrol = CreatureEditorIO.LoadMissionPatrolFromFile(_control.Creature.Missions.Patrol); } if (ICEEditorLayout.ResetButton()) { _control.Creature.Missions.Patrol = new PatrolObject(); } _control.Creature.Missions.Patrol.Enabled = ICEEditorLayout.EnableButton(_control.Creature.Missions.Patrol.Enabled); ICEEditorLayout.EndHorizontal(Info.MISSION_PATROL); //HEADER END if (!_control.Creature.Missions.Patrol.Foldout) { return; } EditorGUI.BeginDisabledGroup(_control.Creature.Missions.Patrol.Enabled == false); EditorGUILayout.Separator(); EditorGUI.indentLevel++; _control.Creature.Missions.Patrol.BehaviourFoldout = ICEEditorLayout.Foldout(_control.Creature.Missions.Patrol.BehaviourFoldout, "Behaviour", Info.MISSION_OUTPOST_BEHAVIOR, true); if (_control.Creature.Missions.Patrol.BehaviourFoldout) { _control.Creature.Missions.Patrol.BehaviourModeTravel = BehaviourEditor.BehaviourSelect(_control, "Travel", "Default travel behaviour to reach the first waypoint", _control.Creature.Missions.Patrol.BehaviourModeTravel, "WP_TRAVEL"); _control.Creature.Missions.Patrol.BehaviourModePatrol = BehaviourEditor.BehaviourSelect(_control, "Patrol", "Default patrol behaviour to reach the next waypoint", _control.Creature.Missions.Patrol.BehaviourModePatrol, "WP_PATROL"); BehaviourEditor.DrawInRangeBehaviour(_control, ref _control.Creature.Missions.Patrol.BehaviourModeLeisure, ref _control.Creature.Missions.Patrol.BehaviourModeRendezvous, ref _control.Creature.Missions.Patrol.DurationOfStay, ref _control.Creature.Missions.Patrol.IsTransitPoint, 1); EditorGUILayout.Separator(); } EditorGUI.indentLevel--; EditorGUI.indentLevel++; ICEEditorLayout.BeginHorizontal(); int _count_all = _control.Creature.Missions.Patrol.Waypoints.Waypoints.Count; int _count_valid = _control.Creature.Missions.Patrol.Waypoints.GetValidWaypoints().Count; string _title = "Waypoints" + (_count_all > 0 ? " (" + _count_valid + "/" + _count_all + ")" : ""); _control.Creature.Missions.Patrol.WaypointsFoldout = ICEEditorLayout.Foldout(_control.Creature.Missions.Patrol.WaypointsFoldout, _title, true); _control.Creature.Missions.Patrol.Waypoints.WaypointGroup = (GameObject)EditorGUILayout.ObjectField(_control.Creature.Missions.Patrol.Waypoints.WaypointGroup, typeof(GameObject), true, GUILayout.Width(65)); _control.Creature.Missions.Patrol.Waypoints.WaypointGroup = null; //if( ICEEditorLayout.ButtonMiddle( "RESET", "Removes all waypoints." ) ) // _control.Creature.Missions.Patrol.Waypoints.Waypoints.Clear(); if (ICEEditorLayout.ListClearButton <WaypointObject>(_control.Creature.Missions.Patrol.Waypoints.Waypoints)) { return; } if (ICEEditorLayout.AddButtonSmall("Adds a new waypoint item.")) { _control.Creature.Missions.Patrol.Waypoints.Waypoints.Add(new WaypointObject()); } GUILayout.Space(5); ICEEditorLayout.ListFoldoutButtons <WaypointObject>(_control.Creature.Missions.Patrol.Waypoints.Waypoints); ICEEditorLayout.EndHorizontal(Info.MISSION_PATROL_WAYPOINTS); if (_control.Creature.Missions.Patrol.WaypointsFoldout) { ICEEditorLayout.BeginHorizontal(); _control.Creature.Missions.Patrol.Waypoints.Order = (WaypointOrderType)ICEEditorLayout.EnumPopup("Order Type", "", _control.Creature.Missions.Patrol.Waypoints.Order); EditorGUI.BeginDisabledGroup(_control.Creature.Missions.Patrol.Waypoints.Order != WaypointOrderType.CYCLE); _control.Creature.Missions.Patrol.Waypoints.Ascending = !ICEEditorLayout.CheckButtonSmall("DESC", "descending order", !_control.Creature.Missions.Patrol.Waypoints.Ascending); EditorGUI.EndDisabledGroup(); ICEEditorLayout.EndHorizontal(Info.MISSION_PATROL_ORDER_TYPE); EditorGUILayout.Separator(); for (int i = 0; i < _control.Creature.Missions.Patrol.Waypoints.Waypoints.Count; ++i) { if (DrawMissionPatrolWaypoint(_control, i)) { return; } } } EditorGUI.indentLevel--; EditorGUI.EndDisabledGroup(); EditorGUILayout.Separator(); }
//private vp_DamageInfo.DamageType _damage_type; public override void OnInspectorGUI() { ICECreatureTPCAdapter _adapter = (ICECreatureTPCAdapter)target; ICECreatureControl _control = _adapter.GetComponent <ICECreatureControl>(); EditorGUILayout.Separator(); _adapter.UseCreatureDamage = ICEEditorLayout.ToggleLeft("Creature Damage", "", _adapter.UseCreatureDamage, true); if (_adapter.UseCreatureDamage) { EditorGUI.indentLevel++; _adapter.UseAdvanced = ICEEditorLayout.ToggleLeft("Use Advanced", "", _adapter.UseAdvanced, true); if (_adapter.UseAdvanced) { CreatureObjectEditor.DrawInfluenceDataObject(_adapter.Influences, EditorHeaderType.FOLDOUT_ENABLED_BOLD, _control.Creature.Status.UseAdvanced); } EditorGUI.indentLevel--; EditorGUILayout.Separator(); } _adapter.UsePlayerDamage = ICEEditorLayout.ToggleLeft("Player Damage", "", _adapter.UsePlayerDamage, true); if (_adapter.UsePlayerDamage) { EditorGUI.indentLevel++; _adapter.UseMultiplePlayerDamageHandler = ICEEditorLayout.Toggle("Use Multiple Damage Handler", "", _adapter.UseMultiplePlayerDamageHandler, ""); if (_adapter.UseMultiplePlayerDamageHandler) { foreach (ICECreaturePlayerDamageObject _damage in _adapter.PlayerDamages) { ICEEditorLayout.BeginHorizontal(); ICEEditorLayout.Label(_damage.DamageBehaviourModeKey, true); GUILayout.FlexibleSpace(); if (GUILayout.Button(new GUIContent("X", "Delete"), ICEEditorStyle.CMDButton)) { _adapter.PlayerDamages.Remove(_damage); return; } ICEEditorLayout.EndHorizontal(); DrawPlayerDamage(_control, _damage); } ICEEditorStyle.SplitterByIndent(EditorGUI.indentLevel + 1); ICEEditorLayout.BeginHorizontal(); _damage_behaviour = Popups.BehaviourPopup(_control, _damage_behaviour); EditorGUI.BeginDisabledGroup(_damage_behaviour.Trim() == ""); if (GUILayout.Button(new GUIContent("ADD", "Adds a new damage handler"), ICEEditorStyle.CMDButtonDouble)) { _adapter.AddPlayerDamage(_damage_behaviour); } EditorGUI.EndDisabledGroup(); ICEEditorLayout.EndHorizontal(); } else { DrawPlayerDamage(_control, _adapter.SimpleDamage); } EditorGUI.indentLevel--; } EditorGUI.indentLevel++; EditorGUILayout.Separator(); }
public static void Print(ICECreatureControl _control) { if (m_creature_register == null) { m_creature_register = ICECreatureRegister.Register; } if (m_creature_register == null) { return; } if (!_control.Display.ShowInteractionSettings) { return; } ICEEditorStyle.SplitterByIndent(0); ICEEditorLayout.BeginHorizontal(); _control.Display.FoldoutInteraction = ICEEditorLayout.Foldout(_control.Display.FoldoutInteraction, "Interaction"); if (GUILayout.Button(new GUIContent("SAVE", "Saves the complete interaction settings to file"), ICEEditorStyle.ButtonMiddle)) { CreatureIO.SaveInteractionToFile(_control.Creature.Interaction, _control.gameObject.name); } if (GUILayout.Button(new GUIContent("LOAD", "Loads existing interaction settings form file"), ICEEditorStyle.ButtonMiddle)) { _control.Creature.Interaction = CreatureIO.LoadInteractionFromFile(_control.Creature.Interaction); } if (GUILayout.Button(new GUIContent("RESET", "Removes all interaction settings"), ICEEditorStyle.ButtonMiddle)) { _control.Creature.Interaction.Reset(); } ICEEditorLayout.EndHorizontal(Info.INTERACTION); if (!_control.Display.FoldoutInteraction) { return; } EditorGUILayout.Separator(); EditorGUI.indentLevel++; for (int _interactor_index = 0; _interactor_index < _control.Creature.Interaction.Interactors.Count; ++_interactor_index) { DrawInteractor(_control, _control.Creature.Interaction, _interactor_index); } EditorGUI.indentLevel--; ICEEditorStyle.SplitterByIndent(EditorGUI.indentLevel + 1); ICEEditorLayout.BeginHorizontal(); EditorGUILayout.LabelField("Add Interactor", ICEEditorStyle.LabelBold); if (GUILayout.Button(new GUIContent("LOAD", "Load existing interactor settings from file"), ICEEditorStyle.ButtonMiddle)) { _control.Creature.Interaction.Interactors.Add(CreatureIO.LoadInteractorFromFile(new InteractorObject())); } if (GUILayout.Button(new GUIContent("ADD", "Create a new interactor record"), ICEEditorStyle.ButtonMiddle)) { _control.Creature.Interaction.Interactors.Add(new InteractorObject()); } ICEEditorLayout.EndHorizontal(); EditorGUILayout.Separator(); }
private static void DrawEnvironmentSurfaceSettings(ICECreatureControl _control) { ICEEditorLayout.BeginHorizontal(); _control.Creature.Environment.SurfaceHandler.Enabled = ICEEditorLayout.ToggleLeft("Surfaces", "", _control.Creature.Environment.SurfaceHandler.Enabled, true); if (GUILayout.Button(new GUIContent("ADD", "add a new surface rule"), ICEEditorStyle.ButtonMiddle)) { _control.Creature.Environment.SurfaceHandler.Surfaces.Add(new SurfaceDataObject()); } if (GUILayout.Button(new GUIContent("RESET", "removes all surface rules"), ICEEditorStyle.ButtonMiddle)) { _control.Creature.Environment.SurfaceHandler.Surfaces.Clear(); } ICEEditorLayout.EndHorizontal(Info.ENVIROMENT_SURFACE); if (_control.Creature.Environment.SurfaceHandler.Surfaces.Count == 0) { _control.Creature.Environment.SurfaceHandler.Enabled = false; } EditorGUI.BeginDisabledGroup(_control.Creature.Environment.SurfaceHandler.Enabled == false); EditorGUI.indentLevel++; for (int i = 0; i < _control.Creature.Environment.SurfaceHandler.Surfaces.Count; ++i) { // HEADER BEGIN SurfaceDataObject _surface = _control.Creature.Environment.SurfaceHandler.Surfaces[i]; if (_surface.Name == "") { _surface.Name = "Surface Rule #" + (i + 1); } ICEEditorLayout.BeginHorizontal(); _surface.Foldout = ICEEditorLayout.Foldout(_surface.Foldout, _surface.Name); _surface.Enabled = ICEEditorLayout.ButtonCheck("ACTIVE", "activates/deactivates the rule", _surface.Enabled, ICEEditorStyle.ButtonMiddle); if (GUILayout.Button(new GUIContent("REMOVE", "removes the selected surface rule"), ICEEditorStyle.ButtonMiddle)) { _control.Creature.Environment.SurfaceHandler.Surfaces.RemoveAt(i); --i; } ICEEditorLayout.EndHorizontal(Info.ENVIROMENT_SURFACE_RULE); // HEADER END // CONTENT if (_surface.Foldout) { EditorGUI.BeginDisabledGroup(_surface.Enabled == false); ICEEditorLayout.BeginHorizontal(); _surface.Name = ICEEditorLayout.Text("Name", "", _surface.Name); if (GUILayout.Button(new GUIContent("CLR", ""), ICEEditorStyle.CMDButtonDouble)) { _surface.Name = ""; } ICEEditorLayout.EndHorizontal(Info.ENVIROMENT_SURFACE_RULE_NAME); _surface.Interval = ICEEditorLayout.DefaultSlider("Interval", "", _surface.Interval, 0.25f, 0, 30, 1, Info.ENVIROMENT_SURFACE_RULE_INTERVAL); //ICEEditorStyle.SplitterByIndent( EditorGUI.indentLevel + 1 ); DrawEnvironmentTextures(_surface); ICEEditorLayout.Label("Procedures", true, Info.ENVIROMENT_SURFACE_RULE_PROCEDURES); EditorGUI.indentLevel++; EditorGUI.BeginDisabledGroup(_surface.Textures.Count == 0); _surface.Audio = EditorSharedTools.DrawSharedAudio(_surface.Audio, Info.ENVIROMENT_SURFACE_AUDIO); _surface.Effect = EditorSharedTools.DrawSharedEffect(_surface.Effect, Info.ENVIROMENT_SURFACE_EFFECT); _surface.Influences = EditorSharedTools.DrawSharedInfluences(_surface.Influences, Info.ENVIROMENT_SURFACE_INFLUENCES); EditorGUI.EndDisabledGroup(); EditorGUI.indentLevel--; EditorGUILayout.Separator(); EditorGUI.EndDisabledGroup(); ICEEditorStyle.SplitterByIndent(EditorGUI.indentLevel + 1); } } EditorGUI.indentLevel--; EditorGUI.EndDisabledGroup(); }
private static void DrawEnvironmentCollisionSettings(ICECreatureControl _control) { // IMPACT HEADER BEGIN ICEEditorLayout.BeginHorizontal(); _control.Creature.Environment.CollisionHandler.Enabled = ICEEditorLayout.ToggleLeft("Collisions", "", _control.Creature.Environment.CollisionHandler.Enabled, true); if (GUILayout.Button(new GUIContent("ADD", "add a new impact rule"), ICEEditorStyle.ButtonMiddle)) { _control.Creature.Environment.CollisionHandler.Collisions.Add(new CollisionDataObject()); _control.Creature.Environment.CollisionHandler.Enabled = true; } if (GUILayout.Button(new GUIContent("RESET", "removes all impact rules"), ICEEditorStyle.ButtonMiddle)) { _control.Creature.Environment.CollisionHandler.Collisions.Clear(); } ICEEditorLayout.EndHorizontal(Info.ENVIROMENT_COLLISION); // IMPACT HEADER END if (_control.Creature.Environment.CollisionHandler.Collisions.Count == 0) { _control.Creature.Environment.CollisionHandler.Enabled = false; } // IMPACT CONTENT BEGIN EditorGUI.BeginDisabledGroup(_control.Creature.Environment.CollisionHandler.Enabled == false); EditorGUI.indentLevel++; for (int i = 0; i < _control.Creature.Environment.CollisionHandler.Collisions.Count; i++) { CollisionDataObject _collision = _control.Creature.Environment.CollisionHandler.Collisions[i]; if (_collision != null) { string _title = _collision.Name; if (_title == "") { _title = "Collision Rule #" + (i + 1); if (_collision.TagPriority > 0) { if (_title != "") { _title += " "; } _title += "T:" + _collision.Tag; } if (_collision.LayerPriority > 0) { if (_title != "") { _title += " "; } _title += "L:" + LayerMask.LayerToName(_collision.Layer); } _collision.Name = _title; } // IMPACT RULE HEADER BEGIN ICEEditorLayout.BeginHorizontal(); _collision.Foldout = ICEEditorLayout.Foldout(_collision.Foldout, _collision.Name); _collision.Enabled = ICEEditorLayout.ButtonCheck("ACTIVE", "activates/deactivates the selected collision rule", _collision.Enabled, ICEEditorStyle.ButtonMiddle); if (GUILayout.Button(new GUIContent("REMOVE", "removes the selected collision rule"), ICEEditorStyle.ButtonMiddle)) { _control.Creature.Environment.CollisionHandler.Collisions.Remove(_collision); return; } ICEEditorLayout.EndHorizontal(Info.ENVIROMENT_COLLISION_RULE); // IMPACT RULE HEADER END // IMPACT RULE CONTENT BEGIN if (_collision.Foldout) { EditorGUI.BeginDisabledGroup(_collision.Enabled == false); ICEEditorLayout.BeginHorizontal(); _collision.Name = ICEEditorLayout.Text("Name", "", _collision.Name); if (GUILayout.Button(new GUIContent("CLR", ""), ICEEditorStyle.CMDButtonDouble)) { _collision.Name = ""; } ICEEditorLayout.EndHorizontal(Info.ENVIROMENT_COLLISION_RULE_NAME); EditorGUILayout.Separator(); ICEEditorLayout.Label("Conditions", true, Info.ENVIROMENT_COLLISION_RULE_CONDITIONS); EditorGUI.indentLevel++; _collision.Type = (CollisionConditionType)ICEEditorLayout.EnumPopup("Type", "Collision ", _collision.Type, Info.ENVIROMENT_COLLISION_RULE_TYPE); if (_collision.Type == CollisionConditionType.LAYER) { _collision.TagPriority = 0; } else if (_collision.Type == CollisionConditionType.LAYER) { _collision.LayerPriority = 0; } if (_collision.Type == CollisionConditionType.LAYER || _collision.Type == CollisionConditionType.TAG_AND_LAYER) { _collision.Layer = ICEEditorLayout.Layer("Layer", "Desired collision layer", _collision.Layer, Info.ENVIROMENT_COLLISION_RULE_LAYER); EditorGUI.indentLevel++; _collision.LayerPriority = (int)ICEEditorLayout.DefaultSlider("Priority", "", _collision.LayerPriority, 1, 0, 10, 1, Info.ENVIROMENT_COLLISION_RULE_LAYER_PRIORITY); EditorGUI.indentLevel--; } if (_collision.Type == CollisionConditionType.TAG || _collision.Type == CollisionConditionType.TAG_AND_LAYER) { _collision.Tag = ICEEditorLayout.Tag("Tag", "Desired collision tag", _collision.Tag, Info.ENVIROMENT_COLLISION_RULE_TAG); EditorGUI.indentLevel++; _collision.TagPriority = (int)ICEEditorLayout.DefaultSlider("Priority", "", _collision.TagPriority, 1, 0, 10, 1, Info.ENVIROMENT_COLLISION_RULE_TAG_PRIORITY); EditorGUI.indentLevel--; } EditorGUI.indentLevel--; EditorGUILayout.Separator(); ICEEditorLayout.Label("Procedures", true, Info.ENVIROMENT_COLLISION_RULE_PROCEDURES); EditorGUI.indentLevel++; //_impact.ForceInteraction = EditorGUILayout.Toggle("Force Interaction", _impact.ForceInteraction ); _collision.Influences.Enabled = EditorGUILayout.Toggle("Influences", _collision.Influences.Enabled); _collision.Influences = EditorSharedTools.DrawShareInfluencesContent(_collision.Influences, Info.ENVIROMENT_COLLISION_INFLUENCES); _collision.BehaviourModeKey = EditorBehaviour.BehaviourSelect(_control, "Behaviour", "Reaction to this impact", _collision.BehaviourModeKey, "IMPACT_" + _collision.Tag.ToUpper()); EditorGUI.indentLevel--; EditorGUILayout.Separator(); EditorGUI.EndDisabledGroup(); ICEEditorStyle.SplitterByIndent(EditorGUI.indentLevel + 1); } // IMPACT RULE CONTENT END } } EditorGUILayout.Separator(); EditorGUI.indentLevel--; EditorGUI.EndDisabledGroup(); }
private static void DrawInteractor(ICECreatureControl _control, InteractionObject _interaction_object, int _index) { ICEEditorStyle.SplitterByIndent(EditorGUI.indentLevel); InteractorObject _interactor_object = _interaction_object.Interactors[_index]; ICEEditorLayout.BeginHorizontal(); _interactor_object.Foldout = EditorGUILayout.Foldout(_interactor_object.Foldout, "Interactor '" + _interactor_object.Name + "' (" + _interactor_object.Rules.Count + " Rules) ", ICEEditorStyle.Foldout); if (GUILayout.Button(new GUIContent("SAVE", "Saves selected interactor to file"), ICEEditorStyle.ButtonMiddle)) { CreatureIO.SaveInteractorToFile(_interactor_object, _interactor_object.Name); } if (GUILayout.Button(new GUIContent("LOAD", "Replaces selected interactor settings"), ICEEditorStyle.ButtonMiddle)) { _control.Creature.Interaction.Interactors.Insert(_index, CreatureIO.LoadInteractorFromFile(new InteractorObject())); _interaction_object.Interactors.Remove(_interactor_object); return; } if (GUILayout.Button(new GUIContent("REMOVE", "Removes selected interactor"), ICEEditorStyle.ButtonMiddle)) { _interaction_object.Interactors.RemoveAt(_index); --_index; return; } ICEEditorLayout.EndHorizontal(Info.INTERACTION_INTERACTOR); if (!_interactor_object.Foldout) { return; } EditorGUILayout.Separator(); _interactor_object.Enabled = ICEEditorLayout.ToggleLeft("Enabled", "", _interactor_object.Enabled, false, Info.INTERACTION_INTERACTOR_ENABLED); EditorGUI.BeginDisabledGroup(_interactor_object.Enabled == false); EditorGUILayout.Separator(); EditorSharedTools.DrawTargetSelectors(_control, _interactor_object.Selectors, TargetType.INTERACTOR, Init.SELECTION_RANGE_MIN, Init.SELECTION_RANGE_MAX); if (_interactor_object.Selectors.SelectionRange == 0) { EditorGUI.indentLevel++; Info.Note("Selection Range adjusted to zero - no regional selection restriction!"); EditorGUI.indentLevel--; } _interactor_object = DrawInteractorOffset(_control, _interactor_object); _interactor_object.BehaviourModeKey = EditorBehaviour.BehaviourSelect(_control, "Behaviour", "Behaviour while sensing this interactor", _interactor_object.BehaviourModeKey, "SENSE"); EditorGUILayout.Separator(); ICEEditorLayout.Label("Additional Rules for meeting '" + _interactor_object.Name + "' creatures.", true); if (_interactor_object.Rules.Count == 0) { Info.Note(Info.INTERACTION_INTERACTOR_NO_RULES); } else { EditorGUILayout.Separator(); for (int _behaviour_index = 0; _behaviour_index < _interactor_object.Rules.Count; _behaviour_index++) { DrawInteractorRule(_control, _interactor_object, _behaviour_index); } } ICEEditorStyle.SplitterByIndent(EditorGUI.indentLevel + 1); ICEEditorLayout.BeginHorizontal(); EditorGUILayout.LabelField("Add Interaction Rule for '" + _interactor_object.Name + "'", EditorStyles.boldLabel); if (GUILayout.Button("ADD", ICEEditorStyle.ButtonMiddle)) { _interactor_object.Rules.Add(new InteractorRuleObject("")); } ICEEditorLayout.EndHorizontal(); EditorGUILayout.Separator(); EditorGUI.EndDisabledGroup(); }
private static bool DrawMissionPatrolWaypoint(ICECreatureControl _control, int _index) { ICEEditorStyle.SplitterByIndent(EditorGUI.indentLevel); WaypointObject _waypoint = _control.Creature.Missions.Patrol.Waypoints.Waypoints[_index]; if (_waypoint == null) { return(false); } // HEADER BEGIN ICEEditorLayout.BeginHorizontal(); _waypoint.WaypointFoldout = ICEEditorLayout.Foldout(_waypoint.WaypointFoldout, "Waypoint #" + (int)(_index + 1) + (!string.IsNullOrEmpty(_waypoint.TargetName) ? " (" + _waypoint.TargetName + ")": ""), "", true); if (ICEEditorLayout.ListDeleteButton <WaypointObject>(_control.Creature.Missions.Patrol.Waypoints.Waypoints, _waypoint)) { return(true); } GUILayout.Space(5); if (ICEEditorLayout.ListUpDownButtons <WaypointObject>(_control.Creature.Missions.Patrol.Waypoints.Waypoints, _control.Creature.Missions.Patrol.Waypoints.Waypoints.IndexOf(_waypoint))) { return(true); } _waypoint.Enabled = ICEEditorLayout.EnableButton(_waypoint.Enabled); ICEEditorLayout.EndHorizontal(Info.MISSION_PATROL_WAYPOINT); // HEADER END // CONTENT BEGIN if (_waypoint.WaypointFoldout) { EditorGUI.indentLevel++; EditorGUI.BeginDisabledGroup(_waypoint.Enabled == false); TargetEditor.DrawMissionTarget(_control, (TargetObject)_waypoint, "Target", Info.MISSION_PATROL_TARGET); ICEEditorLayout.BeginHorizontal(); EditorGUI.BeginDisabledGroup(_waypoint.UseCustomBehaviour == false); _waypoint.BehaviourFoldout = ICEEditorLayout.Foldout(_waypoint.BehaviourFoldout, "Behaviour", true); EditorGUI.EndDisabledGroup(); _waypoint.UseCustomBehaviour = ICEEditorLayout.CheckButton("Override", "", _waypoint.UseCustomBehaviour, ICEEditorStyle.ButtonMiddle); ICEEditorLayout.EndHorizontal(Info.MISSION_PATROL_CUSTOM_BEHAVIOUR); if (!_waypoint.UseCustomBehaviour) { _waypoint.BehaviourFoldout = false; } if (_waypoint.BehaviourFoldout) { _waypoint.BehaviourModeTravel = BehaviourEditor.BehaviourSelect(_control, "Travel", "Travel behaviour to reach this waypoint and to start this mission", _waypoint.BehaviourModeTravel, "WP_TRAVEL_" + (int)(_index + 1)); _waypoint.BehaviourModePatrol = BehaviourEditor.BehaviourSelect(_control, "Patrol", "Patrol behaviour to reach this waypoint", _waypoint.BehaviourModePatrol, "WP_PATROL_" + (int)(_index + 1)); BehaviourEditor.DrawInRangeBehaviour(_control, ref _waypoint.BehaviourModeLeisure, ref _waypoint.BehaviourModeRendezvous, ref _waypoint.DurationOfStay, ref _waypoint.IsTransitPoint, _waypoint.Move.RandomRange, (int)(_index + 1)); EditorGUILayout.Separator(); } EditorGUI.EndDisabledGroup(); EditorGUI.indentLevel--; } // CONTENT END return(false); }
private static void DrawMissionPatrol(ICECreatureControl _control) { if (_control.Display.ShowMissionsPatrol == false) { return; } ICEEditorStyle.SplitterByIndent(EditorGUI.indentLevel); _control.Display.FoldoutMissionPatrol = ICEEditorLayout.Foldout(_control.Display.FoldoutMissionPatrol, "Patrol Mission", Info.MISSION_PATROL); if (!_control.Display.FoldoutMissionPatrol) { return; } _control.Creature.Missions.Patrol.Enabled = ICEEditorLayout.Toggle("Mission Enabled", "", _control.Creature.Missions.Patrol.Enabled, Info.MISSION_ENABLED); EditorGUILayout.Separator(); EditorGUI.BeginDisabledGroup(_control.Creature.Missions.Patrol.Enabled == false); ICEEditorLayout.BeginHorizontal(); _control.Creature.Missions.Patrol.Waypoints.Order = (WaypointOrderType)ICEEditorLayout.EnumPopup("Order Type", "", _control.Creature.Missions.Patrol.Waypoints.Order); EditorGUI.BeginDisabledGroup(_control.Creature.Missions.Patrol.Waypoints.Order != WaypointOrderType.CYCLE); _control.Creature.Missions.Patrol.Waypoints.Ascending = !ICEEditorLayout.ButtonCheck("DESC", "descending order", !_control.Creature.Missions.Patrol.Waypoints.Ascending, ICEEditorStyle.CMDButtonDouble); EditorGUI.EndDisabledGroup(); ICEEditorLayout.EndHorizontal(Info.MISSION_PATROL_ORDER_TYPE); EditorGUILayout.Separator(); EditorGUILayout.LabelField("Behaviour", ICEEditorStyle.LabelBold); EditorGUI.indentLevel++; _control.Creature.Missions.Patrol.BehaviourModeTravel = EditorBehaviour.BehaviourSelect(_control, "Travel", "Default travel behaviour to reach the first waypoint", _control.Creature.Missions.Patrol.BehaviourModeTravel, "WP_TRAVEL"); _control.Creature.Missions.Patrol.BehaviourModePatrol = EditorBehaviour.BehaviourSelect(_control, "Patrol", "Default patrol behaviour to reach the next waypoint", _control.Creature.Missions.Patrol.BehaviourModePatrol, "WP_PATROL"); EditorSharedTools.DrawInRangeBehaviour(_control, ref _control.Creature.Missions.Patrol.BehaviourModeLeisure, ref _control.Creature.Missions.Patrol.BehaviourModeRendezvous, ref _control.Creature.Missions.Patrol.DurationOfStay, ref _control.Creature.Missions.Patrol.IsTransitPoint, 1); /* * EditorGUI.BeginDisabledGroup( m_creature_control.Creature.Missions.Patrol.IsTransitPoint == true ); * m_creature_control.Creature.Missions.Patrol.BehaviourModeLeisure = EditorBehaviour.BehaviourSelect( m_creature_control, "Leisure", "Leisure activities after reaching this waypoint range", m_creature_control.Creature.Missions.Patrol.BehaviourModeLeisure, "WP_LEISURE" ); * m_creature_control.Creature.Missions.Patrol.BehaviourModeRendezvous = EditorBehaviour.BehaviourSelect( m_creature_control, "Rendezvous", "Action behaviour after reaching this current waypoint target position", m_creature_control.Creature.Missions.Patrol.BehaviourModeRendezvous, "WP_RENDEZVOUS" ); * EditorGUI.EndDisabledGroup(); * * m_creature_control.Creature.Missions.Patrol.DurationOfStay = ICEEditorLayout.DurationSlider( "Duration Of Stay", "Duration of stay", m_creature_control.Creature.Missions.Patrol.DurationOfStay, Init.DURATION_OF_STAY_STEP, Init.DURATION_OF_STAY_MIN, Init.DURATION_OF_STAY_MAX,Init.DURATION_OF_STAY_DEFAULT, ref m_creature_control.Creature.Missions.Patrol.IsTransitPoint ); */ EditorGUI.indentLevel--; EditorGUILayout.Separator(); ICEEditorLayout.Label("Waypoints", true, Info.MISSION_PATROL_WAYPOINTS); EditorGUI.indentLevel++; ICEEditorLayout.BeginHorizontal(); _control.Creature.Missions.Patrol.Waypoints.WaypointGroup = (GameObject)EditorGUILayout.ObjectField("Add Waypoint Group", _control.Creature.Missions.Patrol.Waypoints.WaypointGroup, typeof(GameObject), true); if (GUILayout.Button("REFRESH", ICEEditorStyle.ButtonLarge)) { _control.Creature.Missions.Patrol.Waypoints.UpdateWaypointGroup(); } ICEEditorLayout.EndHorizontal(Info.MISSION_PATROL_ADD_WAYPOINT_GROUP); ICEEditorLayout.BeginHorizontal(); ICEEditorLayout.Label("Add Single Waypoint", false); GUILayout.FlexibleSpace(); if (GUILayout.Button("ADD WAYPOINT", ICEEditorStyle.ButtonLarge)) { _control.Creature.Missions.Patrol.Waypoints.Waypoints.Add(new WaypointObject()); } ICEEditorLayout.EndHorizontal(Info.MISSION_PATROL_ADD_WAYPOINT); EditorGUI.indentLevel--; EditorGUILayout.Separator(); for (int i = 0; i < _control.Creature.Missions.Patrol.Waypoints.Waypoints.Count; ++i) { DrawMissionPatrolWaypoint(_control, i); } EditorGUILayout.Separator(); EditorGUI.EndDisabledGroup(); }
private static bool DrawInteractor(ICECreatureControl _control, InteractionObject _interaction_object, int _index) { ICEEditorStyle.SplitterByIndent(EditorGUI.indentLevel); InteractorObject _interactor = _interaction_object.Interactors[_index]; // INTERACTOR TITLE BEGIN string _title = "Interactor '" + _interactor.TargetTitle + "'"; if (_interactor.TargetGameObject == null) { _title += "*"; } if (_interactor.Rules.Count == 0) { _title += " (1 act)"; } else if (_interactor.Rules.Count > 1) { _title += " (" + (_interactor.Rules.Count + 1) + " acts)"; } // INTERACTOR TITLE END // HEADER BEGIN ICEEditorLayout.BeginHorizontal(); EditorGUI.BeginDisabledGroup(_interactor.Enabled == false); _interactor.InteractorFoldout = EditorGUILayout.Foldout(_interactor.InteractorFoldout, _title, ICEEditorStyle.Foldout); if (ICEEditorLayout.SaveButtonSmall("Saves selected interactor to file")) { CreatureEditorIO.SaveInteractorToFile(_interactor, _interactor.TargetName); } if (ICEEditorLayout.LoadButtonSmall("Replaces selected interactor settings")) { _interactor.Copy(CreatureEditorIO.LoadInteractorFromFile(new InteractorObject())); } if (ICEEditorLayout.CopyButtonSmall("Creates a copy of the selected interactor")) { _control.Creature.Interaction.Interactors.Add(new InteractorObject(_interactor)); } if (ICEEditorLayout.ResetButtonSmall("Resets the selected interactor settings")) { _interactor.Copy(new InteractorObject()); } EditorGUI.EndDisabledGroup(); GUILayout.Space(5); if (ICEEditorLayout.ListDeleteButton <InteractorObject>(_interaction_object.Interactors, _interactor, "Removes selected interactor")) { return(true); } GUILayout.Space(5); if (ICEEditorLayout.ListUpDownButtons <InteractorObject>(_interaction_object.Interactors, _index)) { return(true); } int _res_foldout = ICEEditorLayout.ListFoldoutButtons(_interactor.Rules); if (_res_foldout == 0 || _res_foldout == 1) { _interactor.Foldout = (_res_foldout == 1 ? true : _res_foldout == 0 ? false : _interactor.Foldout); } GUILayout.Space(5); _interactor.Enabled = ICEEditorLayout.EnableButton(_interactor.Enabled); ICEEditorLayout.PriorityButton(_interactor.AveragePriority, "Average Priority"); ICEEditorLayout.EndHorizontal(ref _interactor.ShowInteractorInfoText, ref _interactor.InteractorInfoText, Info.INTERACTION_INTERACTOR); // HEADER END if (!_interactor.InteractorFoldout) { return(false); } EditorGUI.BeginDisabledGroup(_interactor.Enabled == false); ICEEditorLayout.BeginHorizontal(); _interactor.Foldout = ICEEditorLayout.Foldout(_interactor.Foldout, " Act #1 - " + _interactor.Behaviour.BehaviourTitle()); ICEEditorLayout.PriorityButton(_interactor.SelectionPriority); ICEEditorLayout.EndHorizontal(ref _interactor.ShowInfoText, ref _interactor.InfoText, Info.INTERACTION_INTERACTOR_TARGET); if (_interactor.Foldout) { TargetEditor.DrawTargetObject(_control, _interactor, "", ""); TargetEditor.DrawTargetContent(_control, _interactor, true, "IACT_" + _index + "_0"); EditorGUILayout.Separator(); } for (int _behaviour_index = 0; _behaviour_index < _interactor.Rules.Count; _behaviour_index++) { if (DrawInteractorRule(_control, _interactor, _behaviour_index)) { return(true); } } string _tmp_title = "Add Interaction Rule" + (!string.IsNullOrEmpty(_interactor.TargetTitle) ? " for '" + _interactor.TargetTitle + "'" : ""); ICEEditorLayout.DrawListAddLine <InteractorRuleObject>(_interactor.Rules, new InteractorRuleObject(), _tmp_title); EditorGUI.EndDisabledGroup(); return(false); }
private static void DrawMissionPatrolWaypoint(ICECreatureControl _control, int _index) { ICEEditorStyle.SplitterByIndent(EditorGUI.indentLevel + 1); WaypointObject _waypoint = _control.Creature.Missions.Patrol.Waypoints.Waypoints[_index]; if (_waypoint == null) { return; } // HEADER BEGIN ICEEditorLayout.BeginHorizontal(); _waypoint.Enabled = EditorGUILayout.ToggleLeft("Waypoint #" + (int)(_index + 1), _waypoint.Enabled, EditorStyles.boldLabel); GUILayout.FlexibleSpace(); if (ICEEditorLayout.ButtonUp()) { WaypointObject _wp = _control.Creature.Missions.Patrol.Waypoints.Waypoints[_index]; _control.Creature.Missions.Patrol.Waypoints.Waypoints.RemoveAt(_index); if (_index - 1 < 0) { _control.Creature.Missions.Patrol.Waypoints.Waypoints.Add(_wp); } else { _control.Creature.Missions.Patrol.Waypoints.Waypoints.Insert(_index - 1, _wp); } return; } if (ICEEditorLayout.ButtonDown()) { WaypointObject _wp = _control.Creature.Missions.Patrol.Waypoints.Waypoints[_index]; _control.Creature.Missions.Patrol.Waypoints.Waypoints.RemoveAt(_index); if (_index + 1 > _control.Creature.Missions.Patrol.Waypoints.Waypoints.Count) { _control.Creature.Missions.Patrol.Waypoints.Waypoints.Insert(0, _wp); } else { _control.Creature.Missions.Patrol.Waypoints.Waypoints.Insert(_index + 1, _wp); } return; } if (ICEEditorLayout.ButtonCloseDouble()) { _control.Creature.Missions.Patrol.Waypoints.Waypoints.RemoveAt(_index); --_index; } ICEEditorLayout.EndHorizontal(Info.MISSION_PATROL_WAYPOINT); // HEADER END // CONTENT BEGIN EditorGUI.BeginDisabledGroup(_waypoint.Enabled == false); EditorGUI.indentLevel++; _waypoint = (WaypointObject)EditorSharedTools.DrawTarget(_control, (TargetObject)_waypoint, "Target", Info.MISSION_PATROL_TARGET); EditorGUILayout.Separator(); _waypoint.UseCustomBehaviour = ICEEditorLayout.Toggle("Custom Behaviour", "", _waypoint.UseCustomBehaviour, Info.MISSION_PATROL_CUSTOM_BEHAVIOUR); EditorGUILayout.Separator(); if (_waypoint.UseCustomBehaviour) { EditorGUI.indentLevel++; _waypoint.BehaviourModeTravel = EditorBehaviour.BehaviourSelect(_control, "Travel", "Travel behaviour to reach this waypoint and to start this mission", _waypoint.BehaviourModeTravel, "WP_TRAVEL_" + (int)(_index + 1)); _waypoint.BehaviourModePatrol = EditorBehaviour.BehaviourSelect(_control, "Patrol", "Patrol behaviour to reach this waypoint", _waypoint.BehaviourModePatrol, "WP_PATROL_" + (int)(_index + 1)); EditorSharedTools.DrawInRangeBehaviour(_control, ref _waypoint.BehaviourModeLeisure, ref _waypoint.BehaviourModeRendezvous, ref _waypoint.DurationOfStay, ref _waypoint.IsTransitPoint, _waypoint.TargetRandomRange, (int)(_index + 1)); /* * EditorGUI.BeginDisabledGroup( _waypoint.IsTransitPoint == true ); * * _waypoint.BehaviourModeLeisure = EditorBehaviour.BehaviourSelect( m_creature_control, "Leisure", "Leisure activities after reaching this waypoint range", _waypoint.BehaviourModeLeisure, "WP_LEISURE_" + _index ); * _waypoint.BehaviourModeRendezvous = EditorBehaviour.BehaviourSelect( m_creature_control, "Rendezvous", "Action behaviour after reaching this current target move position", _waypoint.BehaviourModeRendezvous, "WP_RENDEZVOUS_" + _index ); * EditorGUI.EndDisabledGroup(); * * _waypoint.DurationOfStay = ICEEditorLayout.DurationSlider( "Duration Of Stay", "Duration of stay", _waypoint.DurationOfStay, Init.DURATION_OF_STAY_STEP, Init.DURATION_OF_STAY_MIN, Init.DURATION_OF_STAY_MAX,Init.DURATION_OF_STAY_DEFAULT, ref _waypoint.IsTransitPoint ); * */ EditorGUI.indentLevel--; EditorGUILayout.Separator(); } EditorGUI.indentLevel--; EditorGUI.EndDisabledGroup(); // CONTENT END }