Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Addlistener on OnEndReach in code is not working
#1
I have the following

Code:
dc = GetComponent<DebtCollector>();        if (dc != null)        {            if (sc != null && !sc.Spline.Closed)            {                sc.OnEndReached.AddListener(e => {                    if (dc != null)                        dc.Collect();                });                sc.OnEndReached.CheckForListeners();            }        }

But the function is never called.
Any idea what is causing this?

I also tried by passing a member function but non is working.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Bug Issues when working with in-place prefabs Sacryn 4 4,228 02-27-2024, 04:08 PM
Last Post: _Aka_
  Permission to publish custom CGModule source code? Apelsin 6 15,381 09-15-2022, 08:53 PM
Last Post: Josaf Tom
Photo Position in Input Spots not working on all directions. Mike Danielsson 2 2,476 09-03-2022, 02:22 PM
Last Post: Mike Danielsson
  Import/Export, Spline from code Mos Def 4 5,483 02-14-2022, 11:42 AM
Last Post: _Aka_

Forum Jump: