HKI Core
Informer.cs
Go to the documentation of this file.
1 using UnityEngine;
2 
3 namespace HKI.Core.Assertions
4 {
10  public class Informer : MonoBehaviour
11  {
12  // Public variables
13  [SerializeField] bool CallOnAwake = false;
14  [SerializeField] bool CallOnStart = false;
15  [SerializeField] bool CallOnEnable = false;
16  [SerializeField] bool CallOnDisable = false;
17  [SerializeField] bool CallOnDestroy = false;
18 
19  // Functions
20  void Awake()
21  {
22  if(CallOnAwake)
23  Debug.Log("Awake() of " + gameObject.name);
24  }
25 
26  void Start()
27  {
28  if (CallOnStart)
29  Debug.Log("Start() of " + gameObject.name);
30  }
31 
32  void OnEnable()
33  {
34  if (CallOnDisable)
35  Debug.Log("OnEnable() of " + gameObject.name);
36  }
37 
38  void OnDisable()
39  {
40  if (CallOnAwake)
41  Debug.Log("OnDisable() of " + gameObject.name);
42  }
43 
44  void OnDestroy()
45  {
46  if (CallOnDestroy)
47  Debug.Log("OnDestroy() of " + gameObject.name);
48  }
49  }
50 }
Component to print debug information at different stages during the lifetime of a GameObject ...
Definition: Informer.cs:10