void Start() { text = GetComponent <Text>(); if (eventSystem == null) { GameObject obj = GameObject.Find(ABFEvents.DEFAULT_EVENT_SYSTEM_NAME); if (obj != null) { var evts = obj.GetComponent <ABFEvents>(); if (evts != null) { this.eventSystem = evts; } else { Debug.LogError($"{name} has no event system"); } } else { Debug.LogError($"{name} has no event system"); } } eventSystem.GroundEvent += OnGroundChange; }
void Start() { pm_collider = GetComponent <Collider>(); pm_collider.isTrigger = true; if (eventSystem == null) { GameObject obj = GameObject.Find(ABFEvents.DEFAULT_EVENT_SYSTEM_NAME); if (obj != null) { var evts = obj.GetComponent <ABFEvents>(); if (evts != null) { this.eventSystem = evts; } else { Debug.LogError($"{name} has no event system"); } } else { Debug.LogError($"{name} has no event system"); } } }