Exemplo n.º 1
0
    public override void OnInspectorGUI()
    {
        base.OnInspectorGUI();
        Test0717 t = target as Test0717;

        if (GUILayout.Button("Generate"))
        {
            t.Generate();
            var list = Resources.FindObjectsOfTypeAll(typeof(GameObject));
            for (int i = 0; i < list.Length; i++)
            {
                if (list[i] != t.gameObject)
                {
                    list[i].hideFlags = HideFlags.HideInHierarchy;
                }
            }
        }
        if (GUILayout.Button("ShowElse"))
        {
            var list = Resources.FindObjectsOfTypeAll(typeof(GameObject));
            for (int i = 0; i < list.Length; i++)
            {
                if (list[i] != t.gameObject)
                {
                    list[i].hideFlags = HideFlags.None;
                }
            }
        }
    }
Exemplo n.º 2
0
    public void OnSceneGUI()
    {
        Test0717 t = target as Test0717;

        if (Event.current.type == EventType.mouseDown)
        {
            edit = !edit;
        }
        if (edit && Event.current.type == EventType.MouseMove)
        {
            t.Raycast(true);
        }
    }