示例#1
0
        public static void SelectAsset <T>(string path) where T : Object
        {
            var asset = ConverterUtils.LoadResource <T>(path);

            if (asset)
            {
                EditorGUIUtility.PingObject(asset);
            }
        }
示例#2
0
        private static T ReadResource <T>(StyleSheet sheet, StyleProperty property) where T : UnityEngine.Object
        {
            if (property.values[0].valueType == StyleValueType.Keyword && sheet.ReadKeyword(property.values[0]) == StyleValueKeyword.None)
            {
                return(null);
            }

            var path = sheet.ReadResourcePath(property.values[0]);

            return(ConverterUtils.LoadResource <T>(path));
        }