private void SetupTypes(int selectedTypeIndex) { mSelectedTypeIndex = selectedTypeIndex; if (mAssetManager.AssetTypes.Count > 0) { if (mSelectedTypeIndex == -1 || mSelectedTypeIndex >= mAssetManager.AssetTypes.Count) { mSelectedTypeIndex = 0; } mAssetManager.CurrentAssetType = mAssetManager.AssetTypes [mSelectedTypeIndex]; assetTypesContent = new GUIContent[mAssetManager.AssetTypes.Count]; for (int i = 0; i < mAssetManager.AssetTypes.Count; i++) { assetTypesContent[i] = new GUIContent(mAssetManager.AssetTypes[i], mAssetManager.AssetTypes[i]); } mWindowResizeSwitch = true; } else { mSelectedTypeIndex = -1; mAssetManager.CurrentAssetType = null; } mAdapter.Refresh(); Repaint(); }
private void SetupTypes(int selectedTypeIndex) { mSelectedTypeIndex = selectedTypeIndex; if (mAssetManager.AssetTypes.Count > 0) { if (mSelectedTypeIndex == -1 || mSelectedTypeIndex >= mAssetManager.AssetTypes.Count) { mSelectedTypeIndex = 0; } mAssetManager.CurrentAssetType = mAssetManager.AssetTypes [mSelectedTypeIndex]; assetTypesContent = new GUIContent[mAssetManager.AssetTypes.Count]; for (int i = 0; i < mAssetManager.AssetTypes.Count; i++) { assetTypesContent [i] = new GUIContent(mAssetManager.AssetTypes [i], "Choose this collection to edit"); } } else { mSelectedTypeIndex = -1; mAssetManager.CurrentAssetType = null; } mAdapter.Refresh(); Repaint(); }