private void UpdateCurrentBrush(EObject item, Texture2D preview) { m_itemSelected = item; m_itemPreview = preview; data.brushMask = preview; Repaint(); }
private void GetSelectedItem(int index) { if (index != -1) { EObject selectedItem = _categorizedItems[_categorySelected][index]; if (ItemSelectedAction != null) { ItemSelectedAction(selectedItem, _previews[selectedItem]); } } }
private void LoadBuiltInResources() { string[] guids = AssetDatabase.FindAssets("t:texture2D", new[] { "Packages/com.v.vterrain/Editor/Textures" }); for (int i = 0; i < guids.Length; i++) { string assetPath = AssetDatabase.GUIDToAssetPath(guids[i]); Texture2D texture = AssetDatabase.LoadAssetAtPath(assetPath, typeof(Texture2D)) as Texture2D; if (texture != null) { EObject eObject = new EObject(); eObject.name = texture.name; eObject.texture2D = texture; eObject.category = ECategory.Brush; _items.Add(eObject); } } }