/// <summary>
        /// Draws the content of the target.
        /// </summary>
        /// <param name="_attribute">Attribute.</param>
        public void DrawTargetContent(ICECreatureTargetAttribute _attribute)
        {
            TargetType _type = TargetType.UNDEFINED;

            if (_attribute.GetComponentInChildren <ICECreaturePlayer>() != null)
            {
                _type = TargetType.PLAYER;
            }
            else if (_attribute.GetComponentInChildren <ICECreatureItem>() != null)
            {
                _type = TargetType.ITEM;
            }
            else if (_attribute.GetComponentInChildren <ICECreatureLocation>() != null)
            {
                _type = TargetType.WAYPOINT;
            }
            else if (_attribute.GetComponentInChildren <ICECreatureWaypoint>() != null)
            {
                _type = TargetType.WAYPOINT;
            }
            else if (_attribute.GetComponentInChildren <ICECreatureMarker>() != null)
            {
                _type = TargetType.WAYPOINT;
            }
            else if (_attribute.GetComponentInChildren <ICECreatureControl>() != null)
            {
                _type = TargetType.CREATURE;
            }

            ICEEditorLayout.Label("Default Target Settings", true);
            EditorGUI.indentLevel++;
            CreatureObjectEditor.DrawTargetSelectorsObject(null, _attribute.Target, _attribute.Target.Selectors, _type, 0, 250);
            TargetEditor.DrawTargetMoveSpecification(null, _attribute.Target);
            EditorGUI.indentLevel--;
        }
Exemplo n.º 2
0
        /// <summary>
        /// Raises the inspector GUI event.
        /// </summary>
        public override void OnInspectorGUI()
        {
            ICECreatureMission _target = DrawMissionHeader <ICECreatureMission>();

            TargetEditor.DrawTargetObject(_target.CreatureControl, _target.Target, "", "");
            TargetEditor.DrawTargetContent(_target.CreatureControl, _target.Target);

            DrawMissionFooter(_target);
        }
Exemplo n.º 3
0
        public void OnGUILayout(Action onSettingsOpen)
        {
            var targets = TargetEditor != null ? TargetEditor.targets : null;

            Foldout = ScriptableObjectCollectionGUIUtility.DrawTitlebar(Content, Foldout, onSettingsOpen, targets);

            if (Foldout)
            {
                if (TargetEditor != null)
                {
                    TargetEditor.OnInspectorGUI();
                }
                else
                {
                    EditorGUILayout.HelpBox("Missing reference, remove this element.", MessageType.Warning);
                }
            }
        }
Exemplo n.º 4
0
 public static void Init()
 {
     // Get existing open window or if none, make a new one:
     window = (TargetEditor)GetWindow(typeof(TargetEditor));
     window.Show();
 }