Skip to content

Instantly share code, notes, and snippets.

@ina-amagami
Last active March 28, 2022 07:04
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ina-amagami/7512a1f30ed4dd778993fb06ef1acafd to your computer and use it in GitHub Desktop.
Save ina-amagami/7512a1f30ed4dd778993fb06ef1acafd to your computer and use it in GitHub Desktop.
uGUIで描画を行わない、入力をとるだけの専用コンポーネント
using UnityEngine;
using UnityEngine.UI;
#if UNITY_EDITOR
using UnityEditor;
#endif
public class HideImage : Graphic
{
public override Material material
{
get => null;
set {}
}
public override Material materialForRendering => null;
public override void SetAllDirty()
{
SetLayoutDirty();
}
public override void SetVerticesDirty() { }
public override void SetMaterialDirty() { }
protected override void UpdateGeometry() { }
protected override void OnPopulateMesh(VertexHelper vh) { }
}
#if UNITY_EDITOR
[CustomEditor(typeof(HideImage))]
public class HideImageEditor : Editor
{
public override void OnInspectorGUI()
{
}
}
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment