コガネブログ

平日更新を目標に Unity や C#、Visual Studio、ReSharper などのゲーム開発アレコレを書いていきます

【Unity】Inspector にゲージを表示する PropertyAttribute「StatsBarAttribute」紹介

はじめに

https://gist.github.com/LotteMakesStuff/b8853a16de3e680dc1c326fe6f5ebd7e

「StatsBarAttribute」は Inspector にゲージを表示する PropertyAttribute です

使用例

using UnityEngine;

public class Example : MonoBehaviour
{
    [StatsBar( "max", StatsBarColor.Green )] public float hp;
    [StatsBar( "max", StatsBarColor.Blue )] public float mp;

    public float max;
}

f:id:baba_s:20171228134403p:plain

関連記事