Last active
December 21, 2015 05:49
-
-
Save yumehachi/6259434 to your computer and use it in GitHub Desktop.
Project内のファイルにアクセスするためのUnity Editorスクリプト
This file contains hidden or 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
using UnityEngine; | |
using UnityEditor; | |
using System.Collections; | |
/// <summary> | |
/// LoadAssetAtPath Test | |
/// </summary> | |
/// <author> | |
/// Create by yumehachi on 2013/08/18 | |
/// </author> | |
public class SelectFile : Editor | |
{ | |
[MenuItem ("TestScript/SelectPrefab")] | |
static void SelectPrefab () | |
{ | |
//拡張子まで書く | |
string path = "Assets/Prefab/Cube.prefab"; | |
Object o = AssetDatabase.LoadAssetAtPath (path, typeof(Object)) as Object; | |
Selection.activeObject = o; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment