Skip to content

Instantly share code, notes, and snippets.

View nnm-t's full-sized avatar
🤔

Noname Kamisawa nnm-t

🤔
View GitHub Profile
@nnm-t
nnm-t / BindableMonoBehaviour.cs
Created June 27, 2017 14:32
INotifyPropertyChangedを使用してUnityでオレオレMVVM
using System;
using System.Linq.Expressions;
using System.ComponentModel;
using UnityEngine;
public abstract class BindableMonoBehaviour : MonoBehaviour, INotifyPropertyChanged
{
//プロパティの値の変更を通知するイベントハンドラ
public event PropertyChangedEventHandler PropertyChanged;
@nnm-t
nnm-t / ConvertToSprite.cs
Last active May 2, 2024 05:18
Convert Texture2D To Sprite
using UnityEngine;
public static class ConvertToSpriteExtensiton
{
public static Sprite ConvertToSprite(this Texture2D texture)
{
return Sprite.Create(texture, new Rect(0, 0, texture.width, texture.height), Vector2.zero);
}
}