Skip to content

Instantly share code, notes, and snippets.

@HassakuTb
Created July 20, 2016 12:46
Show Gist options
  • Save HassakuTb/541bbc76a1373bf4cb76d0a54495049b to your computer and use it in GitHub Desktop.
Save HassakuTb/541bbc76a1373bf4cb76d0a54495049b to your computer and use it in GitHub Desktop.
CanavsGroupにAlphaのスライダーを付加するInspector拡張
/**
NYSL Version 0.9982 (en) (Unofficial)
----------------------------------------
A. This software is "Everyone'sWare". It means:
Anybody who has this software can use it as if he/she is
the author.
A-1. Freeware. No fee is required.
A-2. You can freely redistribute this software.
A-3. You can freely modify this software. And the source
may be used in any software with no limitation.
A-4. When you release a modified version to public, you
must publish it with your name.
B. The author is not responsible for any kind of damages or loss
while using or misusing this software, which is distributed
"AS IS". No warranty of any kind is expressed or implied.
You use AT YOUR OWN RISK.
C. Copyrighted to Hassaku
D. Above three clauses are applied both to source and binary
form of this software.
*/
using UnityEngine;
using UnityEditor;
[CustomEditor(typeof(CanvasGroup))]
public class CanvasGroupEditor : Editor{
private CanvasGroup canvasGroup;
protected void OnEnable() {
canvasGroup = target as CanvasGroup;
}
public override void OnInspectorGUI() {
base.OnInspectorGUI();
canvasGroup.alpha = EditorGUILayout.Slider("Alpha", canvasGroup.alpha, 0f, 1f);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment