Exemplo n.º 1
0
    static void CreateAsset()
    {
        TagSceneQuery item = EditorUtil.CreateAsset <TagSceneQuery>(NMBEditorUtil.AssetLabel);

        EditorUtility.FocusProjectWindow();
        Selection.activeObject = item;
    }
Exemplo n.º 2
0
    /// <summary>
    /// Controls behavior of the inspector.
    /// </summary>
    public override void OnInspectorGUI()
    {
        TagSceneQuery targ = (TagSceneQuery)target;

        // Has someone done something naughty?

        if (targ.tags == null)
        {
            Debug.LogError(targ.name + "Data null reference. Resetting component.");
            targ.tags = new List <string>();
        }

        EditorGUILayout.Separator();

        EditorGUIUtility.LookLikeControls(120);

        targ.IncludeChildren = EditorGUILayout.Toggle("Include Children", targ.IncludeChildren);

        EditorGUIUtility.LookLikeControls();

        EditorGUILayout.Separator();

        EditorUtil.OnGUIManageStringList(targ.tags, true);

        EditorGUILayout.Separator();

        GUILayout.Box(
            "Scene Query\n\nComponent search will include game objects with the specified tags."
            + " The search can optionally include child game objects."
            , EditorUtil.HelpStyle
            , GUILayout.ExpandWidth(true));

        EditorGUILayout.Separator();

        if (GUI.changed)
        {
            EditorUtility.SetDirty(target);
        }
    }