void OnNewCollideWithPlane(IEventBase eventBase) { BallsPlaneCollideEvent ballscollide = eventBase as BallsPlaneCollideEvent; PlaneInfo planeinfo = new PlaneInfo() { planeNum = ballscollide.planeNum, levelNum = ballscollide.levelNum, finalPlane = ballscollide.finalPlane }; progressList.Add(planeinfo); CheckForFailOrWin(); }
private void OnCollisionEnter(Collision collision) { if (!collision.gameObject.CompareTag("Plane")) { EndBallFly(); BallCollideWallEvent ballfail = new BallCollideWallEvent(); EventAggregator.Publish(ballfail); } if (collision.gameObject.CompareTag("Plane")) { BallsPlaneCollideEvent planeCollideEvent = new BallsPlaneCollideEvent() { planeNum = collision.gameObject.GetComponent <PlaneInfo>().planeNum, levelNum = collision.gameObject.GetComponent <PlaneInfo>().levelNum, finalPlane = collision.gameObject.GetComponent <PlaneInfo>().finalPlane }; EventAggregator.Publish(planeCollideEvent); } }