This file contains 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 UnityEngine.EventSystems; | |
using UnityEngine.UI; | |
public class DropdownFixer : MonoBehaviour, IPointerClickHandler | |
{ | |
public Dropdown Dropdown; | |
public int ElementHeight = 50; //The height of the elements in your Dropdown | |
public void OnPointerClick(PointerEventData eventData) |
This file contains 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
//Minimal sample of how to drag a ScriptableObject into a scene | |
//onto a GameObject in that scene, and have something happen as a result | |
using UnityEngine; | |
using UnityEditor; | |
[CustomEditor(typeof(CustomScriptableObjectAsset))] | |
public class CustomScriptableObjectAssetEditor : Editor | |
{ |
This file contains 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; | |
public class MeshUtil | |
{ | |
public static Mesh DeepCopy(Mesh sourceMesh) | |
{ | |
//Instead of getting all a mesh's properties by hand, and re-creating a mesh, | |
//use the API used for the job system and Burst compiler. | |
//This seems to work fine when not using either of those. | |
Mesh meshCopy = new Mesh(); |