Created
April 10, 2017 08:23
-
-
Save iwashihead/9e54a9ea2dec71ce1142fdff2e904d36 to your computer and use it in GitHub Desktop.
選択補助メニューアイテム
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//------------------------------------------------------- | |
// @file SelectionHelper.cs | |
// @brief . | |
// | |
// @author haruki.tachihara | |
//------------------------------------------------------- | |
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
using UnityEngine.SceneManagement; | |
using UnityEditor; | |
using UnityEditor.SceneManagement; | |
public class SelectionHelper | |
{ | |
[MenuItem("Assets/Select/Textures")] | |
public static void SelectTextures() { | |
Select<Texture2D>(SelectionMode.DeepAssets); | |
} | |
[MenuItem("Assets/Select/Sprites")] | |
public static void SelectSprites() { | |
Select<Sprite>(SelectionMode.DeepAssets); | |
} | |
[MenuItem("Assets/Select/AudioClips")] | |
public static void SelectAudioClips() { | |
Select<AudioClip>(SelectionMode.DeepAssets); | |
} | |
[MenuItem("Assets/Select/Shaders")] | |
public static void SelectShaders() { | |
Select<Shader>(SelectionMode.DeepAssets); | |
} | |
[MenuItem("Assets/Select/Materials")] | |
public static void SelectMaterials() { | |
Select<Material>(SelectionMode.DeepAssets); | |
} | |
[MenuItem("Assets/Select/Prefabs")] | |
public static void SelectPrefabs() { | |
Select<GameObject>(SelectionMode.DeepAssets); | |
} | |
[MenuItem("Assets/Select/AnimationClips")] | |
public static void SelectAnimationClips() { | |
Select<AnimationClip>(SelectionMode.DeepAssets); | |
} | |
[MenuItem("Assets/Select/AnimatorControllers")] | |
public static void SelectAnimatorControllers() { | |
Select<RuntimeAnimatorController>(SelectionMode.DeepAssets); | |
} | |
[MenuItem("Assets/Select/Scenes")] | |
public static void SelectScenes() { | |
Select<SceneAsset>(SelectionMode.DeepAssets); | |
} | |
[MenuItem("Assets/Select/Scripts")] | |
public static void SelectScripts() { | |
Select<MonoScript>(SelectionMode.DeepAssets); | |
} | |
[MenuItem("Assets/Select/TextAssets")] | |
public static void SelectTextAssets() { | |
Select<TextAsset>(SelectionMode.DeepAssets); | |
} | |
[MenuItem("Assets/Select/ScriptableObjects")] | |
public static void SelectScriptableObjects() { | |
Select<ScriptableObject>(SelectionMode.DeepAssets); | |
} | |
public static void Select<T>(SelectionMode mode) | |
{ | |
Selection.objects = Selection.GetFiltered(typeof(T), mode); | |
} | |
} |
Author
iwashihead
commented
Apr 10, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment