private IEnumerable <GridView.Item> CreateGridViewItems() { // What to do with defaults item? auto pin them? var templateItems = m_SceneTemplateInfos.Select(info => { var item = new GridView.Item(info.GetHashCode(), info.name, info.thumbnail ? info.thumbnail : m_DefaultThumbnail, info.badge, info); return(item); }); return(templateItems); }
private IEnumerable <GridView.Item> CreateGridViewItems() { // What to do with defaults item? auto pin them? var defaultThumbnail = EditorGUIUtility.IconContent("d_SceneAsset Icon").image as Texture2D; var templateItems = m_SceneTemplateInfos.Select(info => { var item = new GridView.Item(info.GetHashCode(), info.name, info.thumbnail ? info.thumbnail : defaultThumbnail, info); return(item); }); return(templateItems); }
private void OnPinnedChanged(GridView.Item item, bool isPinned) { var info = (SceneTemplateInfo)item.userData; if (info.IsInMemoryScene || info.isReadonly) { SceneTemplateProjectSettings.Get().SetPinState(info.name, isPinned); } else { var infoObj = new SerializedObject(info.sceneTemplate); var prop = infoObj.FindProperty("addToDefaults"); prop.boolValue = isPinned; infoObj.ApplyModifiedProperties(); OnSceneTemplateAssetModified(info.sceneTemplate); } }