public PROPAGATION onMessage(string message, System.Object obj) { // Debug.Log("Click TrafficLightToggle"); if (message == "Click") { Vector2 clickPos = Game.instance.screenToWorldPosInBasePlane((Vector3)obj); CircleTouchWithPosId touchArea = toggles.Find(i => i.isInside(clickPos)); if (touchArea != null) { TrafficLightIndex.toggleLightsForPos(touchArea.posId); // return PROPAGATION.STOP_AFTER_SAME_TYPE; return(PROPAGATION.DEFAULT); } } return(PROPAGATION.CONTINUE_WITH_OTHER_TYPES); }
void OnDestroy() { TrafficLightIndex.RemoveTrafficLight(this); }