Tanoda
OnUnityCallback.cs
Go to the documentation of this file.
1/******************************************************************************
2 * Copyright (C) Ultraleap, Inc. 2011-2020. *
3 * *
4 * Use subject to the terms of the Apache License 2.0 available at *
5 * http://www.apache.org/licenses/LICENSE-2.0, or another agreement *
6 * between Ultraleap and you, your company or other organization. *
7 ******************************************************************************/
8
9using UnityEngine;
10
11namespace Leap.Unity.Recording {
12
13 public class OnUnityCallback : MonoBehaviour {
14
15 [SerializeField]
16 private EnumEventTable _table = null;
17
18 private void Awake() {
19 _table.Invoke((int)CallbackType.Awake);
20 }
21
22 private void Start() {
23 _table.Invoke((int)CallbackType.Start);
24 }
25
26 private void OnEnable() {
27 _table.Invoke((int)CallbackType.OnEnable);
28 }
29
30 private void OnDisable() {
31 _table.Invoke((int)CallbackType.OnDisable);
32 }
33
34 private void OnDestroy() {
35 _table.Invoke((int)CallbackType.OnDestroy);
36 }
37
38 private void FixedUpdate() {
39 _table.Invoke((int)CallbackType.FixedUpdate);
40 }
41
42 private void Update() {
43 _table.Invoke((int)CallbackType.Update);
44 }
45
46 private void LateUpdate() {
47 _table.Invoke((int)CallbackType.LateUpdate);
48 }
49
50 public void GenericCallback() {
51 _table.Invoke((int)CallbackType.GenericCallback);
52 }
53
54 public enum CallbackType {
55 Awake,
56 Start,
57 OnEnable,
58 OnDisable,
59 OnDestroy,
60 FixedUpdate,
61 Update,
62 LateUpdate,
64 }
65 }
66}
void Invoke(int enumValue)