public class Attribute_ : MonoBehaviour
{
[RuntimeInitializeOnLoadMethod]
static void OnRuntimeMethodLoad()
{
Debug.Log("After Scene is loaded and game is running");
}
[RuntimeInitializeOnLoadMethod]
static void OnSecondRuntimeMethodLoad()
{
Debug.Log("SecondMethod After Scene is loaded and game is running.");
}
// Header 생성
[Header("Health Settings")]
public int health = 0;
[Space(10)] // 10 pixels of spacing here.
public int maxHealth = 100;
// 숨김
[HideInInspector]
public int p = 5;
[SerializeField]
private int a = 1;
[TextArea]
public string MyTextArea;
[Tooltip("Health value between 0 and 100.")]
public int health_ = 0;
public Color _color;
[ContextMenuItem("Reset", "ResetBiography")]
[Multiline(8)]
string playerBiography = "";
void ResetBiography()
{
playerBiography = "";
}
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
static void OnBeforeSceneLoad() {
Debug.LogWarning("OnBeforeSceneLoad ======> " + UnityEngine.SceneManagement.SceneManager.GetActiveScene().name + ".unity");
}
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.AfterSceneLoad)]
static void OnAfterSceneLoad() {
Debug.LogWarning("OnAfterSceneLoad ======> " + UnityEngine.SceneManagement.SceneManager.GetActiveScene().name + ".unity");
}
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSplashScreen)]
static void OnBeforeSplashScreen() {
Debug.LogWarning("OnBeforeSplashScreen");
}
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.AfterAssembliesLoaded)]
static void OnAfterAssembliesLoaded() {
Debug.LogWarning("OnAfterAssembliesLoaded");
}
}
'Unity > Editor Inspector' 카테고리의 다른 글
상속받은 모노에 에디트 둘다 사용하기. (0) | 2024.09.06 |
---|---|
EditorWindow 에서 OnSelectionChange 호출. (0) | 2021.05.24 |
editor 에서 Selection (0) | 2020.11.16 |
GUILayoutButton 버튼 크기 조정 (0) | 2019.09.05 |
클래스 상단에 입력되는 Attribute (0) | 2019.05.28 |